Get boundary polygon
GET /v1/boundaries/{id}1 unitNo key at detail=lowRead-only
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). Fetched from OpenStreetMap the first time anyone asks, then served from cache. 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) or w<way id>. Also accepts R62422, relation/62422, -62422, an openstreetmap.org URL, wikidata:Q64 or iso:US-CA. |
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://geo-coder-service.vercel.app/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.