Some data stored in Cloud Storage is configured so that it's readable by anyone at any time. This public data can be accessed in several ways, depending on how you want to work with the data.
API Link
Get the name of the public object and the bucket that stores the object.
Use the following URI to access an object in the bucket:
https://storage.googleapis.com/BUCKET_NAME/OBJECT_NAME
For example, the Google public bucket gcp-public-data-landsat
contains
the Landsat public dataset. You can link to the publicly shared object
LC08/01/001/003/LC08_L1GT_001003_20140812_20170420_01_T2/LC08_L1GT_001003_20140812_20170420_01_T2_B3.TIF
with the link:
https://storage.googleapis.com/gcp-public-data-landsat/LC08/01/001/003/LC08_L1GT_001003_20140812_20170420_01_T2/LC08_L1GT_001003_20140812_20170420_01_T2_B3.TIF
Console
Get the name of the public object and the bucket that stores the object.
Using a web browser, access the object with the following URI (you will be asked to sign in if you are not currently signed in):
https://console.cloud.google.com/storage/browser/_details/BUCKET_NAME/OBJECT_NAME
If the public has permission to list the bucket's contents, you can list all the objects in the bucket with the following URI:
https://console.cloud.google.com/storage/browser/BUCKET_NAME
For example, the Google public bucket gcp-public-data-landsat
contains
the Landsat public dataset. You can access the bucket with:
https://console.cloud.google.com/storage/browser/gcp-public-data-landsat
Command line
gcloud
If you don't have the gcloud CLI, follow these instructions to install it.
Get the name of the public object and the bucket that stores the object.
If permission to list the bucket's contents is granted to the public, you can list some or all of the objects contained in the bucket by using the
ls
command.For example, the Google public bucket
gcp-public-data-landsat
contains the Landsat public dataset. You can list objects with the prefixLC08/01/001/003/LC
with the following command:gcloud alpha storage ls --recursive gs://gcp-public-data-landsat/LC08/01/001/003/LC*
Download specific public objects contained in the bucket by using the
cp
command.For example, the following command downloads a file from the bucket
gcp-public-data-landsat
to your local directory:gcloud alpha storage cp gs://gcp-public-data-landsat/LC08/01/001/003/LC08_L1GT_001003_20140812_20170420_01_T2/LC08_L1GT_001003_20140812_20170420_01_T2_B3.TIF .
gsutil
If you don't have gsutil, follow these instructions to install it.
Get the name of the public object and the bucket that stores the object.
If permission to list the bucket's contents is granted to the public, you can list some or all of the objects contained in the bucket by using the
ls
command.For example, the Google public bucket
gcp-public-data-landsat
contains the Landsat public dataset. You can list objects with the prefixLC08/01/001/003/LC
with the following command:gsutil ls -r gs://gcp-public-data-landsat/LC08/01/001/003/LC*
Download specific public objects contained in the bucket by using the
cp
command.For example, the following command downloads a file from the bucket
gcp-public-data-landsat
to your local directory:gsutil cp gs://gcp-public-data-landsat/LC08/01/001/003/LC08_L1GT_001003_20140812_20170420_01_T2/LC08_L1GT_001003_20140812_20170420_01_T2_B3.TIF .
Code samples
For more information, see the
Cloud Storage C++ API reference documentation.
For more information, see the
Cloud Storage C# API reference documentation.
For more information, see the
Cloud Storage Go API reference documentation.
For more information, see the
Cloud Storage Java API reference documentation.
For more information, see the
Cloud Storage Node.js API reference documentation.
For more information, see the
Cloud Storage Python API reference documentation.
For more information, see the
Cloud Storage Ruby API reference documentation.
C++
C#
Go
Java
Node.js
Python
Ruby
What's next
- Learn how to publicly share an object.
- Learn about options to control access to your data.
- Control access to your data using IAM permissions.
- Download objects from a bucket.