| Title: | Client for the 'OddsRelay' Sports Odds API |
|---|---|
| Description: | Provides one function for each read endpoint of the 'OddsRelay' web service <https://oddsrelay.io/docs>, which serves bookmaker and exchange odds for the UK and Ireland. Requests ask for compressed replies, send entity tags so that unchanged data is not transferred again, wait as the service asks when it is busy, and signal refusals as classed conditions that carry the service's error code and request id. Replies are returned as lists and data frames, with the token and rate limit headers attached as attributes. |
| Authors: | James OddsRelay [aut, cre], OddsRelay [cph] |
| Maintainer: | James OddsRelay <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-10-22 10:12:57 UTC |
| Source: | https://github.com/oddsrelay/oddsrelay-r |
or_odds() reads one matched board, where each selection pairs bookmaker
back prices with exchange lay prices. or_raw() reads bookmaker and
exchange prices by event, unpaired, a page at a time. or_event() reads one
event's raw prices. These calls spend tokens: pass quote = TRUE to learn
what a call costs without making it.
or_odds(type, ..., .key = NULL) or_raw(..., .key = NULL) or_event(id, ..., .key = NULL)or_odds(type, ..., .key = NULL) or_raw(..., .key = NULL) or_event(id, ..., .key = NULL)
type |
The board: |
... |
Filters, named as in the API reference, such as |
.key |
Your API key. Left out, it is read from the |
id |
An event id: |
The decoded JSON body as a list, with arrays of records as data
frames; a format = "bare" call returns the data frame alone. The reply's
token and rate limit headers ride along as attributes: see
oddsrelay-package.
# What would it cost? or_odds("standard", region = "uk", sports = "soccer", quote = TRUE) board <- or_odds("standard", region = "uk", sports = "soccer", markets = "h2h") board$data[, c("commence_time", "home_team", "away_team")] attr(board, "tokens") page <- or_raw(region = "uk", sports = "tennis", limit = 50) page$meta$next_cursor# What would it cost? or_odds("standard", region = "uk", sports = "soccer", quote = TRUE) board <- or_odds("standard", region = "uk", sports = "soccer", markets = "h2h") board$data[, c("commence_time", "home_team", "away_team")] attr(board, "tokens") page <- or_raw(region = "uk", sports = "tennis", limit = 50) page$meta$next_cursor
The keys the odds calls filter on. or_sports() lists sport and
competition keys and or_events() the upcoming events for one sport key,
both a page at a time (pass meta$next_cursor back as cursor).
or_bookmakers() lists the bookmakers and exchanges with their keys, and
or_regions() the region codes open to your key. These calls spend no
tokens.
or_sports(..., .key = NULL) or_events(sport, ..., .key = NULL) or_bookmakers(..., .key = NULL) or_regions(.key = NULL)or_sports(..., .key = NULL) or_events(sport, ..., .key = NULL) or_bookmakers(..., .key = NULL) or_regions(.key = NULL)
... |
Filters, named as in the API reference, such as |
.key |
Your API key. Left out, it is read from the |
sport |
A sport key from |
The decoded JSON body as a list, with arrays of records as data
frames; a format = "bare" call returns the data frame alone. The reply's
token and rate limit headers ride along as attributes: see
oddsrelay-package.
sports <- or_sports(region = "uk") head(sports$data[, c("key", "title")]) or_events("tennis", region = "uk") or_bookmakers(format = "bare") or_regions()sports <- or_sports(region = "uk") head(sports$data[, c("key", "title")]) or_events("tennis", region = "uk") or_bookmakers(format = "bare") or_regions()
or_status() says whether each product is serving and needs no key.
or_coverage() lists which bookmakers, exchanges and sports each product
carries; it needs no key, and gives more detail with one. or_health()
says when each board was last processed and whether any is behind.
or_healthz() is a plain-text liveness check and or_openapi() returns the
API description; neither needs a key.
or_status(..., .key = NULL) or_coverage(..., .key = NULL) or_health(.key = NULL) or_healthz() or_openapi()or_status(..., .key = NULL) or_coverage(..., .key = NULL) or_health(.key = NULL) or_healthz() or_openapi()
... |
Filters, named as in the API reference, such as |
.key |
Your API key. Left out, it is read from the |
As for or_odds(). or_healthz() returns a single string and
or_openapi() a list that keeps the description's own structure.
or_status(region = "uk") names(or_coverage(region = "uk")$products) cat(or_healthz()) or_openapi()$info$versionor_status(region = "uk") names(or_coverage(region = "uk")$products) cat(or_healthz()) or_openapi()$info$version
or_usage() returns the tokens your account has used and has left, and
what your key may read. or_pricing() returns the token rate card. Neither
spends tokens.
or_usage(.key = NULL) or_pricing(.key = NULL)or_usage(.key = NULL) or_pricing(.key = NULL)
.key |
Your API key. Left out, it is read from the |
The decoded JSON body as a list, with arrays of records as data
frames; a format = "bare" call returns the data frame alone. The reply's
token and rate limit headers ride along as attributes: see
oddsrelay-package.
or_usage()$tokens or_pricing()or_usage()$tokens or_pricing()