Odds API Key RegistrationSource:
Save your API Key as a system environment variable
Called as a side-effect to ensure that a user has an API key stored in their environment before making a call to the Odds API service.
To get access to an API key, follow the instructions at https://the-odds-api.com
Using the key:
You can save the key for consistent usage by adding
ODDS_API_KEY=XXXX-YOUR-API-KEY-HERE-XXXXX to your .Renviron file (easily accessed via
a new script will pop open named
paste the following in the new script that pops up (without quotations)
ODDS_API_KEY = XXXX-YOUR-API-KEY-HERE-XXXXX
Save the script and restart your RStudio session, by clicking
Session (in between
Build) and click
(there also exists the shortcut
Ctrl + Shift + F10 to restart your session).
If set correctly, from then on you should be able to use any of the
toa_ functions without any other changes.
For less consistent usage:
At the beginning of every session or within an R environment, save your API key as the environment variable
ODDS_API_KEY (with quotations)
using a command like the following.
Sys.setenv(ODDS_API_KEY = "XXXX-YOUR-API-KEY-HERE-XXXXX")