gargle_api_key

0th

Percentile

API key for demonstration purposes

Returns an API key for use when test driving gargle. Some API requests for public resources do not require authorization, in which case the request can be sent with an API key in lieu of a token. If you want to get your own API key, setup a new project in Google Developers Console, enable the APIs of interest, and follow the instructions in Setting up API keys.

Usage
gargle_api_key()
Value

A Google API key

Aliases
  • gargle_api_key
Examples
# 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))
# }
Documentation reproduced from package gargle, version 0.1.3, License: MIT + file LICENSE

Community examples

Looks like there are no examples yet.