Quickstart · API v2
From a fresh key to live data in three steps
The whole API runs on one base URL, one auth header and one response shape. Learn those three things once and all 116 endpoints, across 24 sports, answer exactly the way you expect.
The ground rules
Six facts that hold for every request. Everything else in these docs builds on them.
- Base URL
- https://api.datasportsapi.com
HTTPS only. Every path starts with /v2.
- Authentication
- Authorization: Bearer dsa_live_…
The same header on every call. Keys are created in your dashboard — see Authentication.
- Success
- { data, meta }
data carries the object or list you asked for; meta, when present, describes it.
- Failure
- { error: { code, message } }
Sent with a real HTTP status. Write your logic against code; the message is for humans.
- Identifiers
- Our own integers
Issued by us and stable for the life of the record. Safe to store and join on.
- Images
- https://cdn.datasportsapi.com
Teams, leagues and players carry an image URL on our CDN, or null when none exists.
Your first request
Three steps, about five minutes. Nothing to install unless you want an SDK.
- 1
Create a key
Sign up — the Free plan needs no card — and create a key in the dashboard. It starts with
dsa_live_and is shown exactly once, so put it straight into your secret store or an environment variable. Every SDK, and the examples below, readDATASPORTSAPI_API_KEY.Shellexport DATASPORTSAPI_API_KEY="dsa_live_…" - 2
Ask for the matches in play
GET /v2/livescoresreturns every fixture currently in progress;?sport=footballnarrows it to one sport. Pick whichever client you like — they all hit the same URL.curl -H "Authorization: Bearer $DATASPORTSAPI_API_KEY" \ "https://api.datasportsapi.com/v2/livescores?sport=football" - 3
Read the envelope
200 OK · example response{ "data": [ { "id": 201324, "sport": "football", "status": { "type": "inprogress", "description": "2nd half", "period": "period2" }, "startTime": "2026-10-18T15:30:00.000Z", "home": { "id": 17000, "name": "Nottingham Forest", "image": "https://cdn.datasportsapi.com/v2/teams/17000/logo" }, "away": { "id": 3758, "name": "Arsenal", "image": "https://cdn.datasportsapi.com/v2/teams/3758/logo" }, "homeScore": { "current": 0, "periods": { "period1": 0, "period2": 0 } }, "awayScore": { "current": 1, "periods": { "period1": 0, "period2": 1 } }, "league": { "id": 195828, "name": "Premier League", "category": "England" } } ], "meta": { "sport": "football", "count": 1 } }data- A list here. Detail endpoints such as /v2/fixtures/{id} put a single object in the same slot.
id- Our own integer. The same match keeps it on every endpoint and in every WebSocket frame.
image- An absolute URL on cdn.datasportsapi.com, or null when there is no picture.
meta- Describes the payload: the filters you sent, row counts and, on paged lists, where you are.
Success and failure look the same everywhere
Two shapes cover the entire REST surface, so one response handler is enough for every endpoint.
A paged list
{
"data": [ { "id": 211521, … }, … ],
"meta": { "page": 0, "hasNextPage": true }
}A refusal
{
"error": {
"code": "endpoint_not_in_plan",
"message": "this endpoint is not included in your plan"
}
}meta changes with the endpoint: lists report counts and paging, filtered calls echo the filters back, and a list trimmed by your plan's history window says so in meta.historyFrom. Errors never arrive with a 200 — check the status, then switch on error.code. The errors guide lists every code and the right reaction to each.
The full contract, every field and enum included, is also published as an OpenAPI 3.1 document at https://api.datasportsapi.com/v2/openapi.json. It needs no key, so code generators can read it directly.
IDs and images you can keep
Identifiers
Every id — fixture, team, player, league, season, venue, referee — is issued by us and never reassigned. A team has the same id in a livescore, a squad list, a standings row and a WebSocket delta, so you can use it as a foreign key in your own database without a mapping table.
Images
Logos, player photos and country flags are absolute URLs on https://cdn.datasportsapi.com. Point an <img> at them directly. When we have no picture the field is null rather than a placeholder, so render your own fallback.
Guides
The rules of the road, then the delivery channels beyond plain REST.
- 01Authentication & keysSecret and publishable keys, rotation, the IP allowlist and keeping keys out of browsers.
- 02SDKs & CLITypeScript, Python and Go clients plus the dsa command, with retries and paging handled.
- 03Plans, quota & rate limitsQuota, per-minute rate and history window for each plan, and the headers that report them.
- 04ErrorsEvery status and error code: what triggers it and whether a retry can help.
- 05Data freshnessHow old each endpoint's data can be, from pushed instantly to refreshed every few hours.
- 06WebSocket streamTickets, channels, frames, delta merging and the five-minute replay buffer.
- 07WebhooksSigned POSTs for scores, status changes, match events and lineups, with retries.
- 08WidgetsLivescore, match and standings embeds powered by a publishable key.
- 09Season exportsA league season delivered as JSON, CSV or Parquet files.
The API by group
116 endpoints in 16 groups. Each card opens the first endpoint of its group; the sidebar lists the rest.
- Catalog1Sports
- Live scores1Live scores
- Fixtures28Fixtures by date · Fixture counts · Fixture · Lineups …
- Teams20Team · Team fixtures · Squad · Team transfers …
- Players13Player · Player transfers · Latest transfers · Player seasons …
- Leagues22League · Seasons · Champions · Season venues …
- Discovery5Rankings · Ranking · Categories · League directory …
- Race sports9Races · Race · Race results · Race laps …
- Referees & managers4Referee · Referee fixtures · Manager · Manager fixtures
- Venues2Venue · Venue fixtures
- Search1Search
- Betting odds3Fixture odds · Winning odds · Odds by day
- Widgets1Widget script
- Bulk exports3Create an export · Export status · Exports
- Webhooks1Webhook event
- WebSocket2Stream ticket · Connect