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 apagination object:
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, callGET /instances without a cursor.
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.
Request the next page
To request the next page, copy the value frompagination.next and pass it as the cursor query parameter.
pagination.next is null.
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 asGET /instances.
For example, this request lists running instances in a specific region:
- 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
Usestatus with GET /instances when you only want instances in a specific lifecycle state.
GET /instances, supported status filters are:
runningstoppedterminated
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.date_range_begin and date_range_end together when you want instances created within a specific time window.
date_range_beginsets the start of the range.date_range_endsets the end of the range.
Search by text
Usefree_text_search with GET /instances when you want to search across instance names and related fields.
Combine filters
You can combine supported filters in oneGET /instances request.
For example, this request searches for running instances in us-east-1 that match training-run: