- Basic
- Standard
- Advanced
- Custom
Introduction
Odds are used to add betting functionality to your application. This endpoint can be used for Pre-match Odds, although we also have an endpoint for In-Play Odds (live).
We offer the ability to request Odds by Fixture, by Fixture And Bookmaker or by Fixture And Market. Another option to get information about Odds is to use the proper Include on any Fixtures related endpoint. Using the Includes odds or flatodds will enrich the response of a Fixture with all Odds we have available.
Good to know
If you want to use filtering on odds, and you are using the include option, you must use the
flatOdds
instead of theodds
include. Also note that flatOdds load significantly faster.
Endpoint Details
Below you can find the details for this endpoint.
Example Request
The following code snippets demonstrate how to get all odds available in this endpoint.
// Get your API tokens here: https://www.sportmonks.com/settings#/api
curl "https://soccer.sportmonks.com/api/v2.0/odds/fixture/__FIXTUREID__/bookmaker/__BOOKMAKERID__?api_token=YOURTOKEN"
-H "Accept: application/json"
// Get your API tokens here: https://www.sportmonks.com/settings#/api
$client = new GuzzleHttp\Client();
$res = $client->request('GET', 'https://soccer.sportmonks.com/api/v2.0/odds/fixture/__FIXTUREID__/bookmaker/__BOOKMAKERID__?api_token=YOURTOKEN', [
'headers' => ['Accept' => 'application/json']
]);
// Get your API tokens here: https://www.sportmonks.com/settings#/api
response = requests.get("https://soccer.sportmonks.com/api/v2.0/odds/fixture/__FIXTUREID__/bookmaker/__BOOKMAKERID__?api_token=YOURTOKEN")
# Print the status code of the response.
print(response.status_code)
// Get your API tokens here: https://www.sportmonks.com/settings#/api
require 'faraday_middleware'
Faraday.new('https://soccer.sportmonks.com/api/v2.0/odds/fixture/__FIXTUREID__/bookmaker/__BOOKMAKERID__?api_token=YOURTOKEN', headers: {'Accept' => 'application/json', 'Accept-Encoding' => 'gzip'}).get
// Get your API tokens here: https://www.sportmonks.com/settings#/api
URL url = new URL("https://soccer.sportmonks.com/api/v2.0/odds/fixture/__FIXTUREID__/bookmaker/__BOOKMAKERID__?api_token=YOURTOKEN");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("GET");
// Get your API tokens here: https://www.sportmonks.com/settings#/api
import { SportmonksApi } from 'sportmonks';
const sportmonks = new SportmonksApi(__YOUR_API_TOKEN__);
sportmonks.get("https://soccer.sportmonks.com/api/v2.0/odds/fixture/__FIXTUREID__/bookmaker/__BOOKMAKERID__?api_token=YOURTOKEN",params).then( function(resp){
//resp.data will contain your data
//resp.meta will contain the meta informations
console.log(resp);
});
// Get your API tokens here: https://www.sportmonks.com/settings#/api
package main
import (
"fmt"
"log"
sm "github.com/BialkowskiSz/go-sportmonks"
)
func main() {
sm.SetAPIToken("<YOUR_TOKEN_HERE>")
g, err := sm.Get("https://soccer.sportmonks.com/api/v2.0/odds/fixture/__FIXTUREID__/bookmaker/__BOOKMAKERID__?api_token=YOURTOKEN", "", 0, false)
if err != nil {
log.Fatal(err)
}
fmt.Println(string(g))
}
// Get your API tokens here: https://www.sportmonks.com/settings#/api
var client = new HttpClient();
var response = await client.GetAsync("https://soccer.sportmonks.com/api/v2.0/odds/fixture/__FIXTUREID__/bookmaker/__BOOKMAKERID__?api_token=YOURTOKEN");
string json = await response.Content.ReadAsStringAsync();
Example Response
In the API Reference Guide the example responses of the odds endpoint are shown.
Test this Endpoint
With our In-Page API Tester you can directly test this Endpoint by clicking the blue button on the right ‘Open Test API’. By adding Includes, Parameters and Variables and clicking the blue button on the right below ‘Send API Request’, you can directly view the API Response. Your Requests and Responses are even stored in your personal API Tester Folder (only when you are logged-in). If you are not logged in the API Tester will use the Free Plan Leagues for your requests.
Questions?
We're always happy to help with code or other questions you might have! Search our documentation, contact support, or get in touch with our sales team.