Export boundary file
GET /v1/boundaries/{id}.{format}1 unitRead-only
Builds a boundary's polygon as a file (geojson, kml, wkt, svg or gml) at a detail level and returns a permanent public URL on our CDN; the REST route redirects straight to it. Use it for large polygons, GIS tools and bulk downloads. Costs 1 unit; each file is built once and then shared.
MCP tool export_boundary · CLI geocode export-boundary · RPC POST /v1/ops/export_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. |
formatpath, required | "geojson" | "kml" | "wkt" | "svg" | "gml" | geojson (a Feature), kml, wkt, svg or gml. Default "geojson". |
detailquery | "low" | "medium" | "high" | "full" | Simplification relative to the boundary's size: low (~1,000 points across, maps and previews), medium (default, ~5,000), high (~25,000), full (unsimplified OSM). Default "medium". |
Example request
curl "https://geocodeai.dev/v1/boundaries/r62422.kml?detail=medium" \
-H "Authorization: Bearer $GEOCODE_API_KEY"Example response
See the description above for what this returns.
Errors
Failures are RFC 9457 problems. Common ones here: 400 invalid_input, 401 unauthorized, 402 quota_exceeded, 429 rate_limited.