Images – GET /v1/image
GET /v1/image
Section titled “GET /v1/image”Returns a PNG map of any area with the à portée branding, drawn like the map’s share cards. It needs a key. One image counts as 10 requests against the daily limit.
curl -H "X-Api-Key: $APORTEE_API_KEY" \ "https://aportee.ca/v1/image?lat=43.25&lon=-79.82&zoom=13&types=grocery,pharmacy" \ -o hamilton.pngParams: lat, lon, zoom, types, theme (light|dark), lang, w,
and h. The API ignores mode and budget. Images show walking times.
Your own markers
Section titled “Your own markers”Add markers to draw your own points over the access colours, such as sites you are
studying. Each marker takes the map’s pin colours for the image’s theme: a dot (filled, the
default) or a ring (hollow), with an optional label beside it. The same points with the same
settings give the same image.
When markers can’t be drawn on images at the moment, the API returns 501
(aportee.api.not_implemented) with no image, and doesn’t
count the call.
Up to 20 points fit in the query, as lat,lon pairs separated by semicolons:
curl -H "X-Api-Key: $APORTEE_API_KEY" \ "https://aportee.ca/v1/image?lat=53.5465&lon=-113.555&zoom=15&markers=53.5465,-113.555;53.5485,-113.548" \ -o permits.pngFor up to 500 points, labels or the ring style, send POST /v1/image. The body takes the
same parameters as JSON fields, and markers as a GeoJSON FeatureCollection of Points. Each
feature’s properties may include label (at most 80 characters) and style (dot or
ring). GeoJSON coordinates are [lon, lat]:
curl -X POST -H "X-Api-Key: $APORTEE_API_KEY" -H "Content-Type: application/json" \ https://aportee.ca/v1/image -o permits.png -d '{ "lat": 53.5465, "lon": -113.555, "zoom": 15, "types": ["grocery", "pharmacy"], "markers": { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-113.555, 53.5465] }, "properties": { "label": "Permit 1" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-113.548, 53.5485] }, "properties": { "label": "Permit 2", "style": "ring" } } ] } }'The API returns 400 when a marker is malformed, or when the query has more than 20 or
the body more than 500. The error names the marker that failed.