OpenStreetMap Provider
For more options and configurations, see the OpenStreetMap Nominatim wiki.
Usage policy
The public Nominatim server (nominatim.openstreetmap.org) is free, but it has a usage policy. The short version:
- your app must be identifiable. Browsers send a referer, which is enough. Where that is missing (e.g. in an app built with Electron), add the
emailparameter. - search-as-you-type is not allowed on the public server, and it doesn't work well anyway, because Nominatim can't search partial words. Turn off
autoCompleteon the control, or run your own Nominatim, or use another provider for autocomplete. - keep the number of requests low. The control can help with
minQueryLength,autoCompleteDelayandcacheSize.
The email parameter is not a login and doesn't give you more requests. It lets the Nominatim admins tell your (small) traffic apart from scrapers they need to block.
Optional parameters
OpenStreetMap Nominatim supports a number of optional parameters. As the api requires those parameters to be added to the url, they can be added to the params key of the provider.
All options defined next to the params key, would have been added to the request body.
Limiting the results to an area
Nominatim can leave out results outside an area. With countrycodes it only searches the given countries (ISO 3166-1 alpha-2 codes). With viewbox and bounded: 1 it only searches inside a box, given as west,north,east,south (longitude, latitude):
Without bounded, the viewbox only puts the results inside the box first. Other providers have their own parameters for this, like bbox for Photon or boundary.rect for Pelias, see the page of each provider.