> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sportrix.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Sportrix Data REST API — Overview and Authentication

> An overview of the Sportrix Data REST API: base URL, authentication, response conventions, date formats, and status codes used across all endpoints.

The Sportrix Data REST API gives you access to a sports fixture catalog, live score snapshots, and post-match results through a straightforward HTTP interface. Every response is JSON, and all paths described in this documentation are relative to the single base URL below.

## Base URL

All REST API requests are made to:

```
https://api.sportrixdata.com/api
```

For example, `GET /sports` resolves to `GET https://api.sportrixdata.com/api/sports`.

## Authentication

Include your API key in the `X-API-Key` header on every request:

```bash theme={null}
curl https://api.sportrixdata.com/api/sports \
  -H "X-API-Key: sk_your_api_key_here"
```

A missing, unknown, disabled, or expired key returns **401 Unauthorized**. The only endpoint that does not require authentication is `GET /health`.

## Response Format

All responses are JSON. List endpoints return a [pagination envelope](/concepts/pagination). Single-resource endpoints return the object directly.

## Dates and Times

All timestamps are ISO 8601 in UTC. For example:

```
2026-06-18T02:00:00Z
```

Query parameters that accept a datetime (`start_after`, `start_before`) use the same format.

## Match Status Values

Catalog endpoints expose exactly three status values:

| `status`        | Meaning                                                        |
| --------------- | -------------------------------------------------------------- |
| `NOT_STARTED`   | Scheduled, not yet kicked off                                  |
| `STARTED`       | In play (including half-time)                                  |
| `CLOSE_OF_PLAY` | Multi-day cricket Test between days (at stumps, still ongoing) |
| `FINISHED`      | Completed                                                      |

Matches that the provider has marked suspended or postponed are **never** returned — they are filtered out of every catalog response.

## Pagination

List endpoints (`/leagues`, `/leagues/active`, `/teams`, `/matches`, `/matches/active`) accept `limit` and `offset` query parameters and return a pagination envelope. See the [Pagination guide](/concepts/pagination) for the full envelope schema and examples.

## Errors

Errors use standard HTTP status codes with a JSON body:

```json theme={null}
{ "detail": "Missing required scope: live_scores" }
```

See the [Errors reference](/concepts/errors) for the full list of status codes.

## Endpoint Quick Reference

| Endpoint                   | Scope                                     | Description                            |
| -------------------------- | ----------------------------------------- | -------------------------------------- |
| `GET /health`              | none                                      | Liveness probe                         |
| `GET /sports`              | `fixtures`                                | List enabled sports                    |
| `GET /leagues`             | `fixtures`                                | List leagues for a sport               |
| `GET /leagues/active`      | `fixtures`                                | Leagues with live or upcoming matches  |
| `GET /teams`               | `fixtures`                                | List teams in a league, with silk URLs |
| `GET /matches`             | `fixtures`                                | List matches for a league              |
| `GET /matches/active`      | `fixtures`                                | Live or upcoming matches for a league  |
| `GET /matches/{id}`        | `fixtures`                                | Single match by id                     |
| `GET /matches/{id}/live`   | `live_scores` or `live_scores_statistics` | Live score snapshot                    |
| `GET /matches/{id}/result` | `final_scores`                            | Half-time and full-time snapshots      |
