Stay organized with collections
Save and categorize content based on your preferences.
This page describes how different Cloud Storage tools and libraries
paginate results. Pagination is required when listing a high number of
objects or buckets.
Console
The Google Cloud console automatically paginates bucket and object lists in
the Buckets and Bucket details pages.
The Google Cloud CLI automatically paginates bucket and object lists.
Client libraries
C++
Client libraries perform pagination by default. When you call a function
that supports pagination, an iterator is returned in the response. For
an example of how this iterator is used, see the C++ reference
documentation for ListObjects().
C#
Client libraries perform pagination by default. When you call a function
that supports pagination, an iterator is returned in the response. For
an example of how this iterator is used, see the C# reference
documentation for ListObjects().
Go
Client libraries perform pagination by default. When you call a function
that supports pagination, an iterator is returned in the response. For
an example of how this iterator is used, see the Go reference
documentation for Bucket.Objects.
Java
Client libraries perform pagination by default. When you call a function
that supports pagination, a page token is returned in the response. For
an example of how this is used, see the
Java reference documentation.
Node.js
Client libraries perform pagination by default. When you call a function
that supports pagination, an iterator is returned in the response. For
an example of how this iterator is used, see the Node.js reference
documentation for getFiles().
PHP
Client libraries perform pagination by default. When you call a function
that supports pagination, an iterator is returned in the response. For
an example of how this iterator is used, see the PHP reference
documentation for Objects.
Python
Client libraries perform pagination by default. When you call a function
that supports pagination, an iterator is returned in the response. For
an example of how this iterator is used, see the Python reference
documentation for page iterators.
Ruby
Client libraries perform pagination by default. When you call a function
that supports pagination, an iterator is returned in the response. For
an example of how this iterator is used, see the Ruby reference
documentation for Google::Cloud::Storage::File::List.
REST APIs
JSON API
When you call a function that supports pagination, the continuation
token nextPageToken is returned in the response if the listing is
incomplete. The nextPageToken represents the
last result that's returned. When you pass the value of nextPageToken
to the pageToken parameter of a subsequent request, you return the
next page of results, starting after the last result.
For example, say your request to list objects in a bucket named
my-bucket contains a nextPageToken in the response:
The HTTP request you would use to continue listing objects in
my-bucket would be the following:
GET https://storage.googleapis.com/storage/v1/b/my-bucket/o?pageToken=CgtzaGliYS0yLmpwZw==
For more information on paginating results, see the JSON reference
documentation for Objects: list or Buckets: list.
XML API
When you call a function that supports pagination, the continuation
token NextContinuationToken is returned in the response if the listing
is incomplete. The NextContinuationToken represents the last result
that's returned. When you pass the value of NextContinuationToken to
the continuation-token parameter of a subsequent request, you return
the next page of results, starting after the last result.
For example, say your request to list objects in a bucket named
my-bucket contains a NextContinuationToken in the response:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Paginate results\n\nThis page describes how different Cloud Storage tools and libraries\npaginate results. Pagination is required when listing a high number of\n[objects](/storage/docs/objects) or [buckets](/storage/docs/buckets). \n\n### Console\n\nThe Google Cloud console automatically paginates bucket and object lists in\nthe **Buckets** and **Bucket details** pages.\n\n\u003cbr /\u003e\n\n[Open the Buckets page](https://console.cloud.google.com/storage/browser)\n\n### Command line\n\nThe Google Cloud CLI automatically paginates bucket and object lists.\n\n### Client libraries\n\n### C++\n\nClient libraries perform pagination by default. When you call a function\nthat supports pagination, an iterator is returned in the response. For\nan example of how this iterator is used, see the C++ reference\ndocumentation for [`ListObjects()`](https://googleapis.dev/cpp/google-cloud-storage/latest/classgoogle_1_1cloud_1_1storage_1_1Client.html#ac632b30c61f6447eb35ce393a63070f5).\n\n### C#\n\nClient libraries perform pagination by default. When you call a function\nthat supports pagination, an iterator is returned in the response. For\nan example of how this iterator is used, see the C# reference\ndocumentation for [`ListObjects()`](/dotnet/docs/reference/Google.Cloud.Storage.V1/latest/Google.Cloud.Storage.V1.StorageClient#Google_Cloud_Storage_V1_StorageClient_ListObjects_System_String_System_String_Google_Cloud_Storage_V1_ListObjectsOptions_).\n\n### Go\n\nClient libraries perform pagination by default. When you call a function\nthat supports pagination, an iterator is returned in the response. For\nan example of how this iterator is used, see the Go reference\ndocumentation for [`Bucket.Objects`](https://pkg.go.dev/cloud.google.com/go/storage#hdr-Listing_objects).\n\n### Java\n\nClient libraries perform pagination by default. When you call a function\nthat supports pagination, a page token is returned in the response. For\nan example of how this is used, see the\n[Java reference documentation](/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.Storage#com_google_cloud_storage_Storage_list_java_lang_String_com_google_cloud_storage_Storage_BlobListOption____).\n\n### Node.js\n\nClient libraries perform pagination by default. When you call a function\nthat supports pagination, an iterator is returned in the response. For\nan example of how this iterator is used, see the Node.js reference\ndocumentation for [`getFiles()`](https://googleapis.dev/nodejs/storage/latest/Bucket.html#getFiles).\n\n### PHP\n\nClient libraries perform pagination by default. When you call a function\nthat supports pagination, an iterator is returned in the response. For\nan example of how this iterator is used, see the PHP reference\ndocumentation for [`Objects`](/php/docs/reference/cloud-storage/latest/Bucket#_Google_Cloud_Storage_Bucket__objects__).\n\n### Python\n\nClient libraries perform pagination by default. When you call a function\nthat supports pagination, an iterator is returned in the response. For\nan example of how this iterator is used, see the Python reference\ndocumentation for [page iterators](https://googleapis.dev/python/google-api-core/latest/page_iterator.html).\n\n### Ruby\n\nClient libraries perform pagination by default. When you call a function\nthat supports pagination, an iterator is returned in the response. For\nan example of how this iterator is used, see the Ruby reference\ndocumentation for [`Google::Cloud::Storage::File::List`](https://googleapis.dev/ruby/google-cloud-storage/latest/Google/Cloud/Storage/File/List.html).\n\n### REST APIs\n\n### JSON API\n\nWhen you call a function that supports pagination, the continuation\ntoken `nextPageToken` is returned in the response if the listing is\nincomplete. The `nextPageToken` represents the\nlast result that's returned. When you pass the value of `nextPageToken`\nto the `pageToken` parameter of a subsequent request, you return the\nnext page of results, starting after the last result.\n\nFor example, say your request to list objects in a bucket named\n`my-bucket` contains a `nextPageToken` in the response: \n\n```\n{\n \"kind\": \"storage#objects\",\n \"nextPageToken\": \"CgtzaGliYS0yLmpwZw==\",\n \"items\": [\n {\n OBJECT_1_METADATA\n },\n {\n OBJECT_2_METADATA\n },\n …\n ]\n}\n```\n\nThe HTTP request you would use to continue listing objects in\n`my-bucket` would be the following: \n\n```\nGET https://storage.googleapis.com/storage/v1/b/my-bucket/o?pageToken=CgtzaGliYS0yLmpwZw==\n```\n\nFor more information on paginating results, see the JSON reference\ndocumentation for [`Objects: list`](/storage/docs/json_api/v1/objects/list) or [`Buckets: list`](/storage/docs/json_api/v1/buckets/list).\n\n### XML API\n\nWhen you call a function that supports pagination, the continuation\ntoken `NextContinuationToken` is returned in the response if the listing\nis incomplete. The `NextContinuationToken` represents the last result\nthat's returned. When you pass the value of `NextContinuationToken` to\nthe `continuation-token` parameter of a subsequent request, you return\nthe next page of results, starting after the last result.\n\nFor example, say your request to list objects in a bucket named\n`my-bucket` contains a `NextContinuationToken` in the response: \n\n```\n\u003c?xml version='1.0' encoding='UTF-8'?\u003e\n\u003cListBucketResult xmlns='http://doc.s3.amazonaws.com/2006-03-01'\u003e\n \u003cName\u003emy-bucket\u003c/Name\u003e\n \u003cNextContinuationToken\u003eCgtzaGliYS0yLmpwZw==\u003c/NextContinuationToken\u003e\n \u003cKeyCount\u003e2\u003c/KeyCount\u003e\n \u003cMaxKeys\u003e2\u003c/MaxKeys\u003e\n \u003cIsTruncated\u003etrue\u003c/IsTruncated\u003e\n \u003cContents\u003e\n ...\n \u003c/Contents\u003e\n ...\n\u003c/ListBucketResult\u003e\n```\n\nNote that `list-type` must be set to `2` in order to return a\n`NextContinuationToken` when listing objects.\n\nThe HTTP request you would use to continue listing objects in\n`my-bucket` would include the following: \n\n```\nGET /?continuation-token=CgtzaGliYS0yLmpwZw==&list-type=2 HTTP/1.1\n Host: my-bucket.storage.googleapis.com\n```\n\nFor more detailed instructions on paginating through results from a\nbucket, see the XML reference documentation for [`List Objects`](/storage/docs/xml-api/get-bucket-list).\n\nNext steps\n----------\n\n- [List objects in a bucket](/storage/docs/listing-objects).\n- [List buckets in a project](/storage/docs/listing-buckets)."]]