Points in boundary
POST /v1/boundaries/{id}/contains1 unit per 1,000 points (up to 10,000 per call)Read-only
Tests up to 10,000 points ([lon, lat] pairs) against one boundary and returns a boolean per point plus the inside count. Use it for geofencing, service-area checks and filtering customer lists. Costs 1 unit per 1,000 points.
MCP tool contains_points · CLI geocode contains-points · RPC POST /v1/ops/contains_points
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. |
pointsbody, required | array of [lon, lat] | Points as [lon, lat] (GeoJSON order). |
Example request
curl -X POST "https://geocodeai.dev/v1/boundaries/r62422/contains" \
-H "Authorization: Bearer $GEOCODE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"points":[[13.405,52.52],[2.35,48.86]]}'Example response
Errors
Failures are RFC 9457 problems. Common ones here: 400 invalid_input, 401 unauthorized, 402 quota_exceeded, 429 rate_limited.