> Documentation index: https://developers.google.com/maps/documentation/llms.txt

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](https://developers.google.com/maps/documentation/datasets/overview.md.txt)

## 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](https://developers.google.com/maps/documentation/javascript/quick-reference.md.txt) 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](https://developers.google.com/maps/documentation/android-sdk/quick-reference.md.txt) 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](https://developers.google.com/maps/documentation/ios-sdk/quick-reference.md.txt) instead.

## Maps Datasets API: setup

- **Service to enable:** `mapsplatformdatasets.googleapis.com`
- **Authentication:** OAuth 2.0, Service account (API keys, including Maps Demo Keys, aren't supported)
- **Get started:** [Set up Maps Datasets API](https://developers.google.com/maps/documentation/datasets/cloud-setup.md.txt)
- **Reference:** [Maps Datasets API reference](https://developers.google.com/maps/documentation/datasets/reference/rest.md.txt)
- **Policies:** [Maps Datasets API policies](https://developers.google.com/maps/documentation/datasets/policies.md.txt)
- **Release notes:** [Maps Datasets API release notes](https://developers.google.com/maps/documentation/datasets/release-notes.md.txt)

**Official Maps Datasets API packages:**

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

## Maps Datasets API: related products

- **Often used with:** [Maps JavaScript API](https://developers.google.com/maps/documentation/javascript/quick-reference.md.txt), [Maps SDK for Android](https://developers.google.com/maps/documentation/android-sdk/quick-reference.md.txt), [Maps SDK for iOS](https://developers.google.com/maps/documentation/ios-sdk/quick-reference.md.txt)

## 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](https://developers.google.com/maps/documentation/datasets/create.md.txt).
- **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](https://developers.google.com/maps/documentation/datasets/prerequisites.md.txt).
- **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](https://developers.google.com/maps/documentation/datasets/prerequisites.md.txt).
- **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](https://developers.google.com/maps/documentation/datasets/cloud-setup.md.txt).
- **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](https://developers.google.com/maps/documentation/datasets/request.md.txt).

## 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](https://developers.google.com/maps/documentation/capabilities-explorer.md.txt).

- [Create a custom dataset for maps stying and visualizations.](https://developers.google.com/maps/documentation/datasets/create.md.txt#create_the_dataset)
- [Upload CSV data to a custom dataset.](https://developers.google.com/maps/documentation/datasets/create.md.txt#upload_data_to_the_dataset)
- [Upload GeoJSON data to a custom dataset.](https://developers.google.com/maps/documentation/datasets/create.md.txt#upload_data_to_the_dataset)
- [Upload KML data to a custom dataset.](https://developers.google.com/maps/documentation/datasets/create.md.txt#upload_data_to_the_dataset)
- [Return a list of all custom datasets.](https://developers.google.com/maps/documentation/datasets/get.md.txt#list_all_datasets)
- [Return metadata for a custom dataset.](https://developers.google.com/maps/documentation/datasets/get.md.txt#get_information_about_a_dataset)
- [Return data from a custom dataset.](https://developers.google.com/maps/documentation/datasets/get.md.txt#download_a_dataset)