Skip to content

Access – GET & POST /v1/access

Returns the census block that contains a point, with the components you name in include. minutes are on foot unless mode asks for cycling or transit.

Param Required Description
lat yes Latitude (WGS84)
lon yes Longitude (WGS84)
mode no walk (default), bike, transit, or combo (bike + transit, the bicycle parked at the stop). See cycling and transit.
period no For transit and combo: weekday_peak (default), weekday_night, saturday_midday or sunday_midday.
statistic no For transit and combo: p50, the typical trip (default), or p90, the worst case.
include no Comma-separated components: minutes, population, place, narrative, walk_counts. all selects all five. Defaults to minutes. See walk counts.
walk_minutes no The walk walk_counts counts within, in whole minutes from 5 to 55. Defaults to 15.
types no Comma-separated amenity types (e.g. grocery,pharmacy). Defaults to every amenity type in the current data; a type the data does not include is left out of minutes. An unknown type is a 400.
lang no en (default) or fr: the language of narrative and of place names.
key no API key. Prefer the X-Api-Key header, which keeps the key out of URLs; see keys.
Terminal window
# Only a subset of types:
curl "https://aportee.ca/v1/access?lat=43.6532&lon=-79.3832&types=grocery,pharmacy,library"

minutes are the figure the map shows at the point: the census block’s, or, for a block larger than 0.1 km², the figure of the H3 hexagon (about 130 m across) at the point, since the map draws large blocks as hexagons. basis comes with minutes and says which, with the block’s ID and area:

"basis": { "kind": "hexagon", "block_id": "35204616019", "block_area_km2": 0.127 }

block_id and population stay the block’s either way. Where a large block has no hexagon figure at the point (the hexagon has no residents), the API gives the block’s, and basis.note says so. Every building in a block or hexagon gets the same figure.

Each amenity in minutes is an object with a value and a reason:

{ "value": 6, "reason": "ok" }
reason Modes Meaning
ok all value is the time in minutes by the asked mode.
no_access all Nothing of the type within the 60-minute search (meta.limit_minutes). value is null.
not_computed all No time was computed for the block: its point could not be connected to the street network, or no network could be built for its area. value is null.
fell_back transit, combo No transit reaches the point. As on the map, value is then the time by fell_back_to: walk, or bike for combo.
walk_faster transit, combo Walking from the same point is quicker than the trip by transit: value is the walking time, the quickest way to make the trip.
no_data bike, combo The map has no figure at the point (its hexagon has no residents); a point nearer homes may have one. value is null.

Treat any reason other than ok and walk_faster as no time by the asked mode; fell_back gives the walk or ride in its place.

{ "value": 2, "reason": "fell_back", "fell_back_to": "walk" }

A transit entry falls back to the block’s walk where the cycling and transit times have no figure at the point. When the walk or ride of a fell_back entry has no time, value is null and fell_back_reason gives its reason.

mode=bike, mode=transit and mode=combo give the cycling and transit times the map shows at the point, for the same data version (time sources). Every mode searches up to 60 minutes (meta.limit_minutes). Whatever the mode, narrative and walk_counts describe walking.

Transit times follow the operators’ published timetables (GTFS): for each origin, 24 departures across the period are routed, and statistic picks the median (p50, the typical trip) or the 90th percentile (p90, the worst case) of those departures. Bike + transit assumes the bicycle is parked at the stop.

Without a key With a key (free or research)
walk, bike, and transit at period=weekday_peak, statistic=p50, as on the free map every mode, period and statistic the served data includes, as on à portée plus

Without a key, a call gets 401 (aportee.api.unauthorized) if it asks for another period, statistic=p90 or mode=combo, and detail names what needs a key. A call for a period the served data does not include gets 503 (aportee.api.unavailable).

Terminal window
curl "https://aportee.ca/v1/access?lat=43.7315&lon=-79.2620&types=grocery,pharmacy,hospital&mode=transit"
{
"block_id": "35203452011",
"point": { "lat": 43.7315, "lon": -79.262 },
"meta": {
"vintage": 2021,
"methodology": "R5 walk + transit, published timetables (GTFS), median of 24 departures in weekday_peak",
"attribution": "© OpenStreetMap contributors · Adapted from Statistics Canada · Overture Maps Foundation · ODbL (derived) · Transit: timetables published by transit operators (GTFS), each under its operator’s licence; operators, credits and licences: https://r2.aportee.ca/v/20261021-r37-transit/SOURCE-NOTICES.txt",
"data_version": "20261021-r37",
"timing_dataset": "canada-transit-r37",
"limit_minutes": 60,
"transit_notices": "https://r2.aportee.ca/v/20261021-r37-transit/SOURCE-NOTICES.txt",
"timetables": { "period": "weekday_peak", "date": "2026-10-14", "window": "07:00–09:00" }
},
"minutes": {
"grocery": { "value": 10, "reason": "ok" },
"pharmacy": { "value": 9, "reason": "ok" },
"hospital": { "value": 30, "reason": "ok" }
},
"travel": { "mode": "transit", "period": "weekday_peak", "statistic": "p50" }
}

travel gives the minutes’ mode, and for transit their period and statistic; a walking response has no travel. meta.timing_dataset names the data version of the cycling and transit times, and meta.timetables the day the timetables were sampled for the period, with its departure window. Many operators ask for a credit wherever their timetables are used, so a transit response’s meta.attribution includes that credit and the link to the source notices (meta.transit_notices), which list every operator, credit and licence. Show that credit with the times.

walk_counts counts the places of each requested type reached on foot within walk_minutes of the point. The API routes the walks from the exact point on the city’s walking network to every mapped destination, with the map’s settings: walking at 3.6 km/h, slowed on slopes (Tobler). A place across a river counts only when a crossing keeps the walk within walk_minutes. walk_pois adds up to three named places per type with their walking minutes, nearest first. The shape, with illustrative values:

"walk_counts": { "minutes": 15, "reason": "ok", "counts": { "grocery": 3, "pharmacy": 1 },
"region": "Hamilton", "method": "R5 WALK, Tobler slope-adjusted, snapped selected point" },
"walk_pois": [{ "type": "grocery", "name": "FreshCo", "minutes": 6, "locations": 1 }]

Routing covers twelve cities (Hamilton, Toronto, Ottawa, Montréal, Québec, Vancouver, Victoria, Calgary, Edmonton, Winnipeg, Halifax, Saskatoon). Elsewhere, or when the routing service is off or busy, counts is null and reason says why: outside_coverage, unavailable or disabled. A detail string adds the cause, such as routing service busy; retry in a few seconds, routing timed out or routing service returned an unexpected response. When routing was busy or timed out, the response sets Retry-After (in seconds), and a retry of the same point often succeeds. Match on reason: the wording of detail can change.

Code Meaning
200 Data returned.
304 Not modified: the If-None-Match header names the current result. Not counted.
400 Bad parameters: unknown types, mode, period or statistic, a period or statistic with walk or bike, bad include or walk_minutes, or missing lat/lon. The body’s detail lists valid values.
401 Without a key: a transit period other than weekday_peak, statistic=p90, or mode=combo. Not counted.
404 aportee.api.outside_coverage: no populated census block contains the point (outside Canada, over water, or no residents). hint says which, including swapped coordinates.
422 Coordinates out of range or degenerate (e.g. a pole or the antimeridian).
429 Rate limited. Retry-After gives the seconds until the daily reset.
503 aportee.api.unavailable: the served data has no times for the asked mode and period.
5xx Internal failure, such as a tile source outage.

The code for each status is on Errors.

A 200 includes an ETag that changes with the data version and the query. Send it back in If-None-Match to get 304 with no body when nothing has changed; a 304 does not count against the daily limit. See conditional requests. A request with walk_counts is routed again on every call, so its 200 comes without an ETag.

Answers up to 100 points in one call. It needs a key, and each point counts as one request against the daily limit. results follows the order of points. A bad point gets an { "error": … } object in its slot, and the other points still get their results. include takes the same components as GET except walk_counts, which is routed per point; all leaves it out, and naming it is a 400. mode, period and statistic work as on GET and apply to every point.

Terminal window
curl -X POST "https://aportee.ca/v1/access" \
-H "X-Api-Key: $APORTEE_API_KEY" \
-H "content-type: application/json" \
-d '{"points":[{"lat":43.25,"lon":-79.82},{"lat":43.65,"lon":-79.38}],"include":["minutes"]}'