Markets
Last updated
Was this helpful?
Last updated
Was this helpful?
After you’ve determined if the bookmaker we have is available, you can check for market availabilities. Just like the bookmakers, the market endpoints will help you set up odds properly on your website/application. This endpoint is very useful for administrative purposes to check and structure the markets’ availability.
This section will briefly discuss all the options available to request markets.
An overview of all the options available:
GET All Markets: returns all the markets available in our football API.
GET Markets by ID: returns markets' information from your requested market id.
GET Markets by Search by Name: returns the markets that match your search query.
For all the market endpoints the base URL is the same:
https://api.sportmonks.com/v3/
odds
/markets
Per endpoint the rest of the URL requires additional information. We will explain this per endpoint.
*Important: Please note that the domain in the URL is odds instead of football.
he first option is to request all the markets available in our APIs. With this information, you can determine if the markets you’re interested in are available.
The URL to get all markets is the same as the base URL for markets. All you have to do is authorize the request with your API token. Check our for more info.
Let’s take a look at what the API returns. You can see the id of the market, the legacy id (what the market id was in our old API), and the market's name. You can also see the indication if the winning odds is calculated during/after the match.
Now you’ve gathered an overview of the available markets with their unique, you can use this id on the Markets by ID endpoint.
This endpoint returns market' information from your requested market id. All you’ve to do is add the unique id of the market you want.
https://api.sportmonks.com/v3/odds/markets
/{market_id}
For example, if you’re interested in the Alternative match goals market (id: 5):
This endpoint returns all the markets based on your search query. This might be handy if you cannot find a market. To search on market name, you’ll need to add /search/{search_query}
to the markets base URL:
https://api.sportmonks.com/v3/odds/markets
/search/{search_query}
For example, if you’re only interested in markets with “alternative” in the name, your request will be:
There are no include options available for the market endpoints.
You can add the &select=
parameter followed by the fields you want. In our case: name
. This results in the below request and response:
In our you’ve learnt how to select specific fields or filter only on the data you’re interested in. By default, our API returns a set of data related to the market. We can imagine you’re not interested in all the market data the API returns. Let’s say you’re only interested in the name.
Check our for more tips and tricks.