Skip to main content
New projects should use the Documents API. To move an existing index, see Move to the Documents API.
This page shows you how to list record IDs in a namespace of a legacy vector index with the legacy Vectors API. For a document index, see List IDs.
The list endpoint is supported only for serverless indexes.

List the IDs of all records in a namespace

To list the IDs of all records in the namespace of a serverless index, pass only the namespace parameter:

List the IDs of records with a common prefix

ID prefixes enable you to query segments of content. Use the list endpoint to list all of the records with the common prefix. For more details, see Use structured IDs.

Paginate through results

The list endpoint returns up to 100 IDs per page at a time by default. If the limit parameter is passed, list returns up to that number of IDs per page instead. For example, if limit=3, up to 3 IDs be returned per page. Whenever there are additional IDs to return, the response also includes a pagination_token for fetching the next page of IDs.

Implicit pagination

When using the Python SDK, list paginates automatically.
Python

Manual pagination

When using the Node.js SDK, Java SDK, Go SDK, or REST API, you must manually fetch each page of results. You can also manually paginate with the Python SDK using list_paginated().
Then, to get the next batch of IDs, use the returned pagination_token:
When there are no more IDs to return, the response doesn’t includes a pagination_token: