Google Maps Platform APIs
Search places, geocode, compute routes and matrices, validate addresses, and get weather, air quality, time zones and static maps.
Maps & locationGuided#maps#places#geocoding#routes#address-validation#weather#google
Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.
Overview
Google Maps Platform's web services give your server or app place search, geocoding, routing, address validation, environmental data and map images over plain HTTPS. This collection covers the current products and points out the ones Google has moved to Legacy.
Current products in this collection
| Product | Base URL | Key goes in |
|---|---|---|
| Places API (New) | places.googleapis.com/v1 | X-Goog-Api-Key header (photo media: key query) |
| Routes API | routes.googleapis.com | X-Goog-Api-Key header |
| Geocoding API | maps.googleapis.com/maps/api/geocode/json | key query parameter |
| Address Validation API | addressvalidation.googleapis.com/v1 | key query parameter |
| Air Quality, Pollen, Weather APIs | airquality / pollen / weather.googleapis.com/v1 | key query parameter |
| Time Zone, Elevation, Static Maps | maps.googleapis.com/maps/api/... | key query parameter |
| Roads API (snap to roads) | roads.googleapis.com/v1 | key query parameter |
Auth is set per folder, so you only fill in apiKey once.
Legacy (since 1 March 2025)
The Places API (legacy, maps/api/place/...) is replaced by Places API (New); the Directions API and Distance Matrix API are replaced by the Routes API. Legacy services keep working for projects that already use them but get no new features, and new projects should not start on them. Google promises at least 12 months' notice before shutting them down. See Legacy products.
Set up
- In the Google Cloud console create a project and link a billing account: Maps Platform calls fail without billing, even within the free usage.
- Enable each API you will call (Places API (New), Routes API, Geocoding API, Address Validation API, Air Quality API, Pollen API, Weather API, Time Zone API, Elevation API, Roads API, Maps Static API).
- Keys & Credentials > Create credentials > API key, then restrict it:
- Application restriction (one per key): IP addresses for server-side keys, which is what web services should use; HTTP referrers only for browser-side use such as Static Maps on a web page; Android or iOS app restrictions for mobile.
- API restrictions: allow only the APIs this key needs.
- Use separate keys per app or environment, keep server keys out of client code, and delete unused keys.
- Paste the key into
apiKey. Optionally set quota caps and budget alerts in the console.
Field masks and pricing
Places API (New) and Routes API require a field mask (X-Goog-FieldMask): the list of response fields you want. It also selects the SKU you are billed for (Essentials, Pro, Enterprise, Enterprise + Atmosphere), and the most expensive field in the mask sets the price. Each SKU includes some free monthly usage and is billed beyond that. Current prices and free caps: pricing.
How to use this collection
Fill in apiKey, then run folder 1 (Text Search saves placeId and photoName), and any other folder in any order. lat and lng default to central London; change them for your area.
Common errors
| Response | Meaning | Fix |
|---|---|---|
403 PERMISSION_DENIED / REQUEST_DENIED | API not enabled, key restriction blocks the call, or billing off | enable the API, check the key restrictions and billing |
400 INVALID_ARGUMENT | missing or wrong field mask, bad body | read error.message |
OVER_DAILY_LIMIT | invalid key, no billing, or your own quota cap | fix the key or billing |
429 / OVER_QUERY_LIMIT | per-minute quota | back off and retry |
ZERO_RESULTS | nothing found | widen the query |
Links
Endpoints 22
1. Places API (New)
- POSTText Search
{{placesUrl}}/places:searchTextFinds places from a free-text query such as "coffee near Westminster" or an address. Field mask here:… - POSTNearby Search
{{placesUrl}}/places:searchNearbyLists places of given types within a circle, for example cafes and bakeries within 1 km. Field mask here: names, addresses, location and primary type: Nearby… - GETPlace Details
{{placesUrl}}/places/{{placeId}}Reads the details of one place by its ID (placeId, saved by Text Search). Field mask: names without the places. prefix. Here… - POSTAutocomplete
{{placesUrl}}/places:autocompleteReturns predictions while the user types, for a search box or address form. Billing: a session token groups the keystrokes and the final Place Details call… - GETPlace Details (end of an autocomplete session)
{{placesUrl}}/places/{{placeId}}The same Place Details call, now with the autocomplete sessionToken, so the predictions and this lookup are billed as one session. When: after the user picks… - GETPlace Photo
{{placesUrl}}/{{photoName}}/mediaGets a photo of a place from the photoName saved by Text Search (places.photos in the mask; up to 10 photos per place). Rules: photo names expire, so do not…
2. Geocoding API
- GETGeocode an address
{{mapsUrl}}/geocode/jsonTurns an address into coordinates and a place ID. What comes back: results[] with formatted_address, address_components, geometry.location (lat, lng),… - GETReverse geocode coordinates
{{mapsUrl}}/geocode/jsonTurns coordinates into addresses (most specific first). The two filters are applied after the search; if nothing matches both, the status is ZERO_RESULTS.… - GETGeocode a place ID
{{mapsUrl}}/geocode/jsonReturns the address and coordinates for a place ID (placeId, from Places or an earlier geocode). Query: place_id plus the optional language. This is cheaper…
3. Routes API
- POSTCompute a route with traffic
{{routesUrl}}/directions/v2:computeRoutesComputes a driving route between two points using live traffic. Field mask here:… - POSTCompute a route with stops (legs)
{{routesUrl}}/directions/v2:computeRoutesA route through intermediate stops, with per-leg distance and time, for delivery runs or itineraries. Body: intermediates[] (each a waypoint; via: true makes… - POSTCompute a route matrix
{{routesUrl}}/distanceMatrix/v2:computeRouteMatrixComputes distance and time from every origin to every destination, for "nearest store" or dispatch decisions. Body: origins[] and destinations[], each {…
4. Address Validation API
- POSTValidate an address
{{addressValidationUrl}}:validateAddressValidates one address. What comes back: result.verdict (inputGranularity, validationGranularity such as PREMISE or ROUTE, geocodeGranularity, addressComplete,… - POSTSend validation feedback
{{addressValidationUrl}}:provideValidationFeedbackTells Google which version of the address was finally used, after the user saw the suggestion. Send it once at the end of each validation flow; it helps…
5. Air Quality, Pollen and Weather
- POSTAir quality: current conditions
https://airquality.googleapis.com/v1/currentConditions:lookupCurrent air quality at a point. Body: location (latitude, longitude), universalAqi (default true), extraComputations (any of HEALTH_RECOMMENDATIONS,… - GETPollen forecast
https://pollen.googleapis.com/v1/forecast:lookupDaily pollen forecast for up to 5 days. Query: location.latitude, location.longitude, days (1-5), languageCode, plantsDescription (false to drop plant… - GETWeather: current conditions
https://weather.googleapis.com/v1/currentConditions:lookupCurrent weather at a point. Query: location.latitude, location.longitude, unitsSystem (METRIC default, or IMPERIAL), languageCode. What comes back:… - GETWeather: daily forecast
https://weather.googleapis.com/v1/forecast/days:lookupDaily forecast, up to 10 days. Query: location.latitude, location.longitude, days (number of days, up to 10), pageSize (days per page, default 5) and…
6. Time Zone, Elevation, Roads and Static Maps
- GETTime zone at a location
{{mapsUrl}}/timezone/jsonReturns the time zone and UTC offsets for a point at a given moment. Query: location (lat,lng), timestamp (seconds since 1970 UTC; decides whether daylight… - GETElevation of points
{{mapsUrl}}/elevation/jsonReturns ground elevation (metres above sea level) for points. Query: locations: one or more lat,lng pairs separated by | (or an enc: encoded polyline), up to… - GETSnap GPS points to roads
https://roads.googleapis.com/v1/snapToRoadsSnaps a noisy GPS trace to the roads most likely travelled (Roads API, roads.googleapis.com). Query: path: up to 100 lat,lng points separated by |, ideally… - GETStatic map image
{{mapsUrl}}/staticmapReturns a map image for an <img> tag: no JavaScript needed. Signatures: Google recommends adding a digital signature (made on your server with the signing…
API details
- Base URL
https://places.googleapis.com/v1https://routes.googleapis.comhttps://maps.googleapis.com/maps/apihttps://addressvalidation.googleapis.com/v1- Authentication
- An API key in the X-Goog-Api-Key header
An API key in the key query parameter - Operations
- 22 operations on 22 pathsGET 13POST 9
- Main resources
- 1. Places API (New) 62. Geocoding API 33. Routes API 34. Address Validation API 25. Air Quality, Pollen and Weather 46. Time Zone, Elevation, Roads and Static Maps 4
- Description format
- Swastik Codes guided collection, API version
checked against the docs on 2026-11-17 - Links
- Documentation
How to test the Google Maps Platform APIs in Swastik Codes
- Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
- Fork it into your workspaceChoose a workspace. You get your own copy of the Google Maps Platform APIs collection, without the publisher's secrets.
- Add your credentialsThis API uses an API key in the X-Goog-Api-Key header. Add yours in the collection's variables or an environment; the requests already reference it.
- Send a requestPick an endpoint, for example “Text Search” (POST {{placesUrl}}/places:searchText), and press Send. Check the response, add tests and run the whole collection with the runner.
Frequently asked questions
What is the Google Maps Platform APIs?
Search places, geocode, compute routes and matrices, validate addresses, and get weather, air quality, time zones and static maps. It is listed under Maps & location and has 22 endpoints.
Who publishes the Google Maps Platform APIs?
It is listed from Google's public API description (an OpenAPI document), not published by Google on Swastik Codes. Anyone who controls googleapis.com can claim the profile by adding a DNS TXT record.
What is the base URL of the Google Maps Platform APIs?
Its description lists 4 base URLs: https://places.googleapis.com/v1, https://routes.googleapis.com, https://maps.googleapis.com/maps/api, https://addressvalidation.googleapis.com/v1. The first is the usual one; the others are typically sandbox or regional servers.
How do I authenticate with the Google Maps Platform APIs?
It accepts 2 methods: an API key in the X-Goog-Api-Key header; an API key in the key query parameter.
How many endpoints does the Google Maps Platform APIs have?
22 operations on 22 paths (13 GET, 9 POST). The largest groups are 1. Places API (New), 2. Geocoding API, 3. Routes API, 4. Address Validation API.
Is forking the Google Maps Platform APIs free?
Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.