Odds & Markets API
Markets and money lines
Every oddType the Odds & Markets API serves, how a price is represented for athlete and team sports, and how to convert decimal odds.
Markets for athlete and field sports (surfing, racing, motocross, bull riding, combat) come from one endpoint, selected by oddType. Team sports with their own routes (curling, lacrosse, table tennis, jai alai) return money line, spread and total groups instead. This page covers both, then shows how to work with the prices.
Requesting a market
GET /api/v1/public/events/{eventId}/{oddType}curl -s "https://api.altsportsdata.com/api/v1/public/events/$EVENT_ID/eventWinner" \
-H "X-API-Key: $ALTSPORTSDATA_API_KEY"import os
import httpx
BASE = "https://api.altsportsdata.com/api/v1/public"
HEADERS = {"X-API-Key": os.environ["ALTSPORTSDATA_API_KEY"]}
def get_market(event_id: str, odd_type: str, **params: str | int) -> dict:
resp = httpx.get(f"{BASE}/events/{event_id}/{odd_type}", headers=HEADERS, params=params)
resp.raise_for_status()
body = resp.json()
return body["data"] if isinstance(body, dict) and "data" in body else body # unwrap the envelope when present
market = get_market(os.environ["EVENT_ID"], "eventWinner")
for outcome in market["eventWinner"]:
print(outcome["athlete"]["lastName"], outcome["odds"], outcome["status"])const BASE = "https://api.altsportsdata.com/api/v1/public";
async function getMarket(eventId: string, oddType: string, params: Record<string, string> = {}) {
const url = new URL(`${BASE}/events/${eventId}/${oddType}`);
for (const [k, v] of Object.entries(params)) url.searchParams.set(k, v);
const resp = await fetch(url, { headers: { "X-API-Key": process.env.ALTSPORTSDATA_API_KEY! } });
if (!resp.ok) throw new Error(`HTTP ${resp.status}`);
const body = await resp.json();
return body.data ?? body; // unwrap the envelope when present
}
const market = await getMarket(process.env.EVENT_ID!, "eventWinner");
for (const o of market.eventWinner) console.log(o.athlete.lastName, o.odds, o.status);The response is an EventOddsResponse. It carries the event identifiers (publicId, eventId, numericEventId), the oddType you asked for, the sport and competition keys, and one array per market type. The array named after your oddType holds the rows.
Check the competition's supportedMarkets on GET /sports before you ask for a market. If the event has no odds for that oddType, the endpoint returns 404.
Every oddType
oddType | What it prices | Row schema |
|---|---|---|
eventWinner | Each athlete to win the contest. | EventWinnerDto |
secondPlace | Each athlete to place second overall. | EventWinnerDto |
holeShot | Each athlete to be first at the first turn. | EventWinnerDto |
heatWinner | An athlete to win a heat or grouped matchup within a heat, against the heat's known participants. Grouped by round, then heat. | EventHeatOddsResponse |
fastestLap | Each athlete to set the fastest lap of the contest. | FastestLapDto |
headToHead | One athlete to finish ahead of another overall, for formats with no native head-to-head segment. | PlayerHeadToHeadDto |
overUnder | Over or under a stat line for an athlete. Narrow it with overUnderSubMarketType. | OverUnderOddsDto |
multiOverUnder | Which athletes finish over a given stat value at the end of the event. | MultiOverUnderDto |
podiums | An athlete to finish first, second or third. | EventWinnerDto |
shows | An athlete to finish first or second. | EventWinnerDto |
propBets | Propositions outside the standard markets, for example "Reaches quarterfinals". May or may not be tied to one athlete. | PropBetsDto |
dreamTeam | Dream team combinations. | DreamTeamDto |
eventExacta | Athletes to finish in an exact order across the event. | ProjectionExactasResponse |
heatExacta | Athletes to finish in an exact order within a heat. | ProjectionExactasHeatResponse |
raceTop10 | Each athlete to finish in the top 10. | EventWinnerDto |
raceTop5 | Each athlete to finish in the top 5. | EventWinnerDto |
raceTop3 | Top 3 finish. Accepted as an oddType, but the response schema has no raceTop3 array; see the note below. | Not documented |
teamMarkets | PBR Teams-series games only: the team money line plus match-scoped and team-scoped qualified-rides totals. | TeamMarketDto |
raceTop3
The live spec accepts raceTop3 as an oddType but EventOddsResponse defines no raceTop3 field. Confirm the response shape with the account team before you build on it. For a top-3 finish, podiums is fully documented.
Modifiers
| Query parameter | Values | Applies to |
|---|---|---|
exactasType | 2, 3, 4 | Exacta markets. 2 is an exacta (first two in order), 3 a trifecta, 4 a superfecta. The spec itself only labels it "Exactas Type". Each row's athletes array lists the athletes in the priced order. |
overUnderSubMarketType | finishingPosition, points, gapToLeaders | oddType=overUnder only. Picks which stat the line is set on. |
curl -s "https://api.altsportsdata.com/api/v1/public/events/$EVENT_ID/overUnder?overUnderSubMarketType=finishingPosition" \
-H "X-API-Key: $ALTSPORTSDATA_API_KEY"Money lines for athlete sports
There is no moneyline oddType. For an athlete or field sport, the winner market is eventWinner, and each row is one athlete's price to win. An EventWinnerDto row has:
| Field | Type | Meaning |
|---|---|---|
outcomeId | string | ID of this outcome. Use it to reference the selection. |
id | string | ID of the odd. |
referenceId | number | Numeric ID of the odd. |
position | number | The finishing position the odd refers to (for example 1 for a win). |
probability | decimal | Probability between 0 and 1. |
odds | decimal | Decimal odds: the probability translated to a price, including any pre-agreed margin. |
status | enum | Market status: OPEN, SUSPENDED, CLOSED, COMPLETED or VOID. |
settlement | enum | NOT_SET until settled, then WIN, LOSE or VOID. |
updatedAt | string | When the price last changed. |
athlete | AthleteResponse | Name, nationality, gender, stance, team and other athlete details. |
The same row shape serves secondPlace, holeShot, podiums, shows, raceTop5 and raceTop10. fastestLap rows use FastestLapDto, which has the same fields.
Accept bets only while status is OPEN. Settle from settlement, not from your own reading of results.
Prop bets settle differently
PropBetsDto.settlement uses its own values: OPEN, PAYOUT, DRAW and VOID. Every other athlete market uses WIN, LOSE, VOID and NOT_SET.
Other athlete market shapes
heatWinnerreturns rounds (roundId,roundName,roundNo,roundStatus), each withheats(heatId,heatName,heatNo,heatStatus), each withathletes. Every athlete entry carriesoutcomeId,odds,probability,seedNo,statusandsettlement.headToHeadreturnseventParticipant1andeventParticipant2, each withodds,position,status,settlementandathlete, pluswinnerParticipantIdonce decided.overUnderreturnsstatValue(the line),finalStatValue(the result once declared),status,athlete, andoverandundersides. Each side hasoutcomeId,oddsandsettlement. The sides carry noprobabilityfield, so derive it fromoddsif you need it.multiOverUnderreturnsstatValueand aselectionsarray. Each selection hasprobability,odds,status,settlement,finalStatValueandathlete.heatExactais grouped by round (roundId,name,roundNo,roundStatus) and thenheats, likeheatWinner.eventExactarows returnathletes(the order),position,odds,probability,trueProbability,hasModifiedProbability,holdingPercentage,voided,draw,statusandsettlement.
Money lines for team sports
Team sports have their own odds routes. The prices sit in named groups instead of oddType arrays.
| Route | Top-level markets |
|---|---|
GET /events/gsoc/{id}/odds (curling) | matchWinner, ends (per end), futures |
GET /events/nll/{id}/odds (lacrosse) | matchWinner |
GET /events/mltt/{id}/odds (table tennis) | eventWinner (whole event), games (per game) |
GET /events/jaialai/{id}/odds | eventWinner, matchWinner, sets, futures |
Each market group has a groupId, a publicId and up to three sub-markets: moneyLine, spread and total. Each sub-market has a marketId, a status and a selection list. futures groups are the exception: they carry groupId, type and a moneyLine array only.
{
"matchWinner": {
"groupId": "match",
"publicId": "…",
"moneyLine": {
"marketId": "…",
"status": "ACTIVE",
"selection": [
{ "outcomeId": "…", "name": "Fireballs", "probability": 42.75, "odds": 2.34, "settlement": "LOSER" },
{ "outcomeId": "…", "name": "Away team", "probability": 57.25, "odds": 1.66, "settlement": "WINNER" }
]
},
"spread": { "marketId": "…", "status": "…", "selection": [{ "outcomeId": "…", "name": "…", "value": -1.5, "isHomeTeam": true, "odds": 1.9, "probability": 0.5 }] },
"total": { "marketId": "…", "status": "…", "selection": [{ "outcomeId": "…", "type": "OVER", "ends": 8.5, "odds": 1.9, "probability": 0.5 }] }
}
}The values above are illustrative; ACTIVE, LOSER, 42.75 and 2.34 are the spec's own examples. Note that the probability here looks like a percentage. The fields are from the spec:
- Money line selection (
BaseSelectionDto):outcomeId,name(the team),probability,odds(decimal, with margin),settlement. - Spread selection (
SpreadWithSelectionDto): the money line fields plusvalue(the spread) andisHomeTeam. - Total selection (
TotalSelectionDto):outcomeId,type(OVERorUNDER),ends(the line),odds,probability,settlement,homeLineup,awayLineup.
MLTT routes use their own selection shapes: settlement is shown as NOT_SET before settling, money line selections
also carry isHomeTeam, and totals use sets (the points line) instead of ends. Jai alai totals also use sets.
In some groups spread and total are arrays of sub-markets rather than a single one (for example jai alai matchWinner, MLTT eventWinner and GSOC ends). Check the reference for the route you use.
PBR team games: teamMarkets
PBR Teams-series games use oddType=teamMarkets on the standard markets endpoint. Each TeamMarketDto has id, referenceId, marketType (for example moneyline), name, line, status and updatedAt.
- Money line:
lineis null andoutcomeslists one entry per team, each withoutcomeId,name,team(id,name,isHomeTeam),odds,probabilityandsettlement. - Totals:
lineis the qualified-rides threshold, with namedoverandundersides.teamnames the team for a team-scoped total and is null for the match total.
Market status and settlement
There is no settlement endpoint. Read market state and results from the odds objects themselves, and poll them until they settle.
Status tells you whether a market can take bets:
| Value | Where | Meaning |
|---|---|---|
OPEN | status / marketStatus on athlete and futures markets | Open for betting. |
SUSPENDED | same | Temporarily not taking bets. Hold, then check again. |
CLOSED | same | No longer taking bets; awaiting result. |
COMPLETED | same | Result is in. Read settlement. |
VOID | same | Market voided. |
ACTIVE | status on team-sport group holders (moneyLine, spread, total) | Spec example value. These group statuses are free strings, not an enum. |
Settlement uses a different vocabulary depending on the market:
| Schemas | Values |
|---|---|
EventWinnerDto, FastestLapDto, SelectionDto, OverUnderOdds, exacta rows, DreamTeamDto | WIN, LOSE, VOID, NOT_SET |
TeamMarketOutcomeDto, TeamMarketSelectionDto | Free string; NOT_SET before settlement |
PropBetsDto | OPEN, PAYOUT, DRAW, VOID |
GSOC, NLL and jai alai team selections (BaseSelectionDto, SpreadWithSelectionDto, TotalSelectionDto) | WINNER or LOSER (free string described as "winner or loser") |
Map each vocabulary to your own settlement states per schema, not with one global lookup.
Check the probability scale per market
probability is not on one scale across the API. On EventWinnerDto and similar athlete rows it is between 0 and 1. On team selections (BaseSelectionDto, TotalSelectionDto), futures Odd rows, and the heatWinner, propBets and exacta rows, the spec examples look like percentages (for example 42.75). Check the range of the field for each market you consume, or derive probability from odds with 1 / odds.
Working with the prices
All prices are decimal odds. A decimal price is the total return per unit staked, stake included: a 1 unit bet at 2.50 returns 2.50.
All prices are marginated decimal odds. The API does not return American or fractional odds; convert them yourself as shown below.
Implied probability is 1 / odds. Because odds includes the pre-agreed margin, 1 / odds is a little higher than the true probability, and the implied probabilities of a whole market add up to more than 1. The difference is the margin.
American odds from a decimal price d:
- If
d >= 2.0: American =+(d - 1) × 100. Example:2.50→+150. - If
d < 2.0: American =-100 / (d - 1). Example:1.344→-291.
def to_american(decimal_odds: float) -> int:
if decimal_odds >= 2.0:
return round((decimal_odds - 1) * 100)
return round(-100 / (decimal_odds - 1))
def implied_probability(decimal_odds: float) -> float:
return 1 / decimal_odds
def market_margin(decimal_prices: list[float]) -> float:
"""Overround of a complete market, e.g. 0.05 for a 5% margin."""
return sum(1 / d for d in decimal_prices) - 1export const toAmerican = (d: number): number =>
d >= 2 ? Math.round((d - 1) * 100) : Math.round(-100 / (d - 1));
export const impliedProbability = (d: number): number => 1 / d;
/** Overround of a complete market, e.g. 0.05 for a 5% margin. */
export const marketMargin = (prices: number[]): number =>
prices.reduce((sum, d) => sum + 1 / d, 0) - 1;Fractional odds are d - 1 expressed as a fraction, so 2.50 is 3/2.
Related
- Events and status to find event IDs and track state.
- Futures and parlays for season outrights and SGP pricing.
- API reference for every field.