Setup Guide — API Keys and Authentication
There are only 2 things you need to get started — an API key and a way to make requests.
API key
- Get an API key here. An API key is required to make requests.
- We offer an eternally free plan. The Lite key covers AFL and NRL from 3 bookmakers at 10 requests a minute, no card.
- Your key is shown once. Only a hash is stored on our side, so a lost key cannot be recovered — mint a new one.
- Keep your API key secret. Never expose it publicly. Your API key is your password to the API.
- Include your API key in all requests. Either the
x-api-keyheader or theapiKeyquery param.
Making requests manually
Reference docs tool
You can make requests directly from the API Reference:
- Open an endpoint page (Events, Teams, Sports, …).
- Paste your key into the API key field.
- Fill in query parameters.
- Click Send. The response appears below with its status, timing and rate-limit headers.
The reference pages also give you ready-to-use code snippets in multiple languages.
Postman
- Install Postman: postman.com/downloads.
- Download our collection: SockOdds Postman Collection.
- Import the collection: click Import and drop the file in.
- Set your API key: select
SockOdds API→ Variables → replaceYOUR_API_KEY_HERE→ Save. - Make a request: expand Events → Get Events → set
oddsAvailableto true → Send.
Directly in the browser
Use the apiKey parameter to authenticate in the address bar:
https://api.sockodds.com/v2/sports/?apiKey=YOUR_API_KEYAdd or remove query parameters to adjust what you receive. To get only head-to-head prices on the events endpoint add &oddID=points-home-game-ml-home,points-away-game-ml-away.
API responses can be large and may slow your browser tab. Great for quick tests, not recommended for regular use.
Making requests in code
With HTTP libraries
Replace YOUR_API_KEY with your actual API key:
https://api.sockodds.com/v2/sports/?apiKey=YOUR_API_KEYcurl -X GET "https://api.sockodds.com/v2/sports/?" -H "x-api-key: YOUR_API_KEY"const response = await fetch("https://api.sockodds.com/v2/sports/?", { headers: { "x-api-key": "YOUR_API_KEY" } });
const { data, nextCursor, notice } = await response.json();
console.log(JSON.stringify(data, null, 2));import requests
response = requests.get("https://api.sockodds.com/v2/sports/", params=dict(), headers={"x-api-key": "YOUR_API_KEY"})
output = response.json()
print(output["data"])require 'net/http'
require 'json'
uri = URI("https://api.sockodds.com/v2/sports/?")
req = Net::HTTP::Get.new(uri)
req['x-api-key'] = 'YOUR_API_KEY'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
puts JSON.pretty_generate(JSON.parse(res.body)['data'])<?php
$ch = curl_init("https://api.sockodds.com/v2/sports/?");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['x-api-key: YOUR_API_KEY']);
$output = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($output['data']);import java.net.URI;
import java.net.http.*;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.sockodds.com/v2/sports/?"))
.header("x-api-key", "YOUR_API_KEY").GET().build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());req, _ := http.NewRequest("GET", "https://api.sockodds.com/v2/sports/?", nil)
req.Header.Set("x-api-key", "YOUR_API_KEY")
res, err := http.DefaultClient.Do(req)
if err != nil { log.Fatal(err) }
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))With the SDK
The official SportsGameOdds SDKs are generated from the same v2 schema SockOdds serves, so they work here unchanged — set the base URL. First, install:
npm install sports-odds-api # or yarn add / pnpm addpip install sports-odds-apigem install sports-odds-apigo get github.com/SportsGameOdds/sports-odds-api-go// Gradle
implementation 'com.sportsgameodds.api:sports-odds-api:1.0.0'Then make a request:
import SportsGameOdds from "sports-odds-api";
const client = new SportsGameOdds({ apiKeyHeader: "YOUR_API_KEY", baseURL: "https://api.sockodds.com/v2" });
const res = await client.sports.get();
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.sports.get()
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.sports.get
puts res.dataclient := sportsoddsapi.NewClient(option.WithAPIKeyHeader("YOUR_API_KEY"), option.WithBaseURL("https://api.sockodds.com/v2"))
res, err := client.Sports.Get(context.Background())
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.sports().get();
System.out.println(res.items());Learn more about the SDKSee the SDK guide for pagination, error handling, filtering and advanced features.