GET Service Stay organized with collections Save and categorize content based on your preferences.
Lists all buckets in a specified project, ordered in the listlexicographically by name.
The GET Service method is a simple GET request without a bucket or objectscope. The request returns the list of buckets in an XML document in theresponse body. The request must be authenticated (anonymous requests willfail). By default, only the project owners group can list buckets because theyare the owner of all buckets within the project. The project team and projecteditors groups have only view or write access to buckets, respectively.
If the GET Service request fails, it returns a403 Forbidden status code.The body of the error response will also contain a message describing thereason why the request failed.
The XML API does not return lists longer than 1000 buckets.
Query string parameters
This request does not typically include query string parameters.
Seesigned URL query string parameters for information on the parametersyou include when creating and usingsigned URLs.
Request headers
| Header | Description | Required |
|---|---|---|
Authorization | The authentication string for the request. | Yes |
Content-Length | The length of the request body without headers (in bytes). * Not required for requests that use chunked transfer encoding. | Yes* |
Date | The date and time of the request. | Yes |
Host | The URI for Cloud Storage. For more information, seeRequest Endpoints. | Yes |
x-goog-project-id | The project ID of a project. Required unless you have set the default project for interoperable access. | No |
x-goog-user-project | The project to be billed for charges associated with the request. | No |
Request body elements
This request does not include an XML document in the request body.
Request syntax
GET / HTTP/1.1Host: storage.googleapis.comDate:DATEAuthorization:AUTHENTICATION_STRINGContent-Length: 0x-goog-project-id:PROJECT_ID
Response headers
The request can return a variety of response headers depending on the request headers you use.
Response body elements
| Element | Description |
|---|---|
| ListAllMyBucketsResult | Container for bucket information. |
| Buckets | Container for information about the owner's buckets. |
| Bucket | Container for information about a specific bucket. |
| Name | Name of the bucket. |
| CreationDate | Creation date for the bucket. |
Example
The following sample lists the buckets in the specified project.
Request
GET / HTTP/1.1Host: storage.googleapis.comDate: Mon, 15 Feb 2010 11:00:00 GMTContent-Length: 0x-goog-project-id: 123456789123Authorization: Bearer ya29.AHES6ZRVmB7fkLtd1XTmq6mo0S1wqZZi3-Lh_s-6Uw7p8vtgSwg
Response
HTTP/1.1 200 OKContent-Length: 648Content-Type: application/xmlDate: Mon, 15 Feb 2010 11:00:01 GMT<?xml version='1.0' encoding='utf-8'?><ListAllMyBucketsResult xmlns='http://doc.s3.amazonaws.com/2006-03-01'> <Buckets> <Bucket> <Name>city-maps</Name> <CreationDate>2009-12-16T18:36:25.369Z</CreationDate> </Bucket> <Bucket> <Name>state-maps</Name> <CreationDate>2009-12-16T18:42:37.408Z</CreationDate> </Bucket> <Bucket> <Name>country-maps</Name> <CreationDate>2010-01-22T01:27:03.633Z</CreationDate> </Bucket> </Buckets></ListAllMyBucketsResult>
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-17 UTC.