GET /teams - Fetch Team Data
Get a list of Teams by ID or league
GET https://api.sockodds.com/v2/teams/
Retrieve team information including names, colours and identifiers. Filter by teamID, leagueID or sportID. Supports pagination.
Query parameters
| Parameter | Type | Description |
|---|---|---|
sportID | string | A single sportID or comma-separated list of sportIDs to get Teams for |
leagueID | string | A single leagueID or comma-separated list of leagueIDs to get Teams for e.g. AFL |
teamID | string | A single teamID or comma-separated list of teamIDs to get data for e.g. BRISBANE_LIONS_AFL |
limit | number | The maximum number of Teams to return (default 50, max 250) |
cursor | string | The cursor for the request. Used to get the next group of results. This is an opaque token — pass the nextCursor value from the prior response unchanged. |
Response
Paginated: { "success": true, "data": Team[], "nextCursor": string | null }
Team
Contains information on a team
| Field | Type | Description |
|---|---|---|
teamID | string | e.g. BRISBANE_LIONS_AFL — defined per league |
sportID | string | |
leagueID | string | |
names | object | { long, medium, short } |
colors | object | { primary, secondary, primaryContrast, secondaryContrast } where known |
statEntityID | string | home or away on the event the team was read from |
Status codes
| Status | Body |
|---|---|
200 | Success |
400 | {"success":false,"error":"Invalid params"} |
401 | {"success":false,"error":"Invalid API key"} |
403 | {"success":false,"error":"Inactive API key"} |
429 | {"success":false,"error":"Rate limit exceeded"} (Retry-After header) |
500 | {"success":false,"error":"Query failed"} |
Code samples
curl -X GET "https://api.sockodds.com/v2/teams/?leagueID=AFL" \
-H "x-api-key: YOUR_API_KEY"const r = await fetch("https://api.sockodds.com/v2/teams/?leagueID=AFL", { headers: { "x-api-key": "YOUR_API_KEY" } });
const { success, data, nextCursor, notice } = await r.json();import requests
r = requests.get("https://api.sockodds.com/v2/teams/", params=dict(leagueID="AFL"), headers={"x-api-key": "YOUR_API_KEY"})
body = r.json()req, _ := http.NewRequest("GET", "https://api.sockodds.com/v2/teams/?leagueID=AFL", nil)
req.Header.Set("x-api-key", "YOUR_API_KEY")
res, err := http.DefaultClient.Do(req)HttpRequest req = HttpRequest.newBuilder().uri(URI.create("https://api.sockodds.com/v2/teams/?leagueID=AFL"))
.header("x-api-key", "YOUR_API_KEY").GET().build();
HttpResponse<String> res = HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString());using var http = new HttpClient();
http.DefaultRequestHeaders.Add("x-api-key", "YOUR_API_KEY");
var body = await http.GetStringAsync("https://api.sockodds.com/v2/teams/?leagueID=AFL");Try it
// the response appears here