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) or w<way id>. Also accepts R62422, relation/62422, -62422, an openstreetmap.org URL, wikidata:Q64 or iso:US-CA. |
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://geo-coder-service.vercel.app/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.