Package {oddsapiio}


Title: Client for the 'Odds-API.io' Sports Betting Odds API
Version: 0.1.1
Description: Query live and upcoming sports betting odds from the 'Odds-API.io' REST API https://docs.odds-api.io. Covers sports, bookmakers, leagues, events, per-event odds, value bets and arbitrage bets across 265+ bookmakers, returned as tidy data frames. An API key is required; a free tier is available.
License: MIT + file LICENSE
URL: https://odds-api.io, https://github.com/odds-api-io/odds-api-r
BugReports: https://github.com/odds-api-io/odds-api-r/issues
Encoding: UTF-8
Imports: httr2 (≥ 1.0.0), jsonlite
Suggests: testthat (≥ 3.0.0)
Config/testthat/edition: 3
Config/roxygen2/version: 8.0.0
NeedsCompilation: no
Packaged: 2026-07-27 16:06:20 UTC; markusbjermeland
Author: Markus Bjermeland [aut, cre]
Maintainer: Markus Bjermeland <markus@odds-api.io>
Repository: CRAN
Date/Publication: 2026-08-05 09:20:13 UTC

oddsapiio: Client for the 'Odds-API.io' Sports Betting Odds API

Description

Query live and pre-match sports betting odds from the 'Odds-API.io' REST API https://docs.odds-api.io. Covers sports, bookmakers, leagues, events, per-event odds, value bets and arbitrage bets across 265+ bookmakers, returned as tidy data frames. An API key is required; a free tier is available.

Author(s)

Maintainer: Markus Bjermeland markus@odds-api.io

Authors:

See Also

Useful links:


Get arbitrage bets

Description

Returns arbitrage opportunities across the given bookmakers, including the legs and optimal stake split for each opportunity.

Usage

oa_arbitrage_bets(
  bookmakers,
  limit = NULL,
  include_event_details = FALSE,
  api_key = NULL
)

Arguments

bookmakers

Character vector of bookmaker names to compare. Required by the API.

limit

Optional maximum number of results (default 50, max 500).

include_event_details

If TRUE, event information is included.

api_key

API key. Defaults to the ODDS_API_KEY environment variable. Not required for this endpoint.

Value

A data frame with one row per arbitrage opportunity. The legs and optimalStakes columns are list-columns of data frames.

Examples

## Not run: 
arbs <- oa_arbitrage_bets(c("Bet365", "SingBet"),
                          include_event_details = TRUE)
arbs[order(-arbs$profitMargin), ]

## End(Not run)

List available bookmakers

Description

Returns the bookmakers covered by 'Odds-API.io'. This endpoint does not require an API key.

Usage

oa_bookmakers(api_key = NULL)

Arguments

api_key

API key. Defaults to the ODDS_API_KEY environment variable. Not required for this endpoint.

Value

A data frame with one row per bookmaker (columns name and active).

Examples

## Not run: 
bookmakers <- oa_bookmakers()
head(bookmakers)

## End(Not run)

List events for a sport

Description

Returns upcoming, live or settled events. When to is omitted the API returns events within the next 14 days, hard-capped at 5000 rows per response; use limit and skip to paginate.

Usage

oa_events(
  sport,
  league = NULL,
  status = NULL,
  from = NULL,
  to = NULL,
  limit = NULL,
  skip = NULL,
  bookmaker = NULL,
  participant_id = NULL,
  api_key = NULL
)

Arguments

sport

Sport slug, e.g. "football". See oa_sports().

league

Optional league slug, e.g. "england-premier-league".

status

Optional statuses to include: any of "pending", "live", "settled". A vector is collapsed to a comma-separated list.

from, to

Optional RFC 3339 date-times bounding the event window, e.g. "2026-09-01T00:00:00Z".

limit

Optional maximum number of events (capped at 5000).

skip

Optional pagination offset, used together with limit.

bookmaker

Optional bookmaker name; only events with odds from that bookmaker are returned.

participant_id

Optional team or participant id to filter by.

api_key

API key. Defaults to the ODDS_API_KEY environment variable. Not required for this endpoint.

Value

A data frame with one row per event.

Examples

## Not run: 
events <- oa_events("football", league = "england-premier-league")
live <- oa_events("football", status = c("pending", "live"))

## End(Not run)

List leagues for a sport

Description

List leagues for a sport

Usage

oa_leagues(sport, api_key = NULL)

Arguments

sport

Sport slug, e.g. "football". See oa_sports().

api_key

API key. Defaults to the ODDS_API_KEY environment variable. Not required for this endpoint.

Value

A data frame with one row per league (columns name, slug and eventsCount).

Examples

## Not run: 
leagues <- oa_leagues("football")
head(leagues)

## End(Not run)

Get odds for an event

Description

Fetches odds for one event from up to 30 bookmakers and returns them as a tidy data frame with one row per price line.

Usage

oa_odds(event_id, bookmakers, api_key = NULL)

Arguments

event_id

Event id, from oa_events().

bookmakers

Character vector of bookmaker names (max 30), e.g. c("Bet365", "SingBet"). Required by the API.

api_key

API key. Defaults to the ODDS_API_KEY environment variable. Not required for this endpoint.

Value

A data frame with one row per odds line, with columns eventId, bookmaker, market, updatedAt and the price columns present in the response (such as home, draw, away, hdp, over, under).

Examples

## Not run: 
odds <- oa_odds(123456, bookmakers = c("Bet365", "SingBet"))
subset(odds, market == "ML")

## End(Not run)

List available sports

Description

Returns the sports covered by 'Odds-API.io'. This endpoint does not require an API key.

Usage

oa_sports(api_key = NULL)

Arguments

api_key

API key. Defaults to the ODDS_API_KEY environment variable. Not required for this endpoint.

Value

A data frame with one row per sport (columns name and slug).

Examples

## Not run: 
sports <- oa_sports()
head(sports)

## End(Not run)

Get value bets

Description

Returns value betting opportunities for a bookmaker, calculated by comparing its odds against the market consensus.

Usage

oa_value_bets(
  bookmaker,
  sport = NULL,
  league = NULL,
  include_event_details = FALSE,
  api_key = NULL
)

Arguments

bookmaker

Bookmaker name, e.g. "Bet365". Required by the API.

sport

Optional sport slug filter, e.g. "baseball".

league

Optional league slug filter; requires sport to be set.

include_event_details

If TRUE, event information (teams, date, sport, league) is included in the result.

api_key

API key. Defaults to the ODDS_API_KEY environment variable. Not required for this endpoint.

Value

A data frame with one row per value bet, including the bet side, expected value and bookmaker odds.

Examples

## Not run: 
vb <- oa_value_bets("Bet365", include_event_details = TRUE)
vb[vb$expectedValue > 0.03, ]

## End(Not run)