Skip to main content

Page-based pagination

The majority of our API endpoints use standard page-based pagination.
  • page: the page number
  • per_page: the number of items returned per page (default: 25, max: 100)
To set these values, pass them as query parameters in your request. For example, in a list organizations GET request, to return the first page at 50 items per page:

Cursor-based pagination

For API endpoints with large result sets, we use cursor-based pagination. Cursor endpoints will return the following in their payload.
  • cursor_start: The ID of the first item returned.
  • cursor_end: The ID of the last item returned.
  • has_next: Whether there is a next page of results.
  • has_prev: Whether there is a previous page of results.
For example:

Cursor-based query parameters

To pagination records, the following query parameters are available:
  • starting_after: The public_id of the last item in the previous page.
  • ending_before: The public_id of the first item in the next page.
  • limit: The number of items to return. Default DEFAULT_LIMIT.
For example, use the following to retrieve to items after eeq8f2lwrlum.

Need help?

Get help from the PlanetScale Support team, or join our Discord community to see how others are using PlanetScale.