agentleFS
Ghost7802Ghost7802/awesome-api-skills/skills/google-maps-platform/SKILL.md

google-maps-platform

Skill13 starsChanged 26 days agoMITView on GitHub

Verification Tier: code_example_tested | Last Verified: 2026-11-18 Official Docs: https://developers.google.com/maps/documentation/places/web-service/overview

  • Reads credentials
  • Sends data out

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use separate API keys for frontend JS Maps (HTTP-referrer restricted) and backend Places/Routes calls (IP restricted, stored in server env …

    line 33

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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.

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

Related skills

  • mapbox — alternative to
  • google-cloud-run — works well with
  • nextjs — integrates with

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.