Required request parameters

  • All Maps Datasets API requests require a Google Cloud project number or ID for billing and usage quota, specified in theX-Goog-User-Project header or using a service account.

  • An OAuth token is necessary for authentication and should be included in theAuthorization header of each request.

  • The request URL must contain the Google Cloud project number or ID and the dataset ID to specify the location of the dataset.

  • Additional parameters may be required for certain requests, as detailed in the specific request documentation.

  • You can obtain your Google Cloud project number or ID from the project's Overview page in the Cloud Console and generate an OAuth token using thegcloud command.

To make any request to Maps Datasets API, you must include:

Note: Some requests require additional parameters that are described in thedocumentation on those requests.

For example, to delete a dataset:

curl -X DELETE \-H 'X-Goog-User-Project:PROJECT_NUMBER_OR_ID' \-H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \https://mapsplatformdatasets.googleapis.com/v1/projects/PROJECT_NUMBER_OR_ID/datasets/DATASET_ID

Get the project number

To get thePROJECT_NUMBER_OR_ID of your Google Cloud project:

  1. Go to the project'sOverview page in the Cloud console.

  2. If prompted, select your project.

  3. TheProject number andProject ID appear in theProject infoarea of the overview screen.

Get an OAuth token

Note: The procedure below to generate an OAuth token is not intended for use ina production environment. Use this procedure for a development or testingenvironment only.

For authentication, your API request must contain an OAuth token in theAuthorization header. For more, seeUse OAuth.

For example, use the followinggcloud command to generate the token:

gcloud auth application-default print-access-token

You can include thegcloud command directly in theAuthorization header in acURL command to generate a new token on each request, as shown in the exampleabove.

Alternatively, you can set an environment variable containing the token and thenpass the environment variable as part of the request:

export TOKEN=$(gcloud auth application-default print-access-token)curl -X DELETE \-H 'X-Goog-User-Project:PROJECT_NUMBER_OR_ID' \-H "Authorization: Bearer $TOKEN" \https://mapsplatformdatasets.googleapis.com/v1/projects/PROJECT_NUMBER_OR_ID/datasets/DATASET_ID

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-11-21 UTC.