API reference
The API is served from https://api.maprouter.ai. Everything below is live today. New to it? Start with the quickstart.
Authentication
Pass your key as a bearer token on every authenticated request. Keys look like mr_live_… and are shown once, at issue time — we store only a hash, so a lost key must be replaced rather than recovered.
curl https://api.maprouter.ai/v1/me \
-H "Authorization: Bearer mr_live_..."Treat the key as a secret. It carries your credit balance, so anything holding it can spend it. Keep it server-side and out of version control.
Endpoints
| Method | Path | Key | Description |
|---|---|---|---|
GET | / | — | Service descriptor. |
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 | Authoritative remaining credit. |
GET | /v1/collections | Required | Every collection available to your key. |
GET | /v1/collections/{id} | Required | Collection metadata in 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. Billed per request. |
Querying features
A bounding box is min_lon,min_lat,max_lon,max_lat. The response is a standard GeoJSON FeatureCollection, so any client that reads GeoJSON can consume it directly.
curl "https://api.maprouter.ai/v1/collections/texas_counties/items\
?bbox=-97.75,30.25,-97.70,30.30" \
-H "Authorization: Bearer mr_live_..."Errors
Errors return a JSON body shaped as { "error": { "type", "message" } }. Branch on type rather than the message text.
| Status | Type | Cause |
|---|---|---|
401 | missing_api_key | No Authorization header, or it is malformed. |
401 | invalid_api_key | The key is not recognised. |
402 | insufficient_credits | Your prepaid balance has reached zero. |
429 | rate_limited | Over the requests-per-minute limit for your key. |
503 | auth_unavailable | Authentication is temporarily unreachable. Retry. |
In development
Not yet available, listed so you can plan around them: the OGC API - Features landing page and /conformance document, single-feature retrieval, PMTiles vector tile serving, and STAC search. Tell us which you need and it moves up the order.