Skip to main content

Pagination

List endpoints โ€” tickets, loans, notifications, offers and more โ€” are paginated with two query parameters:

pagequeryintegerdefault: 1

The page number, starting at 1.

limitqueryintegerdefault: 20

Records per page.

curl "https://api.getroja.com/v1/tickets?type=borrow&page=2&limit=50" \
-H "Authorization: Bearer $ACCESS_TOKEN"

Walking a full listโ€‹

Request pages in order, incrementing page until a response returns fewer items than limit โ€” that's the last page:

async function allTickets(token) {
const limit = 50;
const results = [];
for (let page = 1; ; page++) {
const res = await fetch(
`https://api.getroja.com/v1/tickets?page=${page}&limit=${limit}`,
{ headers: { Authorization: `Bearer ${token}` } },
);
const { items = [] } = await res.json();
results.push(...items);
if (items.length < limit) return results;
}
}

Lists reflect live marketplace state โ€” items can shift between pages while you iterate. De-duplicate by id if you're aggregating across pages.