Guides / Pagination

Pagination

List endpoints return results in pages of 50. Use the page parameter to move through them and the meta object to know when to stop.

Samples use the small get() helper from Build a live score app.

How pages work

List endpoints return up to 50 results per page. Pass page to choose a page; the default is 1. Every paginated response includes a meta object:

Response
{
"data": [ … 50 fixtures … ],
"meta": { "page": 2, "per_page": 50, "total": 380 }
}
  • meta.page — the page you received.
  • meta.per_page — results per page (50).
  • meta.total — results across all pages.

The number of pages is ceil(total / per_page), and you have reached the last page when page × per_page ≥ total.

const { data, meta } = await get("/football/fixtures", { league_id: 39, season: 2026, page: 2 });
const pageCount = Math.ceil(meta.total / meta.per_page); // 380 / 50 → 8 pages

Fetching every page

Wrap the loop in a generator so the rest of your code can treat a paginated list as one stream of results:

async function* pages(path, params = {}) {
for (let page = 1; ; page++) {
const { data, meta } = await get(path, { ...params, page });
yield* data;
if (page * meta.per_page >= meta.total) return;
}
}
// Usage: every fixture of the season, one page at a time
for await (const fixture of pages("/football/fixtures", { league_id: 39, season: 2026 })) {
console.log(fixture.id, fixture.home.name, "v", fixture.away.name);
}

Which endpoints paginate

Every endpoint with a page parameter:

The rest return a complete result in one response: /football/standings, /basketball/boxscores, /basketball/standings, /cricket/scorecards, /baseball/standings, /hockey/standings, /american-football/standings, /motorsport/races/results, /motorsport/live-timing, /motorsport/standings, /rugby/standings, /volleyball/standings, /handball/standings.

Tips

  • Read per_page from meta instead of hard-coding 50.
  • Filter first. date, team_id or status can turn eight pages into one.
  • Fetch pages one after another. Firing them all at once can hit your per-minute rate limit.
  • Each page costs one request — include them when you budget a sync.
  • Lists can change while you read them, especially on match days. Upsert by id so a fixture that moves between pages is never stored twice.