Note: This article refers to a feature under construction. At present it applies only to College Football (CFB) historical odds. It will be rolled out for all other sports over the coming months in Q3 and Q4 2024. For now, access historical odds for all non-CFB sports in the exact same way as current odds.
What & Why
- To ensure the best performance for live odds, all Aggregated Odds older than 30 days are being moved to our data warehouse.
- This allows us to streamline our production data tables to ensure that live odds get to you, the user, as quickly as possible.
- This also allows you to call historical odds in a predictable way, with data structures that match live odds exactly, so the change is seamless from your point of view.
- All you need to do is make a call to a different endpoint for historical odds line movement. We do the rest.
- This is currently in place for CFB, CBB and MLB and will be rolled out for all other sports over the rest of 2024.
- All you need to get started is access to a SportsData Historical API Key. Need access? Get in touch with us.
How Do I Access Historical Odds?
- Our Historical Odds endpoints live in our Data Warehouse.
- Data Warehouse API callers will need to pass 3 parameters:
-
Season
(e.g.2024
) BettingMarketId
-
SportsbookGroup
(see this guide for how Sportsbook Group endpoints work if you are unfamiliar.)
-
- For all non-futures, you can call the Props endpoint with the BettingMarketId of your choice:
- For Futures, a dedicated endpoint exists:
- Here is a sample workflow for getting the BettingMarketId:
- Examine StartDate on a BettingEvent to see if it’s over 30 days old
- Assemble
BettingMarketID
list for any markets you are interested in:- https://sportsdata.io/developers/api-documentation/ncaa-football#/endpoint/betting-markets-by-event
- You can also use the
ArchiveLocation
field, which returns the exact URL; just substitute{SportsbookGroupId}
with an ID of your choice and{ApiKey}
with your API key for the SportsDataIO Historical API product.
- Determine which
SportsbookGroup
(s) for which you want to retrieve historical outcomes (see your My Account section for a list of available groups and ensure you are looking at your SportsDataIO API Historical product. - Loop BettingMarketID and SportsbookGroup, call endpoint and store data
Data Structure
- Data warehouse API responses have the exact same schema/shape as the production BettingMarket (“line movement”) endpoints.
- See for example https://sportsdata.io/developers/api-documentation/mlb#betting-market with any BettingMarketId (e.g. 4010995) for exactly how this will look.
- You should be able to take your existing production code and use it for accessing the data warehouse as it is completely identical in its response format.
- Per the above, only the call parameters differ.
Other Important Points
- By "30 days old", we mean the StartDate on BettingEvent must be <= 30 days ago.
- For the sports already moved (MLB, CFB, CBB) this is in place now.
- For those in progress (NFL, NBA, NHL) 365 days of data are available in the production endpoints. This will change to 30 upon opening of the full archive.
- The full archive will have all available historical data, even older than 365 days.
- For Game type BettingEvents (for aggregated odds like Props, Futures, Game Lines etc.) this is easy: it means the date the game started.
- For Futures, however, this usually means the odds will be historical 30 days after the season ends, since the market StartDate can vary based on a variety of factors.
- If in doubt, check the live endpoints first; if they are not present, they are in the Historical endpoints.
Comments
0 comments
Article is closed for comments.