Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Is that skill safe to install?
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
Are you the author of Google Maps Platform?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ashish7802-google-maps-platform)
# Google Maps Platform (Places New v1 & Routes v1) Skill
> **Verification Tier:** `code_example_tested` | **Last Verified:** 2026-11-18
> **Official Docs:** https://developers.google.com/maps/documentation/places/web-service/overview
## Overview
Modern Google Maps server integrations use **Places API (New)** (`https://places.googleapis.com/v1/places:searchText`) and **Routes API v2** (`https://routes.googleapis.com/directions/v2:computeRoutes`) instead of legacy Directions/Places endpoints.
## Authentication
Pass your API key in the `X-Goog-Api-Key` request header (not in URL query strings, which leak into access logs). Restrict server keys by IP address and enabled APIs in Google Cloud Console, and restrict browser keys by HTTP referrer.
```ts
const res = await fetch('https://places.googleapis.com/v1/places:searchText', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Goog-Api-Key': process.env.GOOGLE_MAPS_API_KEY!,
'X-Goog-FieldMask': 'places.id,places.displayName,places.formattedAddress',
},
body: JSON.stringify({ textQuery: 'specialty coffee San Francisco', pageSize: 5 }),
});
```
## Core Concepts
- **Mandatory `X-Goog-FieldMask` Header**: Both Places (New) and Routes APIs **require** `X-Goog-FieldMask`. Requests without it fail with `400 INVALID_ARGUMENT`.
- **SKU Billing Control**: Google bills per-request according to the highest SKU tier among the fields requested in `X-Goog-FieldMask`. Passing `X-Goog-FieldMask: *` returns every field and triggers the most expensive Enterprise + Atmosphere SKU tier—**never use wildcard `*` in production**.
- **Session Tokens**: For Place Autocomplete, generate a UUID `sessionToken` per typing session and pass the same token to Place Details to group billing accurately.
## Error Handling & Rate Limits
- Handle HTTP `429 RESOURCE_EXHAUSTED` with exponential backoff and cache immutable geocoding/place metadata only within Google Maps Platform Terms of Service limits (Place IDs may be stored indefinitely; lat/lng and other attributes have strict caching rules).
## Security Best Practices
- Use separate API keys for frontend JS Maps (HTTP-referrer restricted) and backend Places/Routes calls (IP restricted, stored in server env vars).
- Set daily quota caps and Cloud Billing budget alerts to prevent runaway map spend.
## AI Pitfalls
- Omitting `X-Goog-FieldMask` or using `X-Goog-FieldMask: *` in production (causes `400` errors or unexpected 3–5x SKU charges).
- Calling legacy `maps.googleapis.com/maps/api/place/textsearch/json` endpoints on newly created GCP projects where legacy APIs are disabled.
- Passing API keys in query strings (`?key=...`) instead of `X-Goog-Api-Key` headers.
## Production Checklist
- [ ] `X-Goog-Api-Key` sent via header with API + IP/referrer restrictions
- [ ] Minimal explicit `X-Goog-FieldMask` specified on every Places/Routes request (no `*`)
- [ ] Autocomplete flows attach a per-session UUID `sessionToken`
- [ ] Cloud Billing budget alert and per-API quota cap configured
## References
- [Places API (New) Overview](https://developers.google.com/maps/documentation/places/web-service/overview)
- [Routes API Compute Routes](https://developers.google.com/maps/documentation/routes/compute_route_directions)
## Related skills
- [`mapbox`](../mapbox/SKILL.md) — alternative to
- [`google-cloud-run`](../google-cloud-run/SKILL.md) — works well with
- [`nextjs`](../nextjs/SKILL.md) — integrates with