Keys and identifiers

Readable keys for what we define, stable ids for what comes and goes.

Updated

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

IdentifiesFormatExample shape
Eventev_ then 12 lower case letters and digitsev_xxxxxxxxxxxx
Playerpl_ then 12 lower case letters and digitspl_xxxxxxxxxxxx
Market, within an eventmk_ then 16 lower case letters and digitsmk_xxxxxxxxxxxxxxxx
Outcome, within a marketoc_ then 16 lower case letters and digitsoc_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

KeyNameParticipants
australian_footballAustralian footballhome, away
rugby_leagueRugby leaguehome, away
rugby_unionRugby unionhome, away
soccerSoccerhome, away
basketballBasketballhome, away
american_footballAmerican footballhome, away
baseballBaseballhome, away
ice_hockeyIce hockeyhome, away
tennisTenniscompetitor_1, competitor_2
mmaMixed martial artscompetitor_1, competitor_2
cricketCrickethome, away
motorsportMotorsportcompetitor_1, competitor_2
esportsEsportshome, away

Periods

KeyName
fullFull match
regulationRegulation time
half_1First half
half_2Second half
quarter_1First quarter
quarter_2Second quarter
quarter_3Third quarter
quarter_4Fourth quarter
half_2_otSecond half including overtime
quarter_4_otFourth quarter including overtime
period_1First period
period_2Second period
period_3Third period
innings_1_to_5First five innings
inning_1First inning
set_1First set
set_2Second set
set_3Third set
set_4Fourth set
set_5Fifth set
map_1Map 1
map_2Map 2
map_3Map 3
map_4Map 4
map_5Map 5
round_1Round 1
round_2Round 2
round_3Round 3
round_4Round 4
round_5Round 5
team_innings_1Each team's first innings

Sides

KeyName
homeHome
awayAway
competitor_1Competitor 1
competitor_2Competitor 2
drawDraw
overOver
underUnder
yesYes
noNo
oddOdd
evenEven
home_or_drawHome or draw
away_or_drawAway or draw
either_teamEither team
home_homeHome / Home
home_drawHome / Draw
home_awayHome / Away
draw_homeDraw / Home
draw_drawDraw / Draw
draw_awayDraw / Away
away_homeAway / Home
away_drawAway / Draw
away_awayAway / Away
half_1First half
half_2Second half
tieTie
no_goalNo goal
both_teamsBoth teams
home_onlyHome only
away_onlyAway only
neither_teamNeither team
round_1Round 1
round_2Round 2
round_3Round 3
round_4Round 4
round_5Round 5
distanceTo go the distance
pointsBy decision
rounds_1_2Rounds 1-2
rounds_2_3Rounds 2-3
rounds_3_4Rounds 3-4
rounds_4_5Rounds 4-5
rounds_1_3Rounds 1-3
rounds_2_4Rounds 2-4
rounds_3_5Rounds 3-5
round_2_yesRound 2 to start: Yes
round_2_noRound 2 to start: No
round_3_yesRound 3 to start: Yes
round_3_noRound 3 to start: No
round_4_yesRound 4 to start: Yes
round_4_noRound 4 to start: No
round_5_yesRound 5 to start: Yes
round_5_noRound 5 to start: No
minute_1Minute 1
minute_2Minute 2
minute_3Minute 3
minute_4Minute 4
minute_5Minute 5
round_1_minute_1Round 1, minute 1
round_1_minute_2Round 1, minute 2
round_1_minute_3Round 1, minute 3
round_1_minute_4Round 1, minute 4
round_1_minute_5Round 1, minute 5
round_2_minute_1Round 2, minute 1
round_2_minute_2Round 2, minute 2
round_2_minute_3Round 2, minute 3
round_2_minute_4Round 2, minute 4
round_2_minute_5Round 2, minute 5
round_3_minute_1Round 3, minute 1
round_3_minute_2Round 3, minute 2
round_3_minute_3Round 3, minute 3
round_3_minute_4Round 3, minute 4
round_3_minute_5Round 3, minute 5
round_4_minute_1Round 4, minute 1
round_4_minute_2Round 4, minute 2
round_4_minute_3Round 4, minute 3
round_4_minute_4Round 4, minute 4
round_4_minute_5Round 4, minute 5
round_5_minute_1Round 5, minute 1
round_5_minute_2Round 5, minute 2
round_5_minute_3Round 5, minute 3
round_5_minute_4Round 5, minute 4
round_5_minute_5Round 5, minute 5

Regions

KeyName
auAustralia
nzNew Zealand
usUnited States
caCanada
ukUnited Kingdom
ieIreland
euEurope
intlInternational
Need help?FAQ · Email support

Search across the SockOdds documentation and catalogue.