API authentication and limits
Most read endpoints work without a key. A key raises the daily limit and adds batch lookups
(POST /v1/access), map images (GET /v1/image), walking routes (GET /v1/routes), the search
for named places near a point (/v1/search with near), and transit beyond the weekday peak’s typical
trip: other periods, the worst case (p90) and bike + transit (combo).
Up to three of the nearest named places of each type come without a key, in /v1/access
walk_pois and in /v1/compass.
To get a key, sign in with your email address (it’s free) and choose Create a
key on your account page. An agent or the CLI (aportee login, from
pipx install aportee) can also ask for one, which you approve in your browser
(agent sign-in).
- A key is
ap_live_followed by 43 letters, digits,-and_. Keys created before 13 October 2026 start withap_only, and are valid until you revoke them. - When you create a key, the account page shows it once. To replace a lost key, revoke it and create another.
- An account can have three keys at a time. Revoke on the account page deletes a key.
- The API treats a key it doesn’t recognize (mistyped or revoked) as no key: the call gets
the anonymous limit and features, and a route that needs a key returns
401.
Send the key in the X-Api-Key header, as in the example under
Checking your tier. The REST endpoints also accept it as a key
query parameter (?key=ap_live_...). The header keeps the key out of URLs, logs and browser
history, so use it where you can. The MCP server reads the header. When no header is sent, it
reads a tool call’s api_key argument (MCP server).
For commercial or public-sector use, email services@aportee.ca.
Agent sign-in
Section titled “Agent sign-in”An agent or script can ask for a key for you, and you approve it in your browser, as when you sign in to a TV app.
-
The agent calls
POST /v1/auth/device, optionally with{"name": "Claude Code on my laptop"}. It gets adevice_codeto keep, and auser_codeandverification_url_completeto show you.Terminal window curl -X POST "https://aportee.ca/v1/auth/device" -H "content-type: application/json" \-d '{"name":"My script"}'{"device_code": "…","user_code": "BCDF-GHJK","verification_url": "https://aportee.ca/device","verification_url_complete": "https://aportee.ca/device?code=BCDF-GHJK","expires_in": 600,"interval": 5} -
You open the link, sign in with your email address if you aren’t already, check that the code and name match, and choose Approve or Deny.
-
The agent calls
POST /v1/auth/device/tokenwith{"device_code": "…"}everyintervalseconds.statusispendinguntil you decide, thenapprovedwithapi_key, ordenied. After 10 minutes it isexpired. Polling faster thanintervalreturnsslow_downwith a longerintervalto use.
Send both requests with Content-Type: application/json, even when the body is just {};
the API refuses a POST request without it with 403.
The key belongs to your account like any other: it counts toward the three, and you can
revoke it on your account page. It is returned once; later polls return already_issued.
An IP address can have three codes waiting and ask for 20 a day.
The aportee package runs this flow for you: aportee login in a terminal, or
Client().login() in Python (CLI and Python client). Install the command with
pipx install aportee, or run it once with uvx aportee login; pip install aportee adds
the Python client.
Routes that need a key
Section titled “Routes that need a key”| Route | Key | Counted |
|---|---|---|
GET /v1/access |
optional; needed for transit at other periods, statistic=p90 and mode=combo |
1 request |
GET /v1/search |
optional; needed for named places with near |
1 request |
GET /v1/compass |
optional | 1 request |
GET /v1/reference/{dataset} |
optional | separate fair-use limit, see below |
GET /v1/reference, /v1/amenities, /v1/embed, /v1/openapi.yaml |
no | not counted |
GET /v1/health, /v1/last-updated |
no | not counted |
GET /v1/me |
optional | not counted |
POST /v1/auth/device, /v1/auth/device/token |
no | not counted; see agent sign-in |
POST /v1/access |
required | 1 request per point |
GET /v1/image |
required | 10 requests per image |
GET /v1/routes |
required | 1 request per type routed |
A 304 Not Modified reply is never counted (conditional requests).
Rate limits
Section titled “Rate limits”These limits may change, so have your client read them from GET /v1/me.
| Tier | Current limit | How |
|---|---|---|
| Anonymous | 100 requests/day per IP | no key needed |
| Key | 1,000 requests/day | a free key in the X-Api-Key header |
| Research | 10,000 requests/day | an email address at a Canadian university or research hospital, or a pro-plan member |
Keys created with an email address at a Canadian university or research hospital get the research limit automatically. Keys on the pro plan get it too, and a key follows its account’s plan as the plan starts or ends. Researchers without such an address can ask for the research limit on their account page.
Counted requests
Section titled “Counted requests”- A batch (
POST /v1/access) is counted per point, all in one step: a batch of 100 points counts 100 requests, and if a batch doesn’t fit in what is left, it is refused whole. - A request refused with
429is not counted. - A
GET /v1/imagecounts 10 requests once the image comes back. An image that fails (a503while the service starts up) is not counted. - A
GET /v1/routesmust fit in what is left for every type it names. It counts 1 request per type routed. A type is not counted when it fails for the same reason as a type already routed: the point is outside coverage, or routing stopped answering. AGET /v1/routesthat returns a400,422or503is not counted either. - A
GET /v1/compasscounts 1 request, except a400,422or503, which is not counted. - In the MCP server,
travel_timescounts 1 request per point, whatever the modes, once it has answered; a refused call is not counted. Withpoints, it answers as many points as the day’s allowance covers and setstruncated.POST /v1/accessrefuses a batch that doesn’t fit. - Any other metered request counts, whatever its status. A
400,404or500counts 1 request. So does awalk_countsthat comes backunavailable.
The reference datasets (SAM and Can-ALE) are free for everyone, with their own fair-use limit, currently 10,000 lookups a day.
Every counted response, and /v1/me, includes X-RateLimit-Limit,
X-RateLimit-Remaining, and X-RateLimit-Reset (Unix timestamp of the next UTC-day
reset). Requests sent at the same moment can be miscounted, so treat the limits as
approximate.
Limit reached
Section titled “Limit reached”Past the limit, the API returns 429 with code
aportee.api.rate_limited. The response has a
Retry-After header with the number of seconds until the limit resets at 00:00 UTC. Its
body also has your tier and an upgrade_url, and its detail says what to do next.
A retry before the reset gets 429 again.
HTTP/1.1 429 Too Many RequestsRetry-After: 3600X-RateLimit-Limit: 100X-RateLimit-Remaining: 0X-RateLimit-Reset: 1791936000For a feature that needs a key, a call without one gets 401 with the same tier and
upgrade_url fields.
Checking your tier
Section titled “Checking your tier”GET /v1/me returns your tier, today’s limit and what’s left, which features your key
adds, and the upgrade_url. It isn’t counted.
curl -H "X-Api-Key: $APORTEE_API_KEY" "https://aportee.ca/v1/me"Conditional requests
Section titled “Conditional requests”GET /v1/access, GET /v1/compass, GET /v1/reference/{dataset}, GET /v1/reference and
GET /v1/amenities send an ETag header with each 200 response. Keep it with the result, and send it back in
If-None-Match when you ask again. If the result is unchanged, the reply is
304 Not Modified with no body, and it does not count against your daily limit, even when
the limit is used up.
curl -i -H 'If-None-Match: W/"20261008-unified-r34-5f0c3a1e9b2d4c77"' \ "https://aportee.ca/v1/access?lat=43.25085&lon=-79.81809&types=grocery"The ETag of an access or reference result changes when the data version changes (see
/v1/last-updated) or when the query
changes. Parameters are compared after normalising, so types=pharmacy,grocery and
types=grocery,pharmacy share an ETag. Results with and without a key have different
ETags.