Choosing a project
The Earth Engine API must be enabled on all projects before requests will succeed. This is done automatically when you create a project in the Code Editor. You can manually enable the Earth Engine API in the Cloud console for whatever project you plan to use. You must also have sufficient permission to use the project or its assets. Specifically, you need to have the Service Usage Consumer role to route computations through a project and an Earth Engine role to access project assets. See this page for more information about setting permissions to use Earth Engine and this guide for information about setting up a Cloud Project for use with Earth Engine.
You can toggle the project through which the Code Editor makes calls from your login in the upper right of the Code Editor. When no project is selected here, calls are made through a project owned by Earth Engine.
Calls from the Earth Engine Python client
can be associated with a project by passing a project ID to
be sure that the service account is registered to use Earth Engine as described on
this page and has been given
project-level permissions to use the Earth Engine service as described
For example, follow these
instructions to create a service account and private key file named
.private-key.json, then run:
import ee service_account = 'my-service-account@...gserviceaccount.com' credentials = ee.ServiceAccountCredentials(service_account, '.private-key.json') ee.Initialize(credentials=credentials, project='my-project')
To associate calls to the REST API with a Cloud Project, issue authenticated HTTP calls
where authentication is handled by
In a local environment, you can use the
command. You can also use a Service Account associated with a Cloud Project. See the
Quickstart for an example of using
authenticate with a service account.
To associate Earth Engine calls from the command line with a Cloud Project, use the
--project parameter in your call to
earthengine or use
earthengine set_project my-project