Skip to main content
List endpoints can return more results than you want to handle in a single response. Pagination helps you move through results safely, while filters help you ask for a smaller, more useful set of data. Use pagination when you need to process many resources. Use filters when you already know what kind of resource you’re looking for.
Not every list endpoint supports the same filters. For instance filters, see the GET /instances endpoint reference.

How cursor pagination works

The Compute API uses cursor-based pagination for list responses that support paging. A cursor is an opaque value that points to the next page of results. You don’t need to read or modify it. Pass it back exactly as the API returns it. A paginated response includes a pagination object:
If pagination.next contains a value, there may be another page. If pagination.next is null, you’ve reached the last page.

Request the first page

To request the first page of instances, call GET /instances without a cursor.
The size query parameter controls the maximum number of items returned in that page. For GET /instances, size can be between 1 and 200. The default is 50.
Use smaller page sizes while testing. Larger pages are useful for batch jobs, but small pages make responses easier to inspect when you’re debugging.

Request the next page

To request the next page, copy the value from pagination.next and pass it as the cursor query parameter.
Keep using the next cursor from each response until pagination.next is null.
Treat cursors as temporary values. Don’t store them as permanent links to a specific page, and don’t edit them before sending them back to the API.

Page through all results

A typical pagination workflow looks like this:
1

Request the first page

Call the list endpoint, such as GET /instances, with a size value and no cursor.
2

Read the response

Process the items in the data array.
3

Check for the next cursor

Look at pagination.next.
4

Request the next page

If pagination.next is not null, send another request with that value as the cursor.
5

Stop at the last page

Stop when pagination.next is null.

Use filters to narrow results

Filters are query parameters that reduce the results returned by a list endpoint, such as GET /instances. For example, this request lists running instances in a specific region:
Filters are useful when you want to:
  • Find resources in a specific state
  • Limit results to a region or hardware type
  • Search by owner, organization, or related identifier
  • Review resources created during a specific time window
  • Find resources by name or other searchable text

Supported instance filters

GET /instances supports these filters:
Use the endpoint reference for exact limits, allowed values, defaults, and examples.

Filter by status

Use status with GET /instances when you only want instances in a specific lifecycle state.
For GET /instances, supported status filters are:
  • running
  • stopped
  • terminated
Status filter values may use a different format from status values returned in the response. For example, a filter may use running, while the response may show RUNNING.
Filter by date range Use date_range_begin and date_range_end together when you want instances created within a specific time window.
Date range values use ISO 8601 timestamps in UTC. Use both parameters together:
  • date_range_begin sets the start of the range.
  • date_range_end sets the end of the range.

Search by text

Use free_text_search with GET /instances when you want to search across instance names and related fields.
Text search is useful when you know part of a resource name but don’t know its ID.

Combine filters

You can combine supported filters in one GET /instances request. For example, this request searches for running instances in us-east-1 that match training-run:
When combining filters, start with the narrowest useful set. If the response is empty, remove filters one at a time to find which condition is excluding the resource.

Common issues

Next step

Continue with Handle errors and rate limits to understand common API errors and how to retry requests safely.