Pointing a SportsGameOdds client at SockOdds
SockOdds is the Australian extension of the SportsGameOdds v2 schema, so an existing SGO integration needs one change: the base URL.
- Change the base URL to
https://api.sockodds.com/v2and the key to an SockOdds key. - Keep your parsing:
eventID,odds[oddID],byBookmaker,opposingOddID,status, the envelope — all unchanged. - Expect the
leagueIDs SGO doesn't carry (AFL,AFLW,NRL,RUGBYLEAGUE_NRLW,RUGBYLEAGUE_STATE_ORIGIN,RUGBYUNION_INTERNATIONALS,IPL) and AustralianbookmakerIDs (sportsbet,unibet,tab,playup,tabtouch,betright, …). - Replace any stream subscription with polling every ~2 minutes (
/stream/eventsanswers 501). - Read the extra signals:
decimalon every book,info.stale,notice.
SDK
import SportsGameOdds from "sports-odds-api";
const client = new SportsGameOdds({ apiKeyHeader: "YOUR_API_KEY", baseURL: "https://api.sockodds.com/v2" });
const res = await client.events.get({ leagueID: ["AFL"] });
console.log(res.data);from sports_odds_api import SportsGameOdds
client = SportsGameOdds(api_key_header="YOUR_API_KEY", base_url="https://api.sockodds.com/v2")
res = client.events.get({ league_id: ["afl"] })
print(res.data)require "sports_odds_api"
client = SportsOddsAPI::Client.new(api_key_header: "YOUR_API_KEY", base_url: "https://api.sockodds.com/v2")
res = client.events.get({ league_id: ["afl"] })
puts res.dataclient := sportsoddsapi.NewClient(option.WithAPIKeyHeader("YOUR_API_KEY"), option.WithBaseURL("https://api.sockodds.com/v2"))
res, err := client.Events.Get({ leagueID: ["AFL"] })
if err != nil { log.Fatal(err) }
fmt.Println(res.Data)SportsGameOddsClient client = SportsGameOddsOkHttpClient.builder()
.apiKeyHeader("YOUR_API_KEY").baseUrl("https://api.sockodds.com/v2").build();
var res = client.events.get({ leagueID: ["AFL"] });
System.out.println(res.items());Differences at a glance
| SockOdds | SportsGameOdds | |
|---|---|---|
| Base URL | https://api.sockodds.com/v2 | https://api.sportsgameodds.com/v2 |
| Key prefix | so_live_… | — |
| Bookmakers | 25, 21 Australian | 85+, US/EU |
| Australian codes | AFL, AFLW, NRL, NRLW, State of Origin, rugby union, IPL | Not carried |
| Streaming | 501 | WebSocket on All-Star |
| Open/close odds | Not snapshotted | includeOpenCloseOdds |
| Extra fields | decimal, info.stale, links.betslip | — |
| Shape | Identical | Identical |
Using both feeds for two markets is common: join on eventID and oddID.