Market Odds for Upcoming Events#
The following describes how to retrieve the market odds information for an event.
Related Sports Data APIS
Method | Description | Availability |
---|---|---|
GET |
/{sport}/v2/events |
ALL LEAGUES |
First, lets load an upcoming Basketball event;
GET https://api.quarter4.io/basketball/v2/events?startDate[after]=2022-03-08&order[startDate]=asc&include=winloss&count=1
The preceding query includes a few options to limit results. First, we filter to a startDate
to start after
a specific date (use today's date for best results) and then we order
by startDate
asc
ending with a count
of 1
to get only the next event for this example. Additionally we use include=winloss
to include the forecast predictions for this event.
The result looks like this:
{
"links": {
"self": "\/basketball\/v2\/events?ccount=1\u0026include=winloss\u0026order%5BstartDate%5D=asc\u0026startDate%5Bafter%5D=2022-03-08T18%3A34%3A34%2B00%3A00\u0026page=1",
"first": "\/basketball\/v2\/events?\u0026count=1\u0026include=winloss\u0026order%5BstartDate%5D=asc\u0026startDate%5Bafter%5D=2022-03-08T18%3A34%3A34%2B00%3A00\u0026page=1",
"last": "\/basketball\/v2\/events?\u0026count=1\u0026include=winloss\u0026order%5BstartDate%5D=asc\u0026startDate%5Bafter%5D=2022-03-08T18%3A34%3A34%2B00%3A00\u0026page=453",
"next": "\/basketball\/v2\/events?\u0026count=1\u0026include=winloss\u0026order%5BstartDate%5D=asc\u0026startDate%5Bafter%5D=2022-03-08T18%3A34%3A34%2B00%3A00\u0026page=2"
},
"meta": {
"totalItems": 453,
"itemsPerPage": 1,
"currentPage": 1
},
"data": [
{
"id": "\/basketball\/v2\/events\/83516688-56f6-48c6-a58f-aae1b8c4e340",
"type": "Event",
"attributes": {
"startDate": "2022-03-08T19:00:00+00:00",
"eventStatus": {
"name": "Pre-Game",
"uuid": "d9f80558-4fad-42a2-b565-d3a26ad76687"
},
"homeTeamScore": null,
"awayTeamScore": null,
"title": "ACC - First Round - Game 1",
"homeSeed": 12,
"awaySeed": 13,
"coverage": "full",
"otherBooksData": {
"spread_home": {
"MGM": "1.5",
"DraftKings": "2",
"FanDuel": "3",
"Westgate": "2",
"SugarHouseNJ": "2",
"PointsBet": "2",
"Bet365NewJersey": "2",
"WilliamHillNewJersey": "2"
},
"spread_away": {
"MGM": "-1.5",
"DraftKings": "-2",
"FanDuel": "-3",
"Westgate": "-2",
"SugarHouseNJ": "-2",
"PointsBet": "-2",
"Bet365NewJersey": "-2",
"WilliamHillNewJersey": "-2"
},
"over_under": {
"MGM": "129.5",
"DraftKings": "129",
"FanDuel": "128.5",
"Westgate": "128.5",
"SugarHouseNJ": "129.5",
"PointsBet": "128.5",
"Bet365NewJersey": "128.5",
"WilliamHillNewJersey": "128"
}
},
"uuid": "83516688-56f6-48c6-a58f-aae1b8c4e340",
"neutralSite": true,
"duration": null,
"leadChanges": null,
"timesTied": null,
"clock": null,
"quarter": null,
"clockDecimal": null,
"conferenceGame": false,
"half": null,
"displayStatus": "scheduled"
},
"relationships": {
"league": {
"data": {
"type": "League",
"id": "\/basketball\/v2\/leagues\/da57437e-4688-4e1c-9bc5-6df2dcab1a14"
}
},
"homeTeam": {
"data": {
"type": "Team",
"id": "\/basketball\/v2\/teams\/db538d77-f327-4fea-a0b5-b33a9ef8749d"
}
},
"awayTeam": {
"data": {
"type": "Team",
"id": "\/basketball\/v2\/teams\/19f105d9-f6ee-447e-96a8-9d44e82864ba"
}
},
"nextEvent": {
"data": {
"type": "Event",
"id": "\/basketball\/v2\/events\/0d0be466-ac5e-4f58-88db-a60c3774cb3a"
}
},
"winloss": {
"data": {
"type": "WinLoss",
"id": "\/basketball\/v2\/win_losses\/83516688-56f6-48c6-a58f-aae1b8c4e340"
}
},
"simulatedPicks": {
"data": {
"type": "Simulation",
"id": "\/basketball\/v2\/simulations\/42193d9f-f261-4286-b5a9-27fe3e514af6"
}
}
}
}
],
"included": [
{
"id": "\/basketball\/v2\/win_losses\/83516688-56f6-48c6-a58f-aae1b8c4e340",
"type": "WinLoss",
"attributes": {
"detail": "The Boston College Eagles have a 63.2% chance of beating the Pittsburgh Panthers",
"homeWinProbability": 37,
"awayWinProbability": 63,
"homeSpread": 1,
"awaySpread": -1,
"overUnder": 139.023,
"winLossSpreadConsistency": 1,
"otherBooksData": {
"spread_home": {
"MGM": "1.5",
"DraftKings": "2",
"FanDuel": "3",
"Westgate": "2",
"SugarHouseNJ": "2",
"PointsBet": "2",
"Bet365NewJersey": "2",
"WilliamHillNewJersey": "2"
},
"spread_away": {
"MGM": "-1.5",
"DraftKings": "-2",
"FanDuel": "-3",
"Westgate": "-2",
"SugarHouseNJ": "-2",
"PointsBet": "-2",
"Bet365NewJersey": "-2",
"WilliamHillNewJersey": "-2"
},
"over_under": {
"MGM": "129.5",
"DraftKings": "129",
"FanDuel": "128.5",
"Westgate": "128.5",
"SugarHouseNJ": "129.5",
"PointsBet": "128.5",
"Bet365NewJersey": "128.5",
"WilliamHillNewJersey": "128"
}
},
"overtimeProbability": null,
"predictAsOvertime": null,
"uuid": "83516688-56f6-48c6-a58f-aae1b8c4e340",
"probability": 63,
"winnerUuid": "19f105d9-f6ee-447e-96a8-9d44e82864ba",
"loserUuid": "db538d77-f327-4fea-a0b5-b33a9ef8749d"
},
"relationships": {
"event": {
"data": {
"type": "Event",
"id": "\/basketball\/v2\/events\/83516688-56f6-48c6-a58f-aae1b8c4e340"
}
}
}
}
]
}
You can now use the above result to get the predictions and other book information from the related WinLoss entity in data[0].included[0].attributes
.
The otherBooksData
is a JSON object with spread_home
, spread_away
and over_under
lists from other books, while predictions are located in the homeSpread
, awaySpread
and overUnder
attributes.