Keys and identifiers
Readable keys for what we define, stable ids for what comes and goes.
SockOdds uses two kinds of identifier. Things we define, such as sports, leagues, bookmakers, markets, periods and sides, have readable keys you can type. Things that come and go, such as events and players, have opaque ids that never change once issued.
Readable keys
Keys are lower case letters, digits and underscores, starting with a letter (^[a-z][a-z0-9_]{1,47}$). Examples: sport rugby_league, league rlwc, bookmaker sportsbet, market player_tries_anytime, period half_1, side over. Keys are frozen once published.
Teams have readable keys too, built from the team and its sport, for example australia_rugby_league. Use the key the API returns rather than building one.
Ids
| Identifies | Format | Example shape |
|---|---|---|
| Event | ev_ then 12 lower case letters and digits | ev_xxxxxxxxxxxx |
| Player | pl_ then 12 lower case letters and digits | pl_xxxxxxxxxxxx |
| Market, within an event | mk_ then 16 lower case letters and digits | mk_xxxxxxxxxxxxxxxx |
| Outcome, within a market | oc_ then 16 lower case letters and digits | oc_xxxxxxxxxxxxxxxx |
Store ids exactly as returned. An event id stays the same from the first time we list the game to its result; if two listings turn out to be one game, the API answers the surviving id. Market and outcome ids are only meaningful within their event.
Find an event by league and start time with GET /v1/events. If you already hold an official event id, GET /v1/events/lookup finds ours: espn, afl and nrl.
Teams and players
curl -sS "https://api.sockodds.com/v1/teams?league=rlwc&limit=2" \
-H "Authorization: Bearer $SOCKODDS_API_KEY"const response = await fetch("https://api.sockodds.com/v1/teams?league=rlwc&limit=2", {
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/teams?league=rlwc&limit=2",
headers={"Authorization": "Bearer " + os.environ["SOCKODDS_API_KEY"]},
)
with urllib.request.urlopen(request) as response:
print(json.dumps(json.load(response), indent=2))Example response · sample prices, not real odds
{
"data": [
{
"key": "australia_rugby_league",
"name": "Australia",
"sport": "rugby_league",
"leagues": [
"rlwc"
]
},
{
"key": "new_zealand_rugby_league",
"name": "New Zealand",
"sport": "rugby_league",
"leagues": [
"rlwc"
]
}
],
"meta": {
"count": 2,
"cursor": null
},
"links": {
"next": null
}
}curl -sS "https://api.sockodds.com/v1/players?league=rlwc&team=australia_rugby_league&limit=2" \
-H "Authorization: Bearer $SOCKODDS_API_KEY"const response = await fetch("https://api.sockodds.com/v1/players?league=rlwc&team=australia_rugby_league&limit=2", {
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/players?league=rlwc&team=australia_rugby_league&limit=2",
headers={"Authorization": "Bearer " + os.environ["SOCKODDS_API_KEY"]},
)
with urllib.request.urlopen(request) as response:
print(json.dumps(json.load(response), indent=2))Example response · sample prices, not real odds
{
"data": [
{
"id": "pl_000ckk0419pv",
"name": "Blayke Brailey",
"sport": "rugby_league",
"team": {
"key": "australia_rugby_league",
"name": "Australia"
}
},
{
"id": "pl_000ckk07g84c",
"name": "Bradman Best",
"sport": "rugby_league",
"team": {
"key": "australia_rugby_league",
"name": "Australia"
}
}
],
"meta": {
"count": 2,
"cursor": null
},
"links": {
"next": null
}
}Sports
| Key | Name | Participants |
|---|---|---|
australian_football | Australian football | home, away |
rugby_league | Rugby league | home, away |
rugby_union | Rugby union | home, away |
soccer | Soccer | home, away |
basketball | Basketball | home, away |
american_football | American football | home, away |
baseball | Baseball | home, away |
ice_hockey | Ice hockey | home, away |
tennis | Tennis | competitor_1, competitor_2 |
mma | Mixed martial arts | competitor_1, competitor_2 |
cricket | Cricket | home, away |
motorsport | Motorsport | competitor_1, competitor_2 |
esports | Esports | home, away |
Periods
| Key | Name |
|---|---|
full | Full match |
regulation | Regulation time |
half_1 | First half |
half_2 | Second half |
quarter_1 | First quarter |
quarter_2 | Second quarter |
quarter_3 | Third quarter |
quarter_4 | Fourth quarter |
half_2_ot | Second half including overtime |
quarter_4_ot | Fourth quarter including overtime |
period_1 | First period |
period_2 | Second period |
period_3 | Third period |
innings_1_to_5 | First five innings |
inning_1 | First inning |
set_1 | First set |
set_2 | Second set |
set_3 | Third set |
set_4 | Fourth set |
set_5 | Fifth set |
map_1 | Map 1 |
map_2 | Map 2 |
map_3 | Map 3 |
map_4 | Map 4 |
map_5 | Map 5 |
round_1 | Round 1 |
round_2 | Round 2 |
round_3 | Round 3 |
round_4 | Round 4 |
round_5 | Round 5 |
team_innings_1 | Each team's first innings |
Sides
| Key | Name |
|---|---|
home | Home |
away | Away |
competitor_1 | Competitor 1 |
competitor_2 | Competitor 2 |
draw | Draw |
over | Over |
under | Under |
yes | Yes |
no | No |
odd | Odd |
even | Even |
home_or_draw | Home or draw |
away_or_draw | Away or draw |
either_team | Either team |
home_home | Home / Home |
home_draw | Home / Draw |
home_away | Home / Away |
draw_home | Draw / Home |
draw_draw | Draw / Draw |
draw_away | Draw / Away |
away_home | Away / Home |
away_draw | Away / Draw |
away_away | Away / Away |
half_1 | First half |
half_2 | Second half |
tie | Tie |
no_goal | No goal |
both_teams | Both teams |
home_only | Home only |
away_only | Away only |
neither_team | Neither team |
round_1 | Round 1 |
round_2 | Round 2 |
round_3 | Round 3 |
round_4 | Round 4 |
round_5 | Round 5 |
distance | To go the distance |
points | By decision |
rounds_1_2 | Rounds 1-2 |
rounds_2_3 | Rounds 2-3 |
rounds_3_4 | Rounds 3-4 |
rounds_4_5 | Rounds 4-5 |
rounds_1_3 | Rounds 1-3 |
rounds_2_4 | Rounds 2-4 |
rounds_3_5 | Rounds 3-5 |
round_2_yes | Round 2 to start: Yes |
round_2_no | Round 2 to start: No |
round_3_yes | Round 3 to start: Yes |
round_3_no | Round 3 to start: No |
round_4_yes | Round 4 to start: Yes |
round_4_no | Round 4 to start: No |
round_5_yes | Round 5 to start: Yes |
round_5_no | Round 5 to start: No |
minute_1 | Minute 1 |
minute_2 | Minute 2 |
minute_3 | Minute 3 |
minute_4 | Minute 4 |
minute_5 | Minute 5 |
round_1_minute_1 | Round 1, minute 1 |
round_1_minute_2 | Round 1, minute 2 |
round_1_minute_3 | Round 1, minute 3 |
round_1_minute_4 | Round 1, minute 4 |
round_1_minute_5 | Round 1, minute 5 |
round_2_minute_1 | Round 2, minute 1 |
round_2_minute_2 | Round 2, minute 2 |
round_2_minute_3 | Round 2, minute 3 |
round_2_minute_4 | Round 2, minute 4 |
round_2_minute_5 | Round 2, minute 5 |
round_3_minute_1 | Round 3, minute 1 |
round_3_minute_2 | Round 3, minute 2 |
round_3_minute_3 | Round 3, minute 3 |
round_3_minute_4 | Round 3, minute 4 |
round_3_minute_5 | Round 3, minute 5 |
round_4_minute_1 | Round 4, minute 1 |
round_4_minute_2 | Round 4, minute 2 |
round_4_minute_3 | Round 4, minute 3 |
round_4_minute_4 | Round 4, minute 4 |
round_4_minute_5 | Round 4, minute 5 |
round_5_minute_1 | Round 5, minute 1 |
round_5_minute_2 | Round 5, minute 2 |
round_5_minute_3 | Round 5, minute 3 |
round_5_minute_4 | Round 5, minute 4 |
round_5_minute_5 | Round 5, minute 5 |
Regions
| Key | Name |
|---|---|
au | Australia |
nz | New Zealand |
us | United States |
ca | Canada |
uk | United Kingdom |
ie | Ireland |
eu | Europe |
intl | International |