Skip to contents


To access the API, get a free API key from

Installation & Usage


You can install the released version of oddsapiR from GitHub with:

# You can install using the pacman package using the following code:
if (!requireNamespace('pacman', quietly = TRUE)){
# if you would prefer devtools installation
if (!requireNamespace('devtools', quietly = TRUE)){
# Alternatively, using the devtools package:
devtools::install_github(repo = "sportsdataverse/oddsapiR")
git clone
cd oddsapi
Rscript -e "devtools::install()"

Odds API Keys

The Odds API requires an API key, here’s a quick run-down:

  • 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 usethis::edit_r_environ()). Run usethis::edit_r_environ(), a new script will pop open named .Renviron, THEN paste the following in the new script that pops up (without quotations)

Save the script and restart your RStudio session, by clicking Session (in between Plots and Build) and click Restart R (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 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.


For more information on the package and function reference, please see the oddsapiR documentation website.

Breaking Changes

Full News on Releases

Follow the SportsDataverse on Twitter and star this repo

Twitter Follow

GitHub stars

Our Authors


To cite the oddsapiR R package in publications, use:

BibTex Citation

  author = {Gilani, Saiem},
  title = {oddsapiR: The SportsDataverse's R Package for The Odds API.},
  url = {},
  year = {2022}