This page explains the different request endpoints you can use to access Cloud Storage. Cloud Storage supports HTTP/1.1, HTTP/2, and HTTP/3 protocols. An endpoint is the location where Cloud Storage can be accessed, written as a URL.
Note: The Cloud Storage URLs described on this page are subject to change. Typical API requests JSON APIWhen making JSON API requests directly to Cloud Storage, use the following endpoints:
For general JSON API requests, excluding object uploads, use the following endpoint, replacing PATH_TO_RESOURCE
with the appropriate value:
https://storage.googleapis.com/storage/v1/PATH_TO_RESOURCE
For JSON API object uploads, use the following endpoint, replacing BUCKET_NAME
with the appropriate value:
https://storage.googleapis.com/upload/storage/v1/b/BUCKET_NAME/o
For batched requests, use the following endpoint, replacing PATH_TO_RESOURCE
with the appropriate value:
https://storage.googleapis.com/batch/storage/v1/PATH_TO_RESOURCE
Optionally, for JSON API object downloads, you can use the following endpoint, replacing BUCKET_NAME
and OBJECT_NAME
with the appropriate values:
https://storage.googleapis.com/download/storage/v1/b/BUCKET_NAME/o/OBJECT_NAME?alt=media
JSON API endpoints only accept HTTPS requests.
Note: Anhttps://www.googleapis.com
endpoint is also supported for the JSON API and is returned in the selfLink
metadata field for an object, but https://storage.googleapis.com
is the preferred endpoint for better performance and availability. Similarly, an https://content-storage.googleapis.com
endpoint is supported for downloads and is returned in the mediaLink
metadata field for an object, but is also not recommended for use. XML API Important: If you intend to serve content through a browser, note that the XML API serves content from the same origin as the request endpoint. If you need to serve content from a unique origin, consider using the JSON API or Authenticated browser downloads.
When making XML API requests directly to Cloud Storage, use the virtual hosted-style or path-style endpoint, replacing BUCKET_NAME
and OBJECT_NAME
with the appropriate values:
Virtual hosted-style endpoint:
https://BUCKET_NAME.storage.googleapis.com/OBJECT_NAME
Path-style endpoint:
https://storage.googleapis.com/BUCKET_NAME/OBJECT_NAME
XML API endpoints support secure sockets layer (SSL) encryption, which means you can use either HTTP or HTTPS. Using HTTPS is recommended, especially if you authenticate to Cloud Storage using OAuth 2.0.
For connections through a proxy, see the Troubleshooting topic for recommended practices.
Encoding URL path partsIn addition to general considerations for bucket naming and object naming, to ensure compatibility across Cloud Storage tools, you should encode the following characters when they appear in either the object name or query string of a request URL:
!
, #
, $
, &
, '
, (
, )
, *
, +
, ,
, /
, :
, ;
, =
, ?
, @
, [
, ]
, and space characters.
For example, if you send a JSON API GET
request for the object named foo??bar
in the bucket example-bucket
, then your request URL should be:
GET https://storage.googleapis.com/storage/v1/b/example-bucket/o/foo%3f%3fbar
Note that not all of the listed characters must be encoded in every scenario. Additionally, encoding is typically handled for you by client libraries, such as the Cloud Storage Client Libraries, so you can pass the raw object name when using such tools.
For more information about using percent-encoding, see Section 3.3 Path in RFC 3986.
Google Cloud console endpointsWhen using the Google Cloud console, you access different resources using the following URLs:
Resource URL Bucket list for a projecthttps://console.cloud.google.com/storage/browser?project=PROJECT_ID
Object list for a bucket https://console.cloud.google.com/storage/browser/BUCKET_NAME
Details for an object https://console.cloud.google.com/storage/browser/_details/BUCKET_NAME/OBJECT_NAME
Data for an object See Authenticated browser downloads gcloud endpoints
gcloud storage
commands use JSON API endpoints. Endpoint usage is managed on your behalf by the gcloud CLI.
Cloud Storage client libraries manage request endpoints automatically. Optionally, you can set the request endpoint manually. This can be useful when you want to use a specific endpoint, or for testing, such as when you want to use a local emulator:
C++For more information, see the Cloud Storage C++ API reference documentation.
To authenticate to Cloud Storage, set up Application Default Credentials. For more information, see Set up authentication for client libraries.
C#For more information, see the Cloud Storage C# API reference documentation.
To authenticate to Cloud Storage, set up Application Default Credentials. For more information, see Set up authentication for client libraries.
GoFor more information, see the Cloud Storage Go API reference documentation.
To authenticate to Cloud Storage, set up Application Default Credentials. For more information, see Set up authentication for client libraries.
JavaFor more information, see the Cloud Storage Java API reference documentation.
To authenticate to Cloud Storage, set up Application Default Credentials. For more information, see Set up authentication for client libraries.
Node.jsFor more information, see the Cloud Storage Node.js API reference documentation.
To authenticate to Cloud Storage, set up Application Default Credentials. For more information, see Set up authentication for client libraries.
PHPFor more information, see the Cloud Storage PHP API reference documentation.
To authenticate to Cloud Storage, set up Application Default Credentials. For more information, see Set up authentication for client libraries.
PythonFor more information, see the Cloud Storage Python API reference documentation.
To authenticate to Cloud Storage, set up Application Default Credentials. For more information, see Set up authentication for client libraries.
RubyFor more information, see the Cloud Storage Ruby API reference documentation.
To authenticate to Cloud Storage, set up Application Default Credentials. For more information, see Set up authentication for client libraries.
Custom domainsIf you own your own domain, you can map its URIs to one or more Google Cloud services, including Cloud Storage buckets. The term bucket-bound hostname is sometimes used to describe this Cloud Storage request endpoint. To connect a custom domain to a Cloud Storage bucket, you create either an A
or CNAME
redirect in your DNS record.
A
records
When connecting a custom domain to a Cloud Storage bucket, you generally should use an A
record.
A
records support HTTPS
requests.A
records can be used to send traffic coming from a single hostname to multiple buckets as well as to other Google Cloud services.A
records do not place any restrictions on your bucket name.The drawback to using A
records is that they require additional setup and use of additional Google Cloud resources. See Setting up your load balancer and SSL certificate for a guide to using custom domains with A
records.
CNAME
records
When connecting a custom domain to a Cloud Storage bucket, you can use a CNAME
record, but note that doing so has certain limitations:
CNAME
records only support HTTP
requests.CNAME
records can only direct traffic from a given hostname to a single bucket.CNAME
records require the hostname and the associated bucket name to match, and you must validate your bucket name.CNAME
records can only be used for subdomains, such as www.mydomain.com
, not top-level domains such as mydomain.com
.When using CNAME
records, the hostname portion of your CNAME
record must be set to the following:
c.storage.googleapis.com.
For example, say your domain is example.com
, and you want to make travel maps available to your customers. You can create a bucket in Cloud Storage called travel-maps.example.com
, and then create a CNAME
record in DNS that redirects requests from travel-maps.example.com
to the Cloud Storage URI. To do this, you publish the following CNAME
record in DNS:
NAME TYPE DATA travel-maps CNAME c.storage.googleapis.com.
By doing this, your customers can use the following URL to access a map of Paris:
http://travel-maps.example.com/paris.jpg
Your domain registration service should have a way for you to administer your domain, including adding a CNAME
resource record. For example, if you use Cloud DNS, instructions for adding resource records can be found on the Add, modify, and delete records page.
Authenticated browser downloads use cookie-based authentication. Cookie-based authentication asks users to sign in to their user account to establish their identity. The specified account must have appropriate permission to download the object. For example, if you are using Identity and Access Management to control access to your objects, the user's account should have the storage.objects.viewer
permission, which is granted in the Storage Object Viewer role.
To download an object using cookie-based authentication, use the following URL, replacing BUCKET_NAME
and OBJECT_NAME
with the appropriate values:
https://storage.cloud.google.com/BUCKET_NAME/OBJECT_NAME
For example, if you shared an image london.jpg
from your bucket example-maps
, the URL would be:
https://storage.cloud.google.com/example-maps/london.jpg
After successfully signing in, you are redirected to the requested content. The URL for this content begins with an alphanumeric sequence and contains the string /download/storage/v1/b/BUCKET_NAME/o/OBJECT_NAME
Using HTTPS is required when performing authenticated browser downloads; attempts to use HTTP redirect to HTTPS.
Access to public objectsAll requests to the storage.cloud.google.com
URI require authentication. This applies even when allUsers
have permission to access an object. If you want users to download anonymously accessible objects without authenticating, use the XML API path-style endpoint:
https://storage.googleapis.com/BUCKET_NAME/OBJECT_NAME
For details and examples, see Accessing Public Data.
Mutual TLS supportMutual TLS (mTLS)is an industry standard protocol for mutual authentication between a client and a server. Cloud Storage supports the following mTLS endpoints:
JSON API requests: storage.mtls.googleapis.com
Authenticated browser downloads: storage.mtls.cloud.google.com
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.5