"Factual" (Service Connection)
-
See Also
- ServiceExecute
- ServiceConnect
-
- Service Connections
- Yelp
-
-
See Also
- ServiceExecute
- ServiceConnect
-
- Service Connections
- Yelp
-
See Also
"Factual" (Service Connection)
Obsolete
Connecting & Authenticating
ServiceConnect["Factual"] creates a connection to the Factual API.
Requests
ServiceExecute["Factual","request",params] sends a request to the Factual API, using parameters params. The following give possible requests.
List of Places
"PlacesList" — a List of rules with information on local businesses (restaurants, hotels, spas, salons, etc.) and points of interest (museums, airports, beaches, landmarks, etc.)
"PlacesDataset" — a Dataset of information on local businesses and points of interest
| "Query" | (required) | place names or other keywords to search for | |
| "Location" | None | GeoPosition to search near | |
| "Radius" | None | search radius in meters (only valid with "Location") | |
| "Region" | None | US state to search within | |
| "Locality" | None | US city to search near | |
| MaxItems | 10 | number of results to return per request | |
| "Sort" | "Distance" | sorting order parameter (i.e. "Distance", "Name") | |
| "InterpretEntities" | False | use Interpreter to find canonical Wolfram Language representations of cities, states, dates, etc. |
Examples
Basic Examples (1)
factual = ServiceConnect["Factual"]results = factual["PlacesDataset", {"Location" -> ["Wolfram Research"], "Radius" -> ["500 yards"], "Sort" -> "Distance", "Query" -> "coffee"}];results[All, {"Name", "Address", "Distance"}]GeoListPlot[
Tooltip[#["Location"], Column[{#["Name"], #["HourDisplay"]}]]& /@ results, GeoRangePadding -> Quantity[200, "Yards"]]hours = (# -> (# /. Flatten[results[2, "Hours"]//Normal]))& /@ {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"};TimelinePlot[hours[[All, 2]], PlotLegends -> hours[[All, 1]], ImageSize -> Medium]Get information about places given a locality or a region:
results = factual["PlacesDataset", "Locality" -> ["champaign"], "Query" -> "Vegan and vegetarian food", MaxItems -> 5]factual["PlacesDataset", "Region" -> Entity["AdministrativeDivision", {"Illinois", "UnitedStates"}], "Query" -> "Vegan and vegetarian food", MaxItems -> 5]