Skip to content

Walking-access API quickstart

Steps 1 to 4 need no account. Anonymous calls are limited to 100 requests a day per IP address. The examples use curl; any HTTP client works.

The API takes coordinates (WGS84 decimal degrees, lat and lon). For a street address, take its coordinates from a source that lists each address as a point, such as a municipal address dataset, or from a geocoder you are allowed to use. For a city or town, call /v1/search for its centre point:

Terminal window
curl "https://aportee.ca/v1/search?name=Toronto"
{
"places": [{ "name": "Toronto", "prov": "ON", "lat": 43.7141, "lon": -79.3911, "pop": 2794356 }]
}

For a home, use its own point. The steps below use one on Queen Street West in Toronto (43.65204, −79.38410).

Pass the coordinates to /v1/access. types picks amenity types and include picks the parts of the response.

Terminal window
curl "https://aportee.ca/v1/access?lat=43.65204&lon=-79.38410&types=grocery,pharmacy,library&include=minutes,place,narrative"
{
"block_id": "35204616019",
"point": { "lat": 43.65204, "lon": -79.3841 },
"meta": {
"vintage": 2021,
"methodology": "R5 walk, Tobler slope-adjusted",
"attribution": "© OpenStreetMap contributors · Adapted from Statistics Canada · Overture Maps Foundation · ODbL (derived)",
"limit_minutes": 60,
"data_version": "20261021-r37"
},
"basis": { "kind": "hexagon", "block_id": "35204616019", "block_area_km2": 0.127 },
"minutes": {
"grocery": { "value": 6, "reason": "ok" },
"pharmacy": { "value": 5, "reason": "ok" },
"library": { "value": 3, "reason": "ok" }
},
"place": { "name": "Toronto", "prov": "ON", "lat": 43.7141, "lon": -79.3911, "pop": 2794356, "kind": "nearest" },
"narrative": "Groceries are about 6 minutes away; a pharmacy is about 5 minutes away; a library is a short walk."
}

Each time belongs to the census block that contains the point (block_id), or to the hexagon at the point in a block over 0.1 km² (basis), so every building in it gets the same time. reason is ok when a time was found. It is no_access when none was found, and value is then null:

"minutes": { "hospital": { "value": null, "reason": "no_access" } }

Treat null as a missing time. no_access means the search found no place of the type within 60 minutes. A place can be there and still be missing from the data. Keep meta.data_version and meta.attribution with any result you show or publish.

The same call gives cycling or transit times with mode=bike or mode=transit. Without a key, transit is the weekday morning peak at the typical trip; a key adds other periods, the worst case and bike + transit (cycling and transit):

Terminal window
curl "https://aportee.ca/v1/access?lat=43.65204&lon=-79.38410&types=grocery,pharmacy,library&mode=transit"

A transit time is the walking time where no transit reaches the point (reason: "fell_back") or where walking is quicker (reason: "walk_faster").

/v1/amenities lists every type with English and French labels. Use the type values in the types parameter. For an unknown type, the API returns 400 with the list of valid ones.

Terminal window
curl "https://aportee.ca/v1/amenities"
{ "amenities": [ { "type": "grocery", "label": { "en": "Grocery", "fr": "Épicerie" } }, "…" ] }

/v1/me returns your tier and how many requests are left today. It isn’t counted.

Terminal window
curl "https://aportee.ca/v1/me"
{
"tier": "anonymous",
"daily_limit": 100,
"remaining": 93,
"reset_at": "2026-10-14T00:00:00.000Z",
"features": { "batch": false, "named_pois": false, "images": false },
"tiers": { "anonymous": 100, "key": 1000, "research": 10000 },
"upgrade_url": "https://aportee.ca/signin?next=%2Faccount",
"commercial_contact": "services@aportee.ca"
}

A free key raises your daily_limit from 100 to 1,000 requests a day, the key figure in tiers. It also adds batch lookups (POST /v1/access), map images (/v1/image), walking routes (/v1/routes), the search for named places near a point (/v1/search with near), and transit beyond the weekday peak’s typical trip. Sign in with your email address, then choose Create a key on your account page. The key starts with ap_live_ and is shown once (keys).

A terminal or an agent can also ask for a key, which you approve in your browser:

  • CLI: aportee login prints a link and a code and opens your browser. After you approve, it prints export APORTEE_API_KEY=….
  • MCP: the agent calls start_sign_in, shows you the link, then collects the key with check_sign_in.
  • HTTP: POST /v1/auth/device, then poll POST /v1/auth/device/token. See agent sign-in.

Send the key in the X-Api-Key header. A batch takes up to 100 points, and each point counts as one request.

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.25085,"lon":-79.81809},{"lat":43.65204,"lon":-79.38410}],"types":["grocery","pharmacy"],"include":["minutes"]}'

results has one entry per point, in the same order. A point that fails gets an error object in its slot, and the other points still get their results. Without a key, the API returns 401:

{
"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"
}

Every error code is on Errors.

  • MCP: add https://aportee.ca/v1/mcp to an MCP client as a remote (Streamable HTTP) server. No key is needed to start. See MCP server.

  • CLI: pipx install aportee, then aportee access 43.65204 -79.38410, or run it once with uvx aportee access 43.65204 -79.38410. Needs Python 3.11 or later. See CLI.

  • Python: pip install aportee, then:

    from aportee import Client
    client = Client() # reads APORTEE_API_KEY
    snapshot = client.access((43.65204, -79.38410), types=["grocery", "pharmacy"])
    print(snapshot["minutes"])

    A list of points is sent as a batch, and to_frame turns results into a pandas DataFrame.