Skip to main content
Breaking in 4.0.0
  • Integer id columns are decimal strings — Every id column of integers (id, *_id, game_pk, playerId, …) comes back as exact decimal strings on every surface — parsers, producers, loaders, HockeyTech analytics. Compare and join ids as strings; Number(row.game_id) for a safe number back. (changelog)
  • An empty or non-JSON 2xx body raises AssetFetchError — An empty 200 or an HTML challenge page is a failed fetch, not "" / []. Catch AssetFetchError (unknown — retry later) apart from NoDataError (nothing there). (changelog)
  • 400 / 422 raise InvalidParameterError — For every family (it was AssetFetchError), never retried; the message names host, path and status with a redacted excerpt of the body. (changelog)
  • Typed returns — generated row types for parsed: true — TypeScript only. A wrapper's raw payload resolves to unknown (was any); verified endpoints resolve to their row interfaces; the summary dispatchers to ParsedTables. Narrow or cast a raw payload. (changelog)
  • Typed wrapper params and loader rows; strict mode — TypeScript only. A param the endpoint does not have, a missing required path param or a non-boolean bool param is a type error; parser rows are Record<string, unknown>; loader rows are their generated row types. (changelog)
  • Wrapper failures raise NoDataError / AssetFetchError — Instead of raw axios errors. NoDataError = the fetch worked and there is nothing there (404, ESPN { code: 404 }); AssetFetchError = the fetch failed (403 / 429 / 5xx after retries, network). Retries follow DEFAULT_RETRY_STATUSES with backoff. (changelog)

odds — native provider reference

  • namespace: sdv.odds (standalone — not an ESPN league)
  • families: The Odds API
  • wrappers: 10 native

odds is a cross-sport provider namespace (no ESPN {sport}/{league} nesting). Every method is exposed under BOTH its snake_case name (<family>_<endpoint>, py/R parity) and a camelCase canonical name (<family><Endpoint>) on sdv.odds. Pass { parsed: true } to any endpoint to get tidy rows instead of raw JSON.

import sdv from 'sportsdataverse';

// The Odds API uses a plain `apiKey` query param (you supply it):
await sdv.odds.oddsApiSports({ api_key: process.env.ODDS_API_KEY });

Native API — The Odds API​

Flat (non-ESPN) wrappers for the-odds-api.com. Host: https://api.the-odds-api.com. Each method is exposed under BOTH its snake_case name odds_api_<endpoint> (sdv-py's name, py/R parity) and its camelCase form (canonical) on sdv.odds. Pass { parsed: true } to run the payload through its tidy.js parser; omit it for the raw response.

MethodHTTPPath paramsQuery paramsParserAuth
odds_api_event_markets / oddsApiEventMarketshttps://api.the-odds-api.com/v4/sports/{sport_key}/events/{event_id}/marketssport_key*, event_id*api_key → apiKey, regions, bookmakers, date_format → dateFormatparse_odds_api_event_markets—
odds_api_event_odds / oddsApiEventOddshttps://api.the-odds-api.com/v4/sports/{sport_key}/events/{event_id}/oddssport_key*, event_id*api_key → apiKey, regions, markets, odds_format → oddsFormat, date_format → dateFormat, bookmakersparse_odds_api_event_odds—
odds_api_event_odds_history / oddsApiEventOddsHistoryhttps://api.the-odds-api.com/v4/historical/sports/{sport_key}/events/{event_id}/oddssport_key*, event_id*api_key → apiKey, date, regions, markets, odds_format → oddsFormat, date_format → dateFormat, bookmakersparse_odds_api_event_odds_history—
odds_api_sports / oddsApiSportshttps://api.the-odds-api.com/v4/sports—api_key → apiKey, allparse_odds_api_sports—
odds_api_sports_events / oddsApiSportsEventshttps://api.the-odds-api.com/v4/sports/{sport_key}/eventssport_key*api_key → apiKey, date_format → dateFormat, event_ids → eventIds, commence_time_from → commenceTimeFrom, commence_time_to → commenceTimeToparse_odds_api_sports_events—
odds_api_sports_events_history / oddsApiSportsEventsHistoryhttps://api.the-odds-api.com/v4/historical/sports/{sport_key}/eventssport_key*api_key → apiKey, date, date_format → dateFormat, event_ids → eventIds, commence_time_from → commenceTimeFrom, commence_time_to → commenceTimeToparse_odds_api_sports_events_history—
odds_api_sports_odds / oddsApiSportsOddshttps://api.the-odds-api.com/v4/sports/{sport_key}/oddssport_key*api_key → apiKey, regions, markets, odds_format → oddsFormat, date_format → dateFormat, event_ids → eventIds, bookmakers, commence_time_from → commenceTimeFrom, commence_time_to → commenceTimeToparse_odds_api_sports_odds—
odds_api_sports_odds_history / oddsApiSportsOddsHistoryhttps://api.the-odds-api.com/v4/historical/sports/{sport_key}/oddssport_key*api_key → apiKey, date, regions, markets, odds_format → oddsFormat, date_format → dateFormat, event_ids → eventIds, bookmakersparse_odds_api_sports_odds_history—
odds_api_sports_participants / oddsApiSportsParticipantshttps://api.the-odds-api.com/v4/sports/{sport_key}/participantssport_key*api_key → apiKeyparse_odds_api_sports_participants—
odds_api_sports_scores / oddsApiSportsScoreshttps://api.the-odds-api.com/v4/sports/{sport_key}/scoressport_key*api_key → apiKey, days_from → daysFrom, date_format → dateFormat, event_ids → eventIdsparse_odds_api_sports_scores—

Returns — odds_api_event_markets / oddsApiEventMarkets​

col_nametypedescription
idcharacterA unique 32 character identifier for the event (echoes event_id).
sport_keycharacterA unique slug for the sport, e.g. basketball_nba. Use this as the sport param in /odds requests.
sport_titlecharacterA presentable title of the sport, e.g. NBA. Occasionally this value can change (for example, if a league undergoes a name change or change in sponsorship).
commence_timecharacterThe match start time (ISO 8601 formatted). Will be a unix timestamp integer if the dateFormat query param is set to unix.
home_teamcharacterThe home team. If home/away is not applicable for the sport (such as MMA and Tennis), it will be one of the participants. Null for outrights (futures) events.
away_teamcharacterThe away team. If home/away is not applicable for the sport (such as MMA and Tennis), it will be one of the participants. Null for outrights (futures) events.
bookmaker_keycharacterA unique slug (key) of the bookmaker, e.g. draftkings.
bookmakercharacterA formatted title of the bookmaker, e.g. DraftKings.
market_keycharacterThe unique key for an available odds market offered by the bookmaker, e.g. player_points.
market_last_updatecharacterA timestamp of when the market's odds were last read. Will be an integer if dateFormat=unix, otherwise a string.

Rows are untyped Row[] (not parity-verified yet).

Returns — odds_api_event_odds / oddsApiEventOdds​

col_nametypedescription
idcharacterA unique 32 character identifier for the event (echoes event_id).
sport_keycharacterA unique slug for the sport, e.g. basketball_nba. Use this as the sport param in /odds requests.
sport_titlecharacterA presentable title of the sport, e.g. NBA. Occasionally this value can change (for example, if a league undergoes a name change or change in sponsorship).
commence_timecharacterThe match start time (ISO 8601 formatted). Will be a unix timestamp integer if the dateFormat query param is set to unix.
home_teamcharacterThe home team. If home/away is not applicable for the sport (such as MMA and Tennis), it will be one of the participants. Null for outrights (futures) events.
away_teamcharacterThe away team. If home/away is not applicable for the sport (such as MMA and Tennis), it will be one of the participants. Null for outrights (futures) events.
bookmaker_keycharacterA unique slug (key) of the bookmaker, e.g. draftkings.
bookmakercharacterA formatted title of the bookmaker, e.g. DraftKings.
market_keycharacterThe unique key for the odds market, e.g. player_points.
market_last_updatecharacterA timestamp of when the market's odds were last read. Will be an integer if dateFormat=unix, otherwise a string.
outcomes_namecharacterThe outcome label. The value depends on the market -- for totals markets Over/Under, for team markets the team or participant name, or Draw.
outcomes_descriptioncharacterAdditional information about the outcome, only relevant for certain markets (for example, the player's name for player prop markets). Absent for featured markets.
outcomes_pricenumericThe odds of the outcome. The format is determined by the oddsFormat query param (decimal by default).
outcomes_pointnumericThe handicap or points of the outcome, only applicable to spreads/totals/prop markets (missing for h2h and outrights markets).

Rows are untyped Row[] (not parity-verified yet).

Returns — odds_api_event_odds_history / oddsApiEventOddsHistory​

col_nametypedescription
timestampcharacterThe timestamp of the snapshot. This will be the closest available timestamp equal to or earlier than the provided date parameter.
previous_timestampcharacterThe preceding available timestamp. Use as the date parameter in a new request to move back in time.
next_timestampcharacterThe next available timestamp. Use as the date parameter in a new request to move forward in time.
idcharacterA unique 32 character identifier for the event (echoes event_id).
sport_keycharacterA unique slug for the sport, e.g. basketball_nba. Use this as the sport param in /odds requests.
sport_titlecharacterA presentable title of the sport, e.g. NBA. Occasionally this value can change (for example, if a league undergoes a name change or change in sponsorship).
commence_timecharacterThe match start time (ISO 8601 formatted). Will be a unix timestamp integer if the dateFormat query param is set to unix.
home_teamcharacterThe home team. If home/away is not applicable for the sport (such as MMA and Tennis), it will be one of the participants. Null for outrights (futures) events.
away_teamcharacterThe away team. If home/away is not applicable for the sport (such as MMA and Tennis), it will be one of the participants. Null for outrights (futures) events.
bookmaker_keycharacterA unique slug (key) of the bookmaker, e.g. draftkings.
bookmakercharacterA formatted title of the bookmaker, e.g. DraftKings.
bookmaker_last_updatecharacterA timestamp of when the bookmaker's odds were last read. Will be an integer if dateFormat=unix, otherwise a string.
market_keycharacterThe unique key for the odds market, e.g. player_points.
market_last_updatecharacterA timestamp of when the market's odds were last read. Will be an integer if dateFormat=unix, otherwise a string. Prefer this over bookmaker_last_update to check the recency of odds.
outcomes_namecharacterThe outcome label. The value depends on the market -- for totals markets Over/Under, for team markets the team or participant name, or Draw.
outcomes_descriptioncharacterAdditional information about the outcome, only relevant for certain markets (for example, the player's name for player prop markets). Absent for featured markets.
outcomes_pricenumericThe odds of the outcome. The format is determined by the oddsFormat query param (decimal by default).
outcomes_pointnumericThe handicap or points of the outcome, only applicable to spreads/totals/prop markets (missing for h2h and outrights markets).

Rows are untyped Row[] (not parity-verified yet).

Returns — odds_api_sports / oddsApiSports​

col_nametypedescription
keycharacterA unique slug (key) of the sport, e.g. americanfootball_nfl. Use this as the sport_key param in odds/events requests.
groupcharacterA broader grouping for the sport, e.g. American Football.
titlecharacterA presentable title of the sport, e.g. NFL.
descriptioncharacterA brief description of the sport. Subject to change (for example, if sponsors change).
activelogicalIndicates if the sport is in season. TRUE when the sport is currently in season.
has_outrightslogicalIndicates if the sport has outrights (futures) markets. TRUE when outright markets are offered.

Rows are untyped Row[] (not parity-verified yet).

Returns — odds_api_sports_events / oddsApiSportsEvents​

col_nametypedescription
idcharacterA unique 32 character identifier for the event. Use as event_id elsewhere.
sport_keycharacterA unique slug for the sport, e.g. basketball_nba. Use this as the sport param in /odds requests.
sport_titlecharacterA presentable title of the sport, e.g. NBA. Occasionally this value can change (for example, if a league undergoes a name change or change in sponsorship).
commence_timecharacterThe match start time (ISO 8601 formatted). Will be a unix timestamp integer if the dateFormat query param is set to unix.
home_teamcharacterThe home team. If home/away is not applicable for the sport (such as MMA and Tennis), it will be one of the participants. Null for outrights (futures) events.
away_teamcharacterThe away team. If home/away is not applicable for the sport (such as MMA and Tennis), it will be one of the participants. Null for outrights (futures) events.
home_rotationintegerThe rotation number of the home team. Only returned when include_rotation_numbers = TRUE; can be null. Available in historical data from November 2025.
away_rotationintegerThe rotation number of the away team. Only returned when include_rotation_numbers = TRUE; can be null. Available in historical data from November 2025.

Rows are untyped Row[] (not parity-verified yet).

Returns — odds_api_sports_events_history / oddsApiSportsEventsHistory​

col_nametypedescription
timestampcharacterThe timestamp of the snapshot. This will be the closest available timestamp equal to or earlier than the provided date parameter.
previous_timestampcharacterThe preceding available timestamp. Use as the date parameter in a new request to move back in time.
next_timestampcharacterThe next available timestamp. Use as the date parameter in a new request to move forward in time.
idcharacterA unique 32 character identifier for the event. Use as event_id elsewhere.
sport_keycharacterA unique slug for the sport, e.g. basketball_nba. Use this as the sport param in /odds requests.
sport_titlecharacterA presentable title of the sport, e.g. NBA. Occasionally this value can change (for example, if a league undergoes a name change or change in sponsorship).
commence_timecharacterThe match start time (ISO 8601 formatted). Will be a unix timestamp integer if the dateFormat query param is set to unix.
home_teamcharacterThe home team. If home/away is not applicable for the sport (such as MMA and Tennis), it will be one of the participants. Null for outrights (futures) events.
away_teamcharacterThe away team. If home/away is not applicable for the sport (such as MMA and Tennis), it will be one of the participants. Null for outrights (futures) events.
home_rotationintegerThe rotation number of the home team. Only returned when include_rotation_numbers = TRUE; can be null. Available in historical data from November 2025.
away_rotationintegerThe rotation number of the away team. Only returned when include_rotation_numbers = TRUE; can be null. Available in historical data from November 2025.

Rows are untyped Row[] (not parity-verified yet).

Returns — odds_api_sports_odds / oddsApiSportsOdds​

col_nametypedescription
idcharacterA unique 32 character identifier for the event.
sport_keycharacterA unique slug for the sport, e.g. basketball_nba. Use this as the sport param in /odds requests.
sport_titlecharacterA presentable title of the sport, e.g. NBA. Occasionally this value can change (for example, if a league undergoes a name change or change in sponsorship).
commence_timecharacterThe match start time (ISO 8601 formatted). Will be a unix timestamp integer if the dateFormat query param is set to unix.
home_teamcharacterThe home team. If home/away is not applicable for the sport (such as MMA and Tennis), it will be one of the participants. Null for outrights (futures) events.
away_teamcharacterThe away team. If home/away is not applicable for the sport (such as MMA and Tennis), it will be one of the participants. Null for outrights (futures) events.
bookmaker_keycharacterA unique slug (key) of the bookmaker, e.g. draftkings.
bookmakercharacterA formatted title of the bookmaker, e.g. DraftKings.
bookmaker_last_updatecharacterA timestamp of when the bookmaker's odds were last read. Will be an integer if dateFormat=unix, otherwise a string.
market_keycharacterThe unique key for the odds market, e.g. spreads.
market_last_updatecharacterA timestamp of when the market's odds were last read. Will be an integer if dateFormat=unix, otherwise a string. Prefer this over bookmaker_last_update to check the recency of odds.
outcomes_namecharacterThe outcome label. The value depends on the market -- for totals markets Over/Under, for team markets the team or participant name, or Draw.
outcomes_pricenumericThe odds of the outcome. The format is determined by the oddsFormat query param (decimal by default).
outcomes_pointnumericThe handicap or points of the outcome, only applicable to spreads and totals markets (missing for h2h and outrights markets).

Rows are untyped Row[] (not parity-verified yet).

Returns — odds_api_sports_odds_history / oddsApiSportsOddsHistory​

col_nametypedescription
timestampcharacterThe timestamp of the snapshot. This will be the closest available timestamp equal to or earlier than the provided date parameter.
previous_timestampcharacterThe preceding available timestamp. Use as the date parameter in a new request to move back in time.
next_timestampcharacterThe next available timestamp. Use as the date parameter in a new request to move forward in time.
idcharacterA unique 32 character identifier for the event.
sport_keycharacterA unique slug for the sport, e.g. basketball_nba. Use this as the sport param in /odds requests.
sport_titlecharacterA presentable title of the sport, e.g. NBA. Occasionally this value can change (for example, if a league undergoes a name change or change in sponsorship).
commence_timecharacterThe match start time (ISO 8601 formatted). Will be a unix timestamp integer if the dateFormat query param is set to unix.
home_teamcharacterThe home team. If home/away is not applicable for the sport (such as MMA and Tennis), it will be one of the participants. Null for outrights (futures) events.
away_teamcharacterThe away team. If home/away is not applicable for the sport (such as MMA and Tennis), it will be one of the participants. Null for outrights (futures) events.
bookmaker_keycharacterA unique slug (key) of the bookmaker, e.g. draftkings.
bookmakercharacterA formatted title of the bookmaker, e.g. DraftKings.
bookmaker_last_updatecharacterA timestamp of when the bookmaker's odds were last read. Will be an integer if dateFormat=unix, otherwise a string.
market_keycharacterThe unique key for the odds market, e.g. spreads.
market_last_updatecharacterA timestamp of when the market's odds were last read. Will be an integer if dateFormat=unix, otherwise a string. Prefer this over bookmaker_last_update to check the recency of odds.
outcomes_namecharacterThe outcome label. The value depends on the market -- for totals markets Over/Under, for team markets the team or participant name, or Draw.
outcomes_pricenumericThe odds of the outcome. The format is determined by the oddsFormat query param (decimal by default).
outcomes_pointnumericThe handicap or points of the outcome, only applicable to spreads and totals markets (missing for h2h and outrights markets).

Rows are untyped Row[] (not parity-verified yet).

Returns — odds_api_sports_participants / oddsApiSportsParticipants​

col_nametypedescription
idcharacterA unique id of the participant, e.g. par_01hqmkq6fdf1pvq7jgdd7hdmpf.
full_namecharacterThe participant name -- either a team name or player name depending on the sport. This endpoint does not return players on a team.

Rows are untyped Row[] (not parity-verified yet).

Returns — odds_api_sports_scores / oddsApiSportsScores​

col_nametypedescription
idcharacterA unique 32 character identifier for the event.
sport_keycharacterA unique slug for the sport, e.g. basketball_nba. Use this as the sport param in /odds requests.
sport_titlecharacterA presentable title of the sport, e.g. NBA. Occasionally this value can change (for example, if a league undergoes a name change or change in sponsorship).
commence_timecharacterThe match start time (ISO 8601 formatted). Will be a unix timestamp integer if the dateFormat query param is set to unix.
completedlogicalTRUE if the event has finished, otherwise FALSE.
home_teamcharacterThe home team. If home/away is not applicable for the sport (such as MMA and Tennis), it will be one of the participants. Null for outrights (futures) events.
away_teamcharacterThe away team. If home/away is not applicable for the sport (such as MMA and Tennis), it will be one of the participants. Null for outrights (futures) events.
scoreslistA list of teams and their scores (per-team name/score pairs, stringified). Empty / NULL/NA if the event has not started.
last_updatecharacterISO 8601 datetime of when the scores were last updated. NA/null until the event has started.

Rows are untyped Row[] (not parity-verified yet).

Generated by tools/codegen/generate.mjs from tools/codegen/endpoints/odds_api.yaml (JS-owned) — see How this library is built.