Pagination
Every list pages the same way.
How it works
| Field | Where | Meaning |
|---|---|---|
| limit | query | Rows per page, 1 to 100. Default 20. |
| cursor | query | The next_cursor from the page before. |
| next_cursor | meta | Send it back as cursor for the next page. null on the last page. |
| total | meta | Every row that matches your filters, across all pages. |
Reading a whole list
JavaScript
let cursor = null, games = [];
do {
const url = new URL("https://developers.arena54.com/api/v1/games");
url.searchParams.set("limit", "100");
if (cursor) url.searchParams.set("cursor", cursor);
const res = await fetch(url, { headers: { Authorization: `Bearer ${process.env.A54_KEY}` } });
const body = await res.json();
if (!body.success) throw new Error(body.error.code);
games.push(...body.data);
cursor = body.meta.next_cursor;
} while (cursor);Rules
- Treat the cursor as opaque. Do not build or change one.
- Keep the same filters while you page; a cursor belongs to the list it came from.
- For a count, ask for
limit=1and readmeta.total.