get_gt_api_key | R Documentation |
This function will read your GOOGLE TRENDS FOR HEALTH API key
from the environment variables.
If you do not have an .Renviron
file, the function will create one
for you. If you already have an .Renviron
file, the function will
append the key to your existing file, while making a backup of your
original file for recovery purposes.
get_gt_api_key(key = NULL)
key |
The API key from your Google Developer project authorized for Google Trends for Health API use, formatted in quotes. A key can be acquired by requesting access at https://support.google.com/trends/contact/trends_api and following the setup instructions. |
Returns the API key that is set in the GOOGLE_TRENDS_FOR_HEALTH_API_KEY environment variable.
tryCatch(
get_gt_api_key(),
error = function(e) cat("You need to set up a valid key")
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.