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

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))

Response from a local copy of the API with invented test prices

{
  "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))

Response from a local copy of the API with invented test prices

{
  "data": [
    {
      "id": "pl_000ckk0gtfj3",
      "name": "Blayke Brailey",
      "sport": "rugby_league",
      "team": {
        "key": "australia_rugby_league",
        "name": "Australia"
      }
    },
    {
      "id": "pl_000ckk0m9dzm",
      "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
period_1First period
period_2Second period
period_3Third period
innings_1_to_5First five innings
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

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

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.