GET /v1/places/{placeId}/geometry
A place's outline, simplified for a map zoom.
| Access | |
|---|---|
| Keys | publishable or secret |
| Plan | Premium |
| Environment | live and sandbox |
| Acts for | the account |
| While the account is suspended | refused |
| During a data stop | works |
Path
| Name | Type | Description |
|---|---|---|
placeId |
string | Required. The place's ID, "pl_…", from autocomplete, from a listing's places, or from GET /v1/places/containing. |
Query
| Name | Type | Description |
|---|---|---|
zoom |
integer | Required. The map zoom the outline will be drawn at. Below 0 is read as 0, above 22 as 22. |
Answers
200: The outline
The answer is { data, meta }; meta holds requestId and environment.
data:
| Field | Type | Description |
|---|---|---|
placeId |
string | |
kind |
state, county, city, municipality, cdp, community, zcta, postal_city, subdivision, school_district |
|
zoom |
integer | The zoom that was used, from 0 to 22. |
tier |
display_lo, display_mid, display_hi |
Which of the three versions was served: zoom 9 or less, 10 to 12, 13 or more. |
approximate |
boolean | |
vertices |
integer | How many corners the outline has: at most 5,000. |
geometry |
object | A GeoJSON MultiPolygon. Coordinates are [longitude, latitude]. |
geometry.type |
MultiPolygon |
|
geometry.coordinates |
list of any | |
source |
string | Where the outline comes from: the place's own source. |
attribution |
string or null |
Header Outline-Quota-Limit: Outlines a key may be served in a UTC day: 5000.
Header Outline-Quota-Remaining: Outlines left today.
Header Outline-Quota-Reset: Seconds until 00:00 UTC.
Errors
Every error has the same body, and says how to fix it (responses and errors).
More
Premium only (403 tier_insufficient with capability: "shapes" on Basic). The place's
outline, simplified for the map zoom it will be drawn at:
{
"data": {
"placeId": "pl_…",
"kind": "county",
"zoom": 11,
"tier": "display_mid",
"approximate": false,
"vertices": 412,
"geometry": { "type": "MultiPolygon", "coordinates": [[[[-75.3501, 40.0012], [-75.3498, 40.0021], [-75.3501, 40.0012]]]] },
"source": "census_tiger",
"attribution": null
},
"meta": { "requestId": "req_…", "environment": "live" }
}
zoomis required: a whole number, read as 0 below 0 and as 22 above 22 (the answer carries the value used). Without it, or with anything else,400 validation_failed.- The zoom picks one of three versions of the outline:
display_loat zoom 9 or less,display_midat 10 to 12,display_hiat 13 or more. Coordinates have 4 decimals at low and mid zoom and 5 at high zoom. There is no full-precision option. geometryis a GeoJSONMultiPolygonof at most 5,000 corners.verticesis its corner count: every position except each ring's closing repeat.tiernames the version served. If the version for the zoom isn't available for a place, the next coarser one is served and named; never a finer one.approximateis true for an outline put together from other shapes, such as a postal city's (the ZIP areas it is the preferred city of).404 not_foundfor an ID that doesn't exist, a retired place, and a place that has no outline: a community (a point, searched within its radius), a subdivision (matched by the name each listing carries) and a postal city no ZIP area could be found for. The message says which;location.placeIdsstill searches all three.- A school district's outline is served like any other place's.
- Limits: 60 outlines in any 60 seconds and 5,000 a UTC day, per key. See rate limits for the headers every outline answer carries.
This page is made from the route's own declaration by npm run openapi. To change it, change the declaration or its explanation, never this file.