Vizit Public APIAPI
Standards

Pagination

Cursor-based pagination for paginated list endpoints.

The public API uses cursor-based pagination for paginated list endpoints.

Cursor-based pagination is preferred because it is:

  • Stable when new records are created while a client is paging through results.
  • Efficient for large result sets.
  • Familiar to API consumers who work with external APIs such as Stripe, GitHub, and Shopify.

Request Parameters

Paginated endpoints use these query parameters:

ParameterTypeDescription
limitintegerNumber of items to return. Default: 25. Maximum: 100.
cursorstringOpaque cursor returned by the previous page. Omit this parameter to request the first page.

Clients should treat cursor as an opaque token and should not attempt to parse or construct it.

Response Shape

Paginated endpoints return a response shaped like this:

{
  "data": [],
  "has_more": true,
  "next_cursor": "eyJpZCI6Li4u"
}

Fields

FieldTypeDescription
dataarrayThe items in the current page.
has_morebooleanWhether another page is available after this one.
next_cursorstring | nullCursor to pass on the next request. Omitted or null when there are no more results.

Client Guidance

  • Omit cursor on the first request.
  • To fetch the next page, pass the next_cursor value returned by the previous response.
  • Stop paging when has_more is false.
  • Do not assume cursors are stable forever. Use them as short-lived continuation tokens.

Offset Pagination for Custom Benchmarks and Collections

The custom benchmark and collection lists page by offset instead of cursor:

  • GET /v1/benchmarks
  • GET /v1/benchmarks/{benchmark_id}/images
  • GET /v1/benchmarks/{benchmark_id}/scorings
  • GET /v1/collections
  • GET /v1/collections/{collection_id}/images

They take limit (default 10, maximum 100) and offset (default 0), return a JSON array, and send the total number of matching items in the Vizit-Total-Count response header. They return no next_cursor, so keep requesting with offset increased by limit until offset reaches Vizit-Total-Count.

Design Notes

  • Cursor-paginated responses include no total count.
  • Cursor-based pagination is the standard for the public API even if other interfaces use a different pagination model.
  • Endpoint-specific filtering and sorting rules will be documented alongside each operation in the API reference.

On this page