Skip to Content
BuddyGeoDocs

Nominatim migration

Keep your /reverse and /search requests. Change the base URL, add the X-API-Key header, and check the short list of differences.

If your application already talks to a Nominatim server, you do not have to rewrite it to try BuddyGeo. The compatibility endpoints /reverse and /search accept Nominatim's query parameters and answer in Nominatim's jsonv2 shape. When you want request IDs, credit information and stable field names in the body, move to the normalized /v1 endpoints one call at a time.

What changes

NominatimBuddyGeo compatibility endpoints
Base URLhttps://nominatim.openstreetmap.org or your own hosthttps://api.buddygeo.com
Paths/reverse, /search/reverse, /search (unchanged)
AuthenticationNone on the public instance, where a User-Agent or Referer identifies youX-API-Key header
LimitsUsage policy of the instanceRequests per second and monthly credits of your plan
Response formatjsonv2, json, xml, geojson, geocodejsonjsonv2 (format=json is accepted and answers in the same shape)

A reverse request, before and after:

# before
curl "https://nominatim.openstreetmap.org/reverse?lat=43.6426&lon=-79.3871&format=jsonv2"

# after
curl "https://api.buddygeo.com/reverse?lat=43.6426&lon=-79.3871&format=jsonv2" \
  -H "X-API-Key: YOUR_API_KEY"
{
  "place_id": 283786944,
  "licence": "Data © OpenStreetMap contributors, ODbL 1.0.",
  "osm_type": "way",
  "osm_id": 461829037,
  "lat": "43.642196",
  "lon": "-79.386628",
  "category": "tourism",
  "type": "attraction",
  "place_rank": 30,
  "importance": 0.52,
  "addresstype": "tourism",
  "name": "CN Tower",
  "display_name": "CN Tower, 290, Bremner Boulevard, Entertainment District, Toronto, Ontario, M5V 3L9, Canada",
  "boundingbox": ["43.641657", "43.642735", "-79.387373", "-79.385883"],
  "address": {
    "tourism": "CN Tower",
    "house_number": "290",
    "road": "Bremner Boulevard",
    "neighbourhood": "Entertainment District",
    "city": "Toronto",
    "state": "Ontario",
    "ISO3166-2-lvl4": "CA-ON",
    "postcode": "M5V 3L9",
    "country": "Canada",
    "country_code": "ca"
  }
}

And a search:

curl "https://api.buddygeo.com/search?q=CN%20Tower&format=jsonv2&addressdetails=1&limit=1" \
  -H "X-API-Key: YOUR_API_KEY"

The answer is an array of the same objects, best match first, and [] when nothing is found.

Supported parameters

/reverse

ParameterSupport
lat, lonRequired, decimal degrees
formatjsonv2 (default) or json. Other formats are rejected with 400 invalid_query
accept-languageSupported as a query parameter and as the Accept-Language header. The first language of the list is used. See Languages
zoomReduced to three levels of detail: 18 returns the full address (the default), 16 and 17 the street, anything lower the locality
addressdetails1 (default) includes the address object, 0 leaves it out
ParameterSupport
qRequired free-form query, up to 200 characters
formatjsonv2 (default) or json
accept-languageAs for /reverse
limit1 to 10, default 5
countrycodesOne two-letter country code. Only the first code of a comma-separated list is used
addressdetails0 (default, as in Nominatim) or 1

Not supported

  • Other formats: xml, geojson and geocodejson.
  • Structured search: street, city, county, state, country and postalcode. Join them into q instead.
  • Result shaping: extratags, namedetails, polygon_geojson and the other polygon options, viewbox, bounded, layer, featureType, exclude_place_ids, dedupe. They are ignored, not rejected.
  • Other endpoints: /lookup, /details and /status. For service health, see the status page.

Differences in the response

The compatibility response is built from the same match as the normalized one, so the facts agree. The shapes differ:

Compatibility (/reverse, /search)Normalized (/v1/reverse, /v1/search)
The place object itself, or an array of themAn envelope with request_id, outcome, credits_charged and result
lat, lon as stringsresult.location.lat, result.location.lon as numbers
boundingbox as four stringsresult.bounding_box as four numbers, both [south, north, west, east]
display_name: every part joined with commasresult.formatted: the address as it is written locally, for example 290 Bremner Boulevard, Toronto, ON M5V 3L9, Canada
address.road, address.city, address.stateresult.components.street, .locality, .region
address.<category> holds the place name, for example "tourism": "CN Tower"result.components.name
address["ISO3166-2-lvl4"], for example CA-ONresult.components.region_code (ON) with country_code
category, type, osm_type, osm_idresult.match.category, .type, .osm_type, .osm_id
place_rank, importance, addresstyperesult.match.level and result.match.detail, a sentence explaining the match
licenceattribution
No match on /reverse: 200 with {"error": "Unable to geocode"}200 with result: null and outcome: "no_match"
No match on /search: 200 with []200 with result: null and outcome: "no_match"
Request ID in the X-Request-Id header onlyrequest_id in the body and in the header

Three details to check in an existing client:

  • The locality key. Nominatim puts the locality under city, town, village or hamlet depending on the place. BuddyGeo always uses address.city. A client that already tries those keys in turn keeps working.
  • place_id is a number as in Nominatim, and as in Nominatim it is not an identifier you can carry between services. Use osm_type and osm_id to recognise a feature.
  • Errors. Invalid input and authentication problems use BuddyGeo's error body with a 4xx status: request_id, status and an error object with code, message and next_step. See Rate limits and errors.

Credits

The compatibility endpoints are billed like their /v1 counterparts: one credit for a request that returns a place, nothing for a request that does not. They appear in Usage as their own endpoints, "Reverse (Nominatim-compatible)" and "Search (Nominatim-compatible)", so you can watch a migration progress.

Moving on to /v1

There is no deadline to leave the aliases. Reasons to switch a call over:

  • You want request_id, outcome and credits_charged in the body rather than inferring them.
  • You want numbers for coordinates and one stable key per address part.
  • You want match.level, match.detail and match.distance_m to judge a result.

The parameters map directly: accept-language becomes lang, zoom becomes detail (full, street or locality), countrycodes becomes country. lat, lon, q and limit keep their names.

Open in the app

On this page