API reference
The API is served from https://api.maprouter.ai. Responses are GeoJSON, so standard clients — QGIS, geopandas, MapLibre — read them without an SDK.
Authentication
Pass your key as a bearer token. Keys look like mr_live_… and are shown once at issue time; we store only a hash, so a lost key is replaced rather than recovered. Email us to get one.
export MAPROUTER_KEY="mr_live_..."
curl https://api.maprouter.ai/v1/me \
-H "Authorization: Bearer $MAPROUTER_KEY"Endpoints
| Method | Path | Key | Description |
|---|---|---|---|
GET | /v1/health | — | Status and the edge location serving you. |
GET | /v1/me | Required | Key metadata — user, balance snapshot, rate limit. |
GET | /v1/credits | Required | Remaining credit. |
GET | /v1/collections | Required | Collections available to your key. |
GET | /v1/collections/{id} | Required | Collection metadata, OGC API - Features shape. |
GET | /v1/collections/{id}/items?bbox= | Required | Features intersecting a bounding box, as GeoJSON. |
POST | /v1/spatial/isochrone | Required | Travel-time contours from a point. |
Querying features
A bounding box is min_lon,min_lat,max_lon,max_lat.
curl "https://api.maprouter.ai/v1/collections/texas_counties/items\
?bbox=-97.75,30.25,-97.70,30.30" \
-H "Authorization: Bearer $MAPROUTER_KEY"Errors
Errors return { "error": { "type", "message" } }. Branch on type, not the message.
| Status | Type | Cause |
|---|---|---|
401 | missing_api_key | No Authorization header, or malformed. |
401 | invalid_api_key | Key not recognised. |
402 | insufficient_credits | Balance has reached zero. |
429 | rate_limited | Over the rate limit for your key. |
503 | auth_unavailable | Authentication temporarily unreachable. Retry. |