Live(Inplay) odds
In the previous sections, you’ve learnt about pre-match odds and how to retrieve them via our API. Now, let’s take a look at live odds.
An overview of all the options available to request pre-match odds:
GET All Inplay Odds: returns all the live odds.
GET Inplay Odds by Fixture ID: returns the live odds from your requested fixture id.
GET Inplay Odds by Fixture ID and Bookmaker ID: returns the live odds filtered on bookmaker id from your requested fixture id.
GET Inplay Odds by Fixture ID and Market ID: returns the live odds filtered on market id from your requested fixture id.
For all the inplay odds endpoints the base URL is the same:
https://api.sportmonks.com/v3/football/odds/inplay
Per endpoint the rest of the URL requires additional information. We will explain this per endpoint.
Requesting live odds
GET All Inplay Odds
The first option is to request all the inplay odds available in our APIs. With this information, you can determine if the odds you’re interested in are available.
The URL to get all inplay odds is the same as the base URL for inplay odds. All you have to do is authorize the request with your API token. Check our authentication section for more info.
https://api.sportmonks.com/v3/football/odds/inplay?api_token=YOUR_TOKEN
Let’s take a look together at the key values the API returns:
id
: the unique id of the oddfixture_id
: the unique fixture id the odd is available forexternal_id
: the unique id of the odd from the bookmakermarket_id
: the unique id of the market the odd belongs tobookmaker_id
: the unique id of the bookmaker who offers the oddlabel
: the label name of the oddvalue
: the odd valuename
: the name of the oddsort_order
: n/amarket_description
: the description of the market the odd belongs to
Now you’ve gathered an overview of the available inplay odds. You can also retrieve the odds for only a specific fixture.
GET Inplay Odds by Fixture ID
A lot of our customers are not interested in all odds, but only in odds of a specific fixture. This endpoint is perfectly suited for this. The only thing you’ve to do is parse the fixture_id
you want the odds for:
https://api.sportmonks.com/v3/football/odds/inplay/
fixtures/{fixture_id}
For example, if you’re interested in the inplay odds available for Celtic vs Rangers (fixture id: 18535517)
https://api.sportmonks.com/v3/football/odds/inplay/fixtures/18535517?api_token=YOUR_TOKEN
GET Inplay Odds by Fixture ID and Bookmaker ID
You can also opt for the option to request the live odds for one fixture from one specific bookmaker.
To achieve this, the only thing you’ve to do is parse the fixture_id
and bookmaker_id
you want the odds for:
https://api.sportmonks.com/v3/football/odds/inplay/
fixtures/{fixture_id}/bookmakers/{bookmaker_id}
For example, if you’re interested in the inplay odds from bet365 (id: 2) available for Celtic vs Rangers (fixture id: 18535517)
https://api.sportmonks.com/v3/football/odds/inplay/fixtures/18535517/bookmakers/2?api_token=YOUR_TOKEN
GET Inplay Odds by Fixture ID and Market ID
You can also request all the inplay odds from a specific market and a specific fixture. The only thing you’ve to do is parse the fixture_id
and market_id
you want the odds for:
https://api.sportmonks.com/v3/football/odds/inplay/
fixtures/{fixture_id}/markets/{market_id}
For example, if you’re interested in the inplay odds from the alternative match goals market (id: 5) available for Celtic vs Rangers (fixture id: 18535517)
https://api.sportmonks.com/v3/football/odds/inplay/fixtures/18535517/markets/5?api_token=YOUR_TOKEN
Adding useful information
As you’ve learnt in the includes tutorial, you can enrich your request with includes. This section will discuss some of the most common requests used on the odds endpoints.
First of all, you can find a list of all available includes on the endpoint pages. For the odds, there are only 3 includes available:
market
: includes the market information the oddd belongs to.bookmaker
: includes the bookmaker information of the bookmaker that offers the odd.fixture
: includes the fixture information the odds is available for.
For example, if you’re interested in the inplay odds available for Celtic vs Rangers (fixture id: 18535517) with the name of the bookmakers, markets and fixture info.
https://api.sportmonks.com/v3/football/odds/inplay/fixtures/18535517?api_token=YOUR_TOKEN&include=bookmaker;market;fixture
Selecting and filtering
In our filtering tutorial you’ve learnt how to select specific fields or filter only on the data you’re interested in. Our API returns a set of data related to the odd by default. We can imagine you’re not interested in all the odds data the API returns. Let’s say you’re only interested in the market description and value.
You can add the &select=
parameter followed by the fields you want. In our case: market_description
,value
. This results in the below request and response:
https://api.sportmonks.com/v3/football/odds/inplay/fixtures/18535517?api_token=YOUR_TOKEN&select=market_description,value
Last updated
Was this helpful?