Skip to main content
List endpoints in Sportrix Data return results in pages. Rather than receiving every matching record in a single response, you request a window of results using limit and offset and check the envelope metadata to know whether more pages exist. This keeps individual responses fast and predictable regardless of how many records match your query.

Which endpoints are paginated

The following endpoints are paginated and accept limit and offset:
  • GET /leagues
  • GET /leagues/active
  • GET /matches
  • GET /matches/active
GET /sports is not paginated — it returns a bare array containing only your enabled sports, which is a small, bounded list. Single-item endpoints (GET /matches/{id}, GET /matches/{id}/live, GET /matches/{id}/result) also return the object directly, not an envelope.

Pagination parameters

ParamDefaultMaxDescription
limit100200Number of items to return per page. Values above 200 are clamped to 200.
offset0Number of items to skip before the first result on this page.

Pagination envelope

Every paginated response wraps its results in a pagination envelope with the following fields:
FieldTypeDescription
itemsarrayThe records for this page
totalintegerTotal records matching the query, across all pages
limitintegerPage size used for this response (after clamping)
offsetintegerNumber of records skipped
countintegerNumber of records in this page (items.length)
pageinteger1-based page number for this offset / limit combination
total_pagesintegerTotal number of pages at the current limit
has_morebooleantrue if more records exist beyond this page

Example response

{
  "items": [ ],
  "total": 137,
  "limit": 100,
  "offset": 0,
  "count": 100,
  "page": 1,
  "total_pages": 2,
  "has_more": true
}

Paging through all results

The simplest pagination strategy is to increment offset by limit on each request and stop when has_more is false. Here is a complete Python example that fetches every league for a given sport:
import requests

HEADERS = {"X-API-Key": "sk_your_api_key_here"}
BASE = "https://api.sportrixdata.com/api"

offset = 0
limit = 100
all_leagues = []

while True:
    r = requests.get(
        f"{BASE}/leagues",
        params={"sport": 1, "limit": limit, "offset": offset},
        headers=HEADERS,
    )
    page = r.json()
    all_leagues.extend(page["items"])
    if not page["has_more"]:
        break
    offset += limit

print(f"Fetched {len(all_leagues)} leagues")
You can apply the same pattern to GET /matches by replacing the sport parameter with league and adjusting your filter parameters as needed.