Odds (Push Stream)
REQUIREMENT
You'll need a license key to use OddsJam's API. You can get one by emailing us at [email protected].
#
API Endpoint#
ParametersNOTE
You must provide at least one of game_id
or league
per GET
request.
key
(required)#
Your OddsJam API license key.
sportsbooks
(required)#
NOTE
You can pass in multiple of this parameter.
The sportsbooks that you want to recieve odd changes for.
game_id
#
NOTE
You can pass in multiple of this parameter.
The id of the game that you want to recieve odd changes for.
market
#
NOTE
You can pass in multiple of this parameter.
The name of the market that you want to recieve odd changes for (e.g. Moneyline
).
league
#
NOTE
You can pass in multiple of this parameter.
The league you want to receive odd changes for (e.g. NCAAB
)
is_main
#
If this is set to True, you will only get main lines and no alternates, if this is set to False, you will only get alternate lines. If this is ommitted, you will get all the lines.
The most balanced line and the main line are synonymous.
odds_format
#
The format of the odd price. Options are AMERICAN|PROBABILITY|DECIMAL
. We default to american prices.
last_entry_id
#
If this is set, it will get all events after the entry with this id, you can use this on reconnection events so you do not miss any updates.
include_game_updates
#
This is an optional field, and if it is set to true
, it will send game-status-notifications
and game-time-notifications
events in addition to the odds events.
#
Best PracticesWhile our endpoint supports passing multiple leagues and game ids, we recommend making a separate connection for each league or game id that you are trying to subscribe to. This will help reduce and isolate issues on a game or league basis. For instance, if you pass [game_id1, game_id2]
, if game_id2 ends and you are reconnecting to the stream, you will get an error saying game_id2
is no longer active.
#
Example RequestRequirements
- Python 3.10.2
- requests==2.31.0
- sseclient-py==1.8.0 | Need to use this sseclient dependency: https://pypi.org/project/sseclient-py/
#
Example Raw Response (from CURL)We send a connected event.
We send a ping from the server to the client every 5 seconds.
If an odd gets locked. You can use this to tell if an odd is no longer available on a sportsbook.
If an odd gets changed or added.
If the status changes for a game.
If the start time changes for a game.
#
Choosing a good key to store the data.If you are tracking multiple sportsbooks for a Game / Market combination. We would recommend making a key of (Game ID + Sportsbook + Market + Bet Name)
.
If you are tracking a single sportsbook for a Game / Market combination. We would recommend making a key of (Game Id + Market + Bet Name)
.
#
Common Cases#
Case 1: Sportsbook moves main line and DOES NOT have any alternate linesOriginal Lines:
- Over 5.5 | -110 | is_main=True
- Under 5.5 | +110 | is_main=True
Sportsbook changes lines:
- Over 5.5 | -110 | is_main=True ----> Over 6.5 | -110 | is_main=True
- Under 5.5 | +110 | is_main=True ----> Under 6.5 | +110 | is_main=True
#
Filter is_main=True:The events you will receive are:
{event: "locked-odds", data: {"data":[{"bet_name": "Over 5.5", "is_main": True, "bet_price": -110, ....}
{event: "locked-odds", data: {"data":[{"bet_name": "Under 5.5", "is_main": True, "bet_price": +110, ....}
{event: "odds", data: {"data":[{"bet_name": "Over 6.5", "is_main": True, "bet_price": -110, ....}
{event: "odds", data: {"data":[{"bet_name": "Under 6.5", "is_main": True, "bet_price": +110, ....}
#
Filter is_main=False:You will not receive any events.
#
Filter is_main is not setThe events you will receive are:
{event: "locked-odds", data: {"data":[{"bet_name": "Over 5.5", "is_main": True, "bet_price": -110, ....}
{event: "locked-odds", data: {"data":[{"bet_name": "Under 5.5", "is_main": True, "bet_price": +110, ....}
{event: "odds", data: {"data":[{"bet_name": "Over 6.5", "is_main": True, "bet_price": -110, ....}
{event: "odds", data: {"data":[{"bet_name": "Under 6.5", "is_main": True, "bet_price": +110, ....}
#
Case 2: Sportsbook moves main line and DOES HAVE alternate lines.Original Lines:
- Over 5.5 | -110 | is_main=True
- Under 5.5 | +110 | is_main=True
- Over 6.5 | +120 | is_main=False
- Under 6.5 | -120 | is_main=False
Sportsbook changes lines:
- Over 5.5 | -110 | is_main=True ----> Over 5.5 | -120 | is_main=False
- Under 5.5 | +110 | is_main=True ----> Under 5.5 | +120 | is_main=False
- Over 6.5 | +120 | is_main=False ----> Over 6.5 | -110 | is_main=True
- Under 6.5 | -120 | is_main=False ----> Under 6.5 | +110 | is_main=True
#
Filter is_main=True:The events you will receive are:
{event: "odds", data: {"data":[{"bet_name": "Over 6.5", "is_main": True, "bet_price": -110, ....}
{event: "odds", data: {"data":[{"bet_name": "Under 6.5", "is_main": True, "bet_price": +110, ....}
Note that we WILL NOT send any locked events for:
- Over 5.5 | -110 | is_main=True
- Under 5.5 | +110 | is_main=True
#
Filter is_main=False:The events you will receive are:
{event: "odds", data: {"data":[{"bet_name": "Over 5.5", "is_main": False, "bet_price": -120, ....}
{event: "odds", data: {"data":[{"bet_name": "Under 5.5", "is_main": False, "bet_price": +120, ....}
Note that we WILL NOT send any locked events for:
- Over 6.5 | +120 | is_main=False
- Under 6.5 | -120 | is_main=False
#
Filter is_main is not setThe events you will receive are:
{event: "odds", data: {"data":[{"bet_name": "Over 5.5", "is_main": False, "bet_price": -120, ....}
{event: "odds", data: {"data":[{"bet_name": "Under 5.5", "is_main": False, "bet_price": +120, ....}
{event: "odds", data: {"data":[{"bet_name": "Over 6.5", "is_main": True, "bet_price": -110, ....}
{event: "odds", data: {"data":[{"bet_name": "Under 6.5", "is_main": True, "bet_price": +110, ....}
Note that we WILL NOT send any locked events for:
- Over 5.5 | -110 | is_main=True
- Under 5.5 | +110 | is_main=True
- Over 6.5 | +120 | is_main=False
- Under 6.5 | -120 | is_main=False