Baseball odds API
Baseball leagues, markets and prices through one REST API.
Baseball has the sport key baseball. Its events are between two teams, home and away.
Leagues
| League | Key | Bookmakers delivering |
|---|---|---|
| MLB | mlb | 19 |
Request the leagues
curl -sS "https://api.sockodds.com/v1/leagues?sport=baseball" \
-H "Authorization: Bearer $SOCKODDS_API_KEY"const response = await fetch("https://api.sockodds.com/v1/leagues?sport=baseball", {
headers: { Authorization: `Bearer ${process.env.SOCKODDS_API_KEY}` },
});
console.log(JSON.stringify(await response.json(), null, 2));import json, os, urllib.request
request = urllib.request.Request(
"https://api.sockodds.com/v1/leagues?sport=baseball",
headers={"Authorization": "Bearer " + os.environ["SOCKODDS_API_KEY"]},
)
with urllib.request.urlopen(request) as response:
print(json.dumps(json.load(response), indent=2))Response from a local copy of the API with invented test prices
{
"data": [
{
"key": "mlb",
"name": "MLB",
"sport": "baseball",
"region": "us",
"periods": [
"full",
"innings_1_to_5",
"inning_1"
]
}
],
"meta": {
"count": 1,
"cursor": null
},
"links": {
"next": null
}
}Markets
19 market types are defined for baseball: winner, result, handicap, total_runs, team_runs_over_under, player_hits_over_under, player_home_runs_anytime, player_home_runs_over_under, player_hits_runs_runs_batted_in_over_under, player_total_bases_over_under, player_runs_batted_in_over_under and player_runs_over_under and more. Each league page lists the markets and periods that apply to it, and Markets lists them all.