Skip to content
datasportsAPI

Get startedQuickstart

Documentation

/

Type to filter the docs by title or path.

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.

116 endpoints24 sportsREST · WebSocket · Webhooks
01

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.

02

Your first request

Three steps, about five minutes. Nothing to install unless you want an SDK.

  1. 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, read DATASPORTSAPI_API_KEY.

    Shell
    export DATASPORTSAPI_API_KEY="dsa_live_…"
  2. 2

    Ask for the matches in play

    GET /v2/livescores returns every fixture currently in progress; ?sport=football narrows 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. 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.
03

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

200 OK
{
  "data": [ { "id": 211521, … }, … ],
  "meta": { "page": 0, "hasNextPage": true }
}

A refusal

403 Forbidden
{
  "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.

04

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.

05

Guides

The rules of the road, then the delivery channels beyond plain REST.

06

The API by group

116 endpoints in 16 groups. Each card opens the first endpoint of its group; the sidebar lists the rest.