Geocoding API
Generally availableForward and reverse geocoding.
Convert an address or place to coordinates (forward) and coordinates to the nearest address (reverse). Results are GeoJSON FeatureCollections built on OpenStreetMap-derived data (ODbL attribution applies).
GET
/geocoding/searchForward geocode a query.
Parameters
| Name | In | Req | Description |
|---|---|---|---|
q | query | yes | Address or place name. |
limit | query | no | Max results (default 5). |
countrycodes | query | no | ISO country filter, e.g. au. |
X-API-Key | header | yes | Your API key. |
Responses
200— GeoJSON FeatureCollection.401— Missing/invalid key.429— Rate limit exceeded.
curl "https://airfreemap.com/api/v1/geocoding/search?q=Flinders+St+Station&limit=1" -H "X-API-Key: $AIRFREE_MAPS_KEY"Example response
json
{
"type": "FeatureCollection",
"features": [{
"type": "Feature",
"properties": { "place_name": "Flinders Street Station, Melbourne VIC 3000, Australia" },
"geometry": { "type": "Point", "coordinates": [144.9671, -37.8183] }
}],
"attribution": "© OpenStreetMap contributors"
}GET
/geocoding/reverseReverse geocode a coordinate.
Parameters
| Name | In | Req | Description |
|---|---|---|---|
lat | query | yes | Latitude. |
lon | query | yes | Longitude. |
X-API-Key | header | yes | Your API key. |
Responses
200— GeoJSON FeatureCollection (nearest address).
curl "https://airfreemap.com/api/v1/geocoding/reverse?lat=-37.8183&lon=144.9671" -H "X-API-Key: $AIRFREE_MAPS_KEY"POST
/geocoding/batchBatch forward geocode (share-alike gated).
Parameters
| Name | In | Req | Description |
|---|---|---|---|
queries | body | yes | Array of query strings. |
X-API-Key | header | yes | Your API key. |
Responses
200— Array of FeatureCollections.403— Share-alike licence required for bulk output.
curl -X POST "https://airfreemap.com/api/v1/geocoding/batch" -H "X-API-Key: $AIRFREE_MAPS_KEY" \
-H "content-type: application/json" -d '{"queries":["1 Spring St, Melbourne","GPO Sydney"]}'