Skip to content

Geocoding API

Generally available

Forward 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/search

Forward geocode a query.

Parameters

NameInReqDescription
qqueryyesAddress or place name.
limitquerynoMax results (default 5).
countrycodesquerynoISO country filter, e.g. au.
X-API-KeyheaderyesYour 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/reverse

Reverse geocode a coordinate.

Parameters

NameInReqDescription
latqueryyesLatitude.
lonqueryyesLongitude.
X-API-KeyheaderyesYour 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/batch

Batch forward geocode (share-alike gated).

Parameters

NameInReqDescription
queriesbodyyesArray of query strings.
X-API-KeyheaderyesYour 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"]}'