Sportsbook API

PAID
By Sportsbook API | Updated 23 giorni fa | Sports
Popularity

9.2 / 10

Latency

362ms

Service Level

100%

Health Check

N/A

Back to All Tutorials (2)

How to get the latest odds for an event

Get latest odds for an event

  • Call /v0/competitions

    • This should return a JSON payload like this
    {
    	"competitions": [
    	{
    		"key": "H2nG-wddv-NZsP",
    		"slug": "major-league-soccer",
    		"name": "Major League Soccer",
    		"shortName": "MLS",
    		"sport": "SOCCER"
    	},
    	{
    		"key": "d791-wddv-30fU",
    		"slug": "national-basketball-league",
    		"name": "National Basketball League",
    		"shortName": "NBA",
    		"sport": "BASKETBALL"
    	},
    	...
    	]
    }
    
  • Take the key from the competition you’re looking for. This is unique per environment, but it will never change.

    • Since the competition keys are static, you can call this once and then just save the keys in your code. Don’t need to call this end point over and over.
  • Call /v0/competitions/{competitionKey}/events (replace {competitionKey} with d791-wddv-30fU for this example)

    • This should return a JSON payload like this
    {
    	"events": [
    		{
    			"key": "LcdF-xdwr-fvL2",
    			"name": "Oklahoma City Thunder @ Los Angeles Clippers",
    			"startTime": "2023-03-24T02:40:00.000Z",
    			"homeParticipantKey": "OABG-wddv-xt3n",
    			"participants": [
    				{
    					"key": "OABG-wddv-xt3n",
    					"slug": "los-angeles-clippers",
    					"name": "Los Angeles Clippers",
    					"shortName": "LAC",
    					"sport": "BASKETBALL"
    				},
    				{
    					"key": "vc3g-wddv-5R3N",
    					"slug": "oklahoma-city-thunder",
    					"name": "Oklahoma City Thunder",
    					"shortName": "OKC",
    					"sport": "BASKETBALL"
    				}
    			]
    		},
    		{
    			"key": "GcgY-xdwr-aQfJ",
    			"name": "Charlotte Hornets @ New Orleans Pelicans",
    			"startTime": "2023-03-24T00:10:00.000Z",
    			"homeParticipantKey": "ooXv-wddv-56N0",
    			"participants": [
    				{
    					"key": "4tnp-wddv-0wCA",
    					"slug": "charlotte-hornets",
    					"name": "Charlotte Hornets",
    					"shortName": "CHA",
    					"sport": "BASKETBALL"
    				},
    				{
    					"key": "ooXv-wddv-56N0",
    					"slug": "new-orleans-pelicans",
    					"name": "New Orleans Pelicans",
    					"shortName": "NOP",
    					"sport": "BASKETBALL"
    				}
    			]
    		},
    		...
    ]
    
  • Take the key from up to 50 events

  • Using those keys call /v0/events?eventKeys={eventKey}&eventKeys={eventKey}&eventKeys={eventKey} (replace {eventKeys} up to 50 event keys)

    • This should return a JSON payload like this
    {
    	"events": [
    		{
    			"key": "LcdF-xdwr-fvL2",
    			"name": "Oklahoma City Thunder @ Los Angeles Clippers",
    			"startTime": "2023-03-24T02:40:00.000Z",
    			"homeParticipantKey": "OABG-wddv-xt3n",
    			"participants": [
    				{
    					"key": "OABG-wddv-xt3n",
    					"slug": "los-angeles-clippers",
    					"name": "Los Angeles Clippers",
    					"shortName": "LAC",
    					"sport": "BASKETBALL"
    				},
    				{
    					"key": "vc3g-wddv-5R3N",
    					"slug": "oklahoma-city-thunder",
    					"name": "Oklahoma City Thunder",
    					"shortName": "OKC",
    					"sport": "BASKETBALL"
    				}
    			],
    			"markets": [
    				{
    					"key": "efqQ-xdwr-fAOR",
    					"description": null,
    					"type": "MONEYLINE",
    					"segment": "FULL_MATCH",
    					"lastFoundAt": "2023-03-23T04:22:01.452Z",
    					"outcomes": {
    						"UNIBET": [
    							{
    								"key": "k23V-xdxb-VpTP",
    								"description": null,
    								"modifier": 0,
    								"payout": 2.25,
    								"type": "WIN",
    								"live": false,
    								"marketKey": "efqQ-xdwr-fAOR",
    								"readAt": "2023-03-23T01:36:01.585Z",
    								"lastFoundAt": "2023-03-23T04:22:01.452Z",
    								"source": "UNIBET",
    								"participant": {
    									"key": "vc3g-wddv-5R3N",
    									"slug": "oklahoma-city-thunder",
    									"name": "Oklahoma City Thunder",
    									"shortName": "OKC",
    									"sport": "BASKETBALL"
    								}
    							},
    							{
    								"key": "UcW7-xdxb-020z",
    								"description": null,
    								"modifier": 0,
    								"payout": 1.67,
    								"type": "WIN",
    								"live": false,
    								"marketKey": "efqQ-xdwr-fAOR",
    								"readAt": "2023-03-23T01:36:01.585Z",
    								"lastFoundAt": "2023-03-23T04:22:01.452Z",
    								"source": "UNIBET",
    								"participant": {
    									"key": "OABG-wddv-xt3n",
    									"slug": "los-angeles-clippers",
    									"name": "Los Angeles Clippers",
    									"shortName": "LAC",
    									"sport": "BASKETBALL"
    								}
    							}
    						],
    						"BARSTOOL_SPORTS": [
    							{
    								"key": "fblz-xdxb-TtK6",
    								"description": null,
    								"modifier": 0,
    								"payout": 2.25,
    								"type": "WIN",
    								"live": false,
    								"marketKey": "efqQ-xdwr-fAOR",
    								"readAt": "2023-03-23T01:36:02.002Z",
    								"lastFoundAt": "2023-03-23T04:22:01.135Z",
    								"source": "BARSTOOL_SPORTS",
    								"participant": {
    									"key": "vc3g-wddv-5R3N",
    									"slug": "oklahoma-city-thunder",
    									"name": "Oklahoma City Thunder",
    									"shortName": "OKC",
    									"sport": "BASKETBALL"
    								}
    							},
    							{
    								"key": "gW4S-xdxb-Srv1",
    								"description": null,
    								"modifier": 0,
    								"payout": 1.67,
    								"type": "WIN",
    								"live": false,
    								"marketKey": "efqQ-xdwr-fAOR",
    								"readAt": "2023-03-23T01:36:02.002Z",
    								"lastFoundAt": "2023-03-23T04:22:01.135Z",
    								"source": "BARSTOOL_SPORTS",
    								"participant": {
    									"key": "OABG-wddv-xt3n",
    									"slug": "los-angeles-clippers",
    									"name": "Los Angeles Clippers",
    									"shortName": "LAC",
    									"sport": "BASKETBALL"
    								}
    							}
    						],
    					}
    				}
    			]
    		}
    	]
    }
    
    • events.markets is all the markets available for an event. A market is a betting market like “full game moneyline” or “1st period point total”.
      • Important market fields
      • type The type of market.
        • Possible values: MONEYLINE, MONEYLINE_3WAY, POINT_TOTAL, POINT_SPREAD, BOTH_TEAMS_TO_SCORE
        • Most events will not have all of these. For example, BOTH_TEAMS_TO_SCORE is unique to soccer right now and MONEYLINE_3WAY is only used in soccer, European hockey leagues, and handball
      • segment The segment of the event that this market is for
        • Some Possible values: REGULATION_TIME, FULL_MATCH, HALF_1, QUARTER_1
        • Regulation time is for markets where the event can go into over time, but overtime isn’t included in the bet (soccer and Euro hockey mainly).
      • It’s possible for some events to have the same market type with different segments. For example with European hockey, some books include OT and others don’t so we have 2 MONEYLINE markets. One REGULATION_TIME and one FULL_MATCH
      • outcomes The latest odds for this market keyed by sportsbook. If we don’t have odds for a sportsbook or the book is no longer taking bets on the bet, the key will no longer exist.
        • Important outcome fields:
        • modifier The modifier for the bet. Usually used for spreads and totals. Moneyline should be 0.
          • For example a bet on Under 47 will have a modifier of 47. A bet of Bills -6 will have a modifier of -6
        • payout The decimal odds for the bet for this sportsbook
        • type The type of outcome. The value depends on the type of market
          • MONEYLINE and POINT_SPREAD will always be WIN. See participant to see who is being bet on
          • POINT_TOTAL is OVER or UNDER
          • MONEYLINE_3WAY is WIN for betting on a specific team or DRAW
          • BOTH_TEAMS_TO_SCORE is YES or NO
        • live is the bet on a live event
        • readAt when the book first offered this line at this price
        • lastFoundAt when the book last offered this line at this price
          • lastFoundAt - readAt will tell you how long a line existed for
        • source what sportsbook these odds came from
        • participant for bets where you’re betting on one participant, info about the side being bet on