Get boundary polygon
Returns one boundary as a GeoJSON Feature: its polygon at a chosen detail plus properties (name, kind, admin_level, parents, bbox, area_km2, population, wikidata). The polygon is OpenStreetMap's outline (territorial waters included; for an airport id from search_boundaries or suggest_boundaries, the airport grounds; for tz-… a time zone's area, eez-… an Exclusive Economic Zone, zcta-… a US ZIP code area, cbsa-, csa-, cd-, sd- and cdp-… the U.S. Census Bureau's TIGER/Line polygon, ons-… a UK ward, constituency or census area from the ONS, wof-… a neighbourhood outline from Who's On First), served from our own copy; only a boundary missing from it is fetched from OpenStreetMap the first time anyone asks. admin_level is null where we do not hold OpenStreetMap's level: choose by kind. Costs 1 unit; detail=low is also public without a key (for map previews). include=parents adds the full hierarchy, include=children the direct subdivisions. If the polygon is too big for one response, geometry is null and download_url points to the file.
MCP tool get_boundary · CLI geocode get-boundary · RPC POST /v1/ops/get_boundary
Input
| Field | Type | Description |
|---|---|---|
idpath, required | string | Boundary id: r<OSM relation id> (e.g. r62422 for Berlin), w<way id>, zcta-<code> for a US ZIP code area (e.g. zcta-11249), tz-<zone> for a time zone (e.g. tz-america-new_york) eez-<Marine Regions id> for an Exclusive Economic Zone (e.g. eez-8456), or a US Census area: cbsa-<code> a metro area (cbsa-35620), csa-<code> a combined statistical area, cd-<state FIPS><district> a congressional district (cd-3610 is NY-10), sd-<LEA id> a school district (sd-0622710), cdp-<GEOID> a census-designated place (cdp-1208150); ons-<GSS code> for a UK ward, Westminster constituency or census area (e.g. ons-E05013809); wof-<Who's On First id> for a neighbourhood outline (e.g. wof-85857853). Also accepts R62422, relation/62422, -62422, an openstreetmap.org URL, wikidata:Q64, iso:US-CA, zip:11249, an IANA time zone name (America/New_York) mrgid:8456 a bare GSS code (E05013809) or wof:85857853. |
detailquery | "low" | "medium" | "high" | "full" | Simplification relative to the boundary's size: low (~1,000 points across; the default without a key), medium (the default with a key, ~5,000), high (~25,000), full (unsimplified OSM). |
precisionquery | integer | Coordinate decimals (3–7). Defaults to what the detail level needs. |
includequery | "parents" | "children"[] | Comma-separated extras: parents, children. |
Example request
curl "https://geocodeai.dev/v1/boundaries/r62422?detail=low&include=parents" \
-H "Authorization: Bearer $GEOCODE_API_KEY"Example response
Errors
Failures are RFC 9457 problems. Common ones here: 400 invalid_input, 402 quota_exceeded, 429 rate_limited.