Skip to content

Walking-access API error codes

An error response has a JSON body with a stable code, a readable detail, and the HTTP status repeated as statusCode. Branch on code; detail can change.

{ "code": "aportee.api.bad_request", "detail": "Missing required query params: lat, lon", "statusCode": 400 }
Code Status Meaning
aportee.api.bad_request 400 A parameter or the request body is missing or invalid.
aportee.api.unauthorized 401 The feature needs a key and none was recognized.
aportee.api.outside_coverage 404 No populated census block contains the point.
aportee.api.no_street_nearby 404 No walkable street near enough to route from.
aportee.api.not_found 404 No such reference record, dataset or sign-in code.
aportee.api.unprocessable 422 The coordinates can’t be used, or the search area is too large.
aportee.api.rate_limited 429 Today’s limit is used up.
aportee.api.server_error 500 The lookup failed on our side.
aportee.api.not_implemented 501 Markers can’t be drawn on images at the moment.
aportee.api.render_error 503 The image couldn’t be drawn.
aportee.api.unavailable 503 A service the request depends on is unavailable.

In a batch (POST /v1/access), a point that fails gets { "error": { "code", "detail", "statusCode" } } in its slot, and the batch itself still returns 200. Over MCP, a refused tool call sets isError: true and includes the same body in the MCP server’s terms (tool and argument names where REST has routes and parameters). A call with an argument of the wrong type is refused in plain text, with no body.

aportee.api.bad_request, status 400. Returned for:

  • a missing lat/lon or name;
  • an unknown value in types or include (including walk_counts in a batch);
  • an unknown mode, period or statistic on /v1/access, or a period or statistic with mode=walk or mode=bike;
  • a walk_minutes that is not a whole number from 5 to 55, or a malformed near;
  • an unknown prov on /v1/search;
  • a batch body that isn’t JSON, has no points, or has more than 100;
  • an unknown parameter or mode on /v1/reference/{dataset};
  • a malformed markers on /v1/image or /v1/embed, more than 20 in the query, or more than 500 in an image’s body;
  • a lang other than en or fr, a theme other than light or dark, or a label over 80 characters on /v1/compass.svg or /v1/compass.png.

Fix: read detail. For types and include it lists the valid values:

{
"code": "aportee.api.bad_request",
"detail": "types is invalid: \"groceries\" not a known amenity type. Valid: grocery, pharmacy, bakery, …",
"statusCode": 400
}

/v1/amenities lists the valid types.

aportee.api.unauthorized, status 401. POST /v1/access, /v1/image and /v1/routes return it when the request has no key, or a key that isn’t recognized (mistyped or revoked). GET /v1/access returns it for transit beyond the free map without a key: a period other than weekday_peak, statistic=p90 or mode=combo; detail names what needs the key. /v1/compass.svg and /v1/compass.png return it for a label without a key. The call is not counted.

{
"code": "aportee.api.unauthorized",
"detail": "Batch lookup requires an API key. Sign in at upgrade_url for a free key (1,000 requests a day) and send it in the X-Api-Key header.",
"statusCode": 401,
"tier": "anonymous",
"upgrade_url": "https://aportee.ca/signin?next=%2Faccount"
}

Fix: create a key at upgrade_url and send it in the X-Api-Key header. GET /v1/me shows whether a key is recognized: if not, its tier is anonymous. Over MCP, the error body adds next: call start_sign_in and show the person the link, or, where accounts are off, give them upgrade_url. Until then, answer with what works without a key.

/v1/search with near and no key returns 200 with place matches only, a detail and an upgrade_url.

aportee.api.outside_coverage, status 404. On /v1/access and in a batch slot, no populated Canadian census block contains the point: it is outside Canada, over water, or in an area with no residents. hint says which. When swapping lat and lon gives a point in Canada, it says the coordinates look swapped and gives them the right way round; when the longitude lost its minus sign, it says so and gives it back.

{
"code": "aportee.api.outside_coverage",
"detail": "No populated census block at lat=-79.3841, lon=43.65204",
"statusCode": 404,
"hint": "lat and lon look swapped: try lat=43.65204, lon=-79.3841."
}

Fix: follow hint. For a point on land in Canada, send WGS84 decimal degrees with lat first.

aportee.api.no_street_nearby, status 404. On /v1/compass, no walkable street is near enough to the point to route from: it is over water, or far from any street or path. hint says so, or that the coordinates look swapped.

Fix: move the point onto a street nearby. /v1/access may still answer for the block.

aportee.api.not_found, status 404. On /v1/reference/{dataset}, one of these doesn’t exist: the dataset, the geography at the point, or the census ID. On the agent sign-in, the sign-in code is unknown.

Fix: check the dataset name, the point or the ID.

aportee.api.unprocessable, status 422. The coordinates are not finite numbers, are out of range, or are off the projected map (near a pole or the antimeridian).

{ "code": "aportee.api.unprocessable", "detail": "Coordinate is off the projected map (near a pole/antimeridian).", "statusCode": 422 }

Fix: send WGS84 decimal degrees.

aportee.api.rate_limited, status 429. The daily limit for your tier is used up. Limits reset at 00:00 UTC. The Retry-After header gives the seconds until then, and X-RateLimit-Reset gives the time as a Unix timestamp.

{
"code": "aportee.api.rate_limited",
"detail": "Daily limit of 100 requests reached; it resets at 2026-10-14T00:00:00.000Z. Sign in at upgrade_url for a free key (1,000 requests a day) and send it in the X-Api-Key header.",
"statusCode": 429,
"tier": "anonymous",
"upgrade_url": "https://aportee.ca/signin?next=%2Faccount"
}

Fix: wait Retry-After seconds, or move up a tier. upgrade_url depends on tier: anonymous callers get the sign-in page for a free key, key holders get the research-limit request on their account page, and research keys get the rate limits section. A retry before the reset gets 429 again. Check remaining with GET /v1/me before a large batch; a batch counts one request per point. A result you already hold can still be revalidated with If-None-Match: the 304 reply comes even after the limit is reached, and is not counted (conditional requests).

aportee.api.server_error, status 500. The lookup failed on our side, for example because a tile source is unavailable.

Fix: retry after a short wait. If it persists, write to feedback@aportee.ca with the request URL.

aportee.api.not_implemented, status 501. /v1/image returns this when the request asks for markers that can’t be drawn at the moment. You get no image, and the call isn’t counted.

Fix: ask for the image without markers, or put the markers on an embed.

aportee.api.render_error, status 503. /v1/image or /v1/compass.png couldn’t draw the picture just now, often because the service is starting up. You get no image, and the call isn’t counted.

Fix: retry after the Retry-After seconds.

aportee.api.unavailable, status 503. /v1/reference/{dataset} couldn’t read the reference data or check the daily limit. On /v1/routes and /v1/compass, routing or the compass data is unavailable for now. On /v1/access, the served data has no cycling or transit times for the asked mode and period. On /v1/compass.png, the picture is unavailable for now. /v1/compass.svg draws the same picture.

Fix: retry later. For /v1/routes and /v1/compass, /v1/access still gives the walking minutes.