View source: R/safegraph_api.R
safegraph_api | R Documentation |
THIS FUNCTION IS NOT YET FULLY OPERATIONAL AND WILL ONLY WORK FOR PLACEKEY CALLS
safegraph_api( key, placekeys = NULL, location = NULL, search = NULL, first = 10, after = NULL, dataset = "core", date = NULL, select = NULL, batch = FALSE, display_call = FALSE, ... )
key |
A character string containing an API Access Key. See https://docs.safegraph.com/reference/access-and-authentication to get one. |
placekeys |
A character vector of Placekeys to look up data with. If this is more than 20 Placekeys long, batching will be performed automatically as long as |
location |
A named vector of location data, or one-row |
search |
A named list of filter settings that specifies a set of filter criteria for the SafeGraph POIs. Data will be returned for the first |
first |
If using |
after |
If using |
dataset |
The SafeGraph response dataset(s) to get from. Can be |
date |
If |
select |
A character vector with the names of the variables you want returned. Defaults to all variables in the dataset. For the list of variables in each |
batch |
Set to |
display_call |
Set to |
... |
Currently unused |
This function will allow you to make API requests of the SafeGraph API. See the documentation for the Places API here: https://docs.safegraph.com/docs/places-api.
## Not run: # You can look up data for individual placekeys mydat = safegraph_api('MY API KEY', placekeys = "222-223@5x4-4b6-mff", select = 'open_hours') # Or a vector of them # For specific addresses address = list('location_name' = "Taco Bell",'street_address' = "710 3rd St", 'city'="San Francisco",'region' = "CA", 'iso_country_code' = "US") mydat = safegraph_api('MY API KEY', location= address, select = 'open_hours') # Or for (a subset of) POIs that match a search search <- list('city' = 'San Francisco', 'brand' = 'Starbucks') mydat = safegraph_api('MY API KEY', search = search, select = 'raw_visit_counts', dataset = 'weekly_patterns', date = '2021-01-01') ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.