Pagination

Every list pages the same way.

How it works

FieldWhereMeaning
limitqueryRows per page, 1 to 100. Default 20.
cursorqueryThe next_cursor from the page before.
next_cursormetaSend it back as cursor for the next page. null on the last page.
totalmetaEvery 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=1 and read meta.total.