Skip to main content

Pagination

List endpoints that may return large result sets support page-based pagination.

Query Parameters

ParameterTypeDefaultRangeDescription
pageinteger11+The page number to return
page_sizeinteger501–200Number of items per page

Response Format

Paginated endpoints wrap results in a standard envelope:
{
  "data": [ ... ],
  "pagination": {
    "total": 142,
    "page": 1,
    "page_size": 50,
    "total_pages": 3
  }
}
FieldDescription
totalTotal number of items matching the query
pageCurrent page number
page_sizeItems per page
total_pagesTotal number of pages

Example: Iterating Through All Pages

async function fetchAllAttendees(eventId, apiKey) {
  const attendees = [];
  let page = 1;
  let totalPages = 1;

  while (page <= totalPages) {
    const response = await fetch(
      `https://www.gomry.com/api/v1/events/${eventId}/attendees?page=${page}&page_size=200`,
      { headers: { "X-API-KEY": apiKey } }
    );

    const result = await response.json();
    attendees.push(...result.data);
    totalPages = result.pagination.total_pages;
    page++;
  }

  return attendees;
}
Not all list endpoints are paginated. Endpoints that always return a bounded number of items (like ticket classes for an event) return a flat { "data": [...] } response without pagination metadata.