Pagination
List endpoints use opaque cursors: stable under inserts, fast at any depth.
How it works
GET /games, /movies, /series and /books return { data, next_cursor }. To get the next page, repeat the same request with cursor=<next_cursor>. When next_cursor is null you reached the end.
- Keep every other parameter identical. A cursor from another
sortreturns400. - Cursors are opaque: do not parse or build them, their format may change.
- Ordering is stable: ties are broken by item id, and unscored or undated items always come last.
Page size
limit defaults to 10. The maximum depends on your plan: 10 on Free, 100 on Pro and Business. A larger value returns 400 bad_request — the API never silently truncates. Each page counts as one request.
Example: iterate over every page
async function* allGames(params = {}) {
let cursor = null;
do {
const query = new URLSearchParams({ ...params, limit: "100", ...(cursor ? { cursor } : {}) });
const res = await fetch(`https://api.hexascore.app/v1/games?${query}`, {
headers: { Authorization: `Bearer ${process.env.HEXASCORE_API_KEY}` },
});
if (!res.ok) throw new Error((await res.json()).detail);
const page = await res.json();
yield* page.data;
cursor = page.next_cursor;
} while (cursor);
}
for await (const game of allGames({ genre: "Adventure", sort: "-score" })) console.log(game.title);Search
GET /search is not paginated: it returns the best matches (up to 50) for a query, best first.