Maps Datasets API quick reference

The Maps Datasets API is a REST API for creating and managing datasets: containers for your own geospatial data (uploaded as CSV, GeoJSON, or KML from a local file or Google Cloud Storage) that you use with data-driven styling in Google Maps Platform apps. There's no charge for using the API, but the project needs a billing account.

Maps Datasets API: key facts

  • Product: Maps Datasets API
  • Also known as: Maps Datasets
  • Category: Maps
  • Platform: Web service (REST)
  • Runs on: Server (backend code)
  • Launch stage: GA
  • Lifecycle: Active
  • Overview: Maps Datasets API overview

Maps Datasets API: when to use it

Use Maps Datasets API when:

  • You need to upload your own point, polyline, or polygon data (CSV, GeoJSON, or KML) to use with data-driven styling for datasets.
  • You need to create, list, get, update, download, or delete datasets in a Google Cloud project with a REST API or the Node.js or Python client library.
  • You need to upload a new version of an existing dataset's data, or get the errors from a failed upload (fetchDatasetErrors).
  • You're moving KML Layer content to data-driven styling for datasets.

Don't use Maps Datasets API when:

  • You also need to display and style dataset features on a web map. Datasets API manages Cloud storage and upload; map rendering uses Maps JavaScript API. Use Maps JavaScript API instead.
  • You also need to display and style dataset features in an Android app. Datasets API manages Cloud storage and upload; rendering uses Maps SDK for Android. Use Maps SDK for Android instead.
  • You also need to display and style dataset features in an iOS app. Datasets API manages Cloud storage and upload; map rendering uses Maps SDK for iOS. Use Maps SDK for iOS instead.

Maps Datasets API: setup

Official Maps Datasets API packages:

  • npm: @googlemaps/maps-platform-datasets
  • pypi: google-maps-mapsplatformdatasets

Maps Datasets API: common mistakes

  • Problem: Data upload is asynchronous. A successful upload call doesn't mean the data is ready or valid. Fix: Poll the dataset with Get a dataset until state is STATE_COMPLETED, or check for an error state, and call fetchDatasetErrors for failed uploads. See /maps/documentation/datasets/create.
  • Problem: Uploads can take minutes or hours. Deleting a dataset before the upload operation returns causes problems. Fix: Wait for the upload operation to return a response before you delete the dataset. See /maps/documentation/datasets/prerequisites.
  • Problem: Map tiles built from uploaded data can drop or simplify dense or complex features at low zoom levels (about 5-12), so the data looks different than when zoomed in. Fix: Minimize feature properties and simplify the data. Expect simplified rendering at low zoom levels. See /maps/documentation/datasets/prerequisites.
  • Problem: Requests need an OAuth token in the Authorization header. API keys aren't supported (the API returns 401 UNAUTHENTICATED: "API keys are not supported by this API"). Fix: Send a Bearer OAuth token with the https://www.googleapis.com/auth/cloud-platform scope. See /maps/documentation/datasets/cloud-setup.
  • Problem: Requests made with user OAuth credentials need the billing and quota project in the X-Goog-User-Project header. Fix: Send your Google Cloud project number or ID in the X-Goog-User-Project header (you can omit it when authenticating with a service account). See /maps/documentation/datasets/request.

Maps Datasets API: legacy and deprecated features

  • v1alpha endpoints (https://mapsplatformdatasets.googleapis.com/v1alpha/projects...): Decommissioned since 2024-05-28. Replacement: v1 endpoints (https://mapsplatformdatasets.googleapis.com/v1/projects...). Symptom: Calls to /v1alpha endpoint URLs fail because those endpoints were removed.

What you can do with Maps Datasets API

See the guides linked below for each task, or compare across products in the Capabilities Explorer.