Reads Google Custom Search API credentials from environment variables. This allows secure decoupling of API keys from code.
Value
A named list with elements:
engine– The Google Custom Search Engine IDkey– The API key string
Details
The following environment variables must be defined:
SCRAPING_APIKEY_GOOGLE– Your Google Custom Search API keySCRAPING_ENGINE_GOOGLE– The Custom Search Engine (CSE) identifier
These values can be defined inside ~/.Renviron or set at runtime using
Sys.setenv().
Examples
## Example:
Sys.setenv(SCRAPING_APIKEY_GOOGLE = "your_key")
Sys.setenv(SCRAPING_ENGINE_GOOGLE = "your_engine")
creds <- getGoogleCreds()
print(creds)
#> $engine
#> [1] "your_engine"
#>
#> $key
#> [1] "your_key"
#>