# NOT RUN {
## see the key
gargle_api_key()
# use the key with the Places API (explicitly enabled for this key)
# gets restaurants close to a location in Vancouver, BC
req <- request_build(
method = "GET",
path = "maps/api/place/nearbysearch/json",
params = list(
location = "49.268682,-123.167117",
radius = 100,
type = "restaurant"
),
key = gargle_api_key(),
base_url = "https://maps.googleapis.com"
)
resp <- request_make(req)
out <- response_process(resp)
vapply(out$results, function(x) x$name, character(1))
# }
Run the code above in your browser using DataLab