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

MethodPathKeyDescription
GET/Service descriptor.
GET/v1/healthStatus and the edge location serving you.
GET/v1/meRequiredKey metadata — user, balance snapshot, rate limit.
GET/v1/creditsRequiredAuthoritative remaining credit.
GET/v1/collectionsRequiredEvery collection available to your key.
GET/v1/collections/{id}RequiredCollection metadata in OGC API - Features shape.
GET/v1/collections/{id}/items?bbox=RequiredFeatures intersecting a bounding box, as GeoJSON.
POST/v1/spatial/isochroneRequiredTravel-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.

StatusTypeCause
401missing_api_keyNo Authorization header, or it is malformed.
401invalid_api_keyThe key is not recognised.
402insufficient_creditsYour prepaid balance has reached zero.
429rate_limitedOver the requests-per-minute limit for your key.
503auth_unavailableAuthentication 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.