Skip to content
datasportsAPI

FixturesHead-to-head fixtures

Documentation

/

Type to filter the docs by title or path.

FixturesEndpoint 11 of 116

Head-to-head fixtures

GET

/v2/fixtures/{id}/h2h/fixtures

Plan
All plans
Auth
Bearer dsa_live_…
Parameters
1 required · 0 optional
Returns
Fixture[]

Past and scheduled meetings of the two teams, returned as fixtures sorted by kick-off (oldest first); the fixture you asked about is excluded.

Worth knowing

Each item carries all Fixture fields in their list form, so those only /v2/fixtures/{id} fills (referee and the like) are null. Meetings from before your plan’s history window are omitted, with meta.historyFrom giving the first day included. Teams that have never met produce an empty array.

01Parameters

  • idpathRequired

    fixture id issued by DataSportsAPI, a positive integer

02Request

The same call from the command line and each SDK. The SDK lines assume a client created with your key; left out, it is read from DATASPORTSAPI_API_KEY. Installing a client: SDKs & CLI.

curl -H "Authorization: Bearer dsa_live_…" \
    "https://api.datasportsapi.com/v2/fixtures/{id}/h2h/fixtures"

03Response

The top-level keys of the JSON body. Each object links to its full shape in the data reference.

data
Fixture[]
meta
count, and historyFrom if your plan caused older meetings to be dropped
ObjectsFixture
Example response
{ "data": [ { "id": 456, "sport": "football", "startTime": "2015-09-19T14:00:00.000Z",
    "status": { "type": "finished", "phase": "finished", "code": 100, "description": "Ended", "period": null, "finish": "regular" },
    "home": { "id": 3758, "name": "Arsenal", … }, "away": { "id": 17000, "name": "Nottingham Forest", … },
    "homeScore": { "current": 2, … }, "awayScore": { "current": 0, … }, "winner": "home", … }, … ],
  "meta": { "count": 7 } }

04Errors

  • 403history_not_in_plan

    kick-off falls before the start of your plan’s history window

Any key can also meet401unauthorized429rate_limited429quota_exceeded500internal_errorEvery error code