3 The search API allows you to look up a location from a textual description
4 or address. Nominatim supports structured and free-form search queries.
6 The search query may also contain
7 [special phrases](https://wiki.openstreetmap.org/wiki/Nominatim/Special_Phrases)
8 which are translated into specific OpenStreetMap (OSM) tags (e.g. Pub => `amenity=pub`).
9 This can be used to narrow down the kind of objects to be returned.
12 Special phrases are not suitable to query all objects of a certain type in an
13 area. Nominatim will always just return a collection of the best matches. To
14 download OSM data by object type, use the [Overpass API](https://overpass-api.de/).
18 The search API has the following format:
21 https://nominatim.openstreetmap.org/search?<params>
24 !!! danger "Deprecation warning"
25 The API can also be used with the URL
26 `https://nominatim.openstreetmap.org/search.php`. This is now deprecated
27 and will be removed in future versions.
29 The query term can be given in two different forms: free-form or structured.
35 | q | Free-form query string to search for |
37 In this form, the query can be unstructured.
38 Free-form queries are processed first left-to-right and then right-to-left if that fails. So you may search for
39 [pilkington avenue, birmingham](https://nominatim.openstreetmap.org/search?q=pilkington+avenue,birmingham) as well as for
40 [birmingham, pilkington avenue](https://nominatim.openstreetmap.org/search?q=birmingham,+pilkington+avenue).
41 Commas are optional, but improve performance by reducing the complexity of the search.
43 The free-form may also contain special phrases to describe the type of
44 place to be returned or a coordinate to search close to a position.
49 |----------- | ----- |
50 | amenity | name and/or type of POI |
51 | street | housenumber and streetname |
56 | postalcode | postal code |
58 The structured form of the search query allows to lookup up an address
59 that is already split into its components. Each parameter represents a field
60 of the address. All parameters are optional. You should only use the ones
61 that are relevant for the address you want to geocode.
64 Cannot be combined with the `q=<query>` parameter. Newer versions of
65 the API will return an error if you do so. Older versions simply return
70 The following parameters can be used to further restrict the search and
71 change the output. They are usable for both forms of the search query.
75 | Parameter | Value | Default |
76 |-----------| ----- | ------- |
77 | format | one of: `xml`, `json`, `jsonv2`, `geojson`, `geocodejson` | `jsonv2` |
79 See [Place Output Formats](Output.md) for details on each format.
82 The Nominatim service at
83 [https://nominatim.openstreetmap.org](https://nominatim.openstreetmap.org)
84 has a different default behaviour for historical reasons. When the
85 `format` parameter is omitted, the request will be forwarded to the Web UI.
88 | Parameter | Value | Default |
89 |-----------| ----- | ------- |
90 | json_callback | function name | _unset_ |
92 When given, then JSON output will be wrapped in a callback function with
93 the given name. See [JSONP](https://en.wikipedia.org/wiki/JSONP) for more
96 Only has an effect for JSON output formats.
98 | Parameter | Value | Default |
99 |-----------| ----- | ------- |
100 | limit | number | 10 |
102 Limit the maximum number of returned results. Cannot be more than 40.
103 Nominatim may decide to return less results than given, if additional
104 results do not sufficiently match the query.
109 | Parameter | Value | Default |
110 |-----------| ----- | ------- |
111 | addressdetails | 0 or 1 | 0 |
113 When set to 1, include a breakdown of the address into elements.
114 The exact content of the address breakdown depends on the output format.
117 If you are interested in a stable classification of address categories
118 (suburb, city, state, etc), have a look at the `geocodejson` format.
119 All other formats return classifications according to OSM tagging.
120 There is a much larger set of categories and they are not always consistent,
121 which makes them very hard to work with.
124 | Parameter | Value | Default |
125 |-----------| ----- | ------- |
126 | extratags | 0 or 1 | 0 |
128 When set to 1, the response include any additional information in the result
129 that is available in the database, e.g. wikipedia link, opening hours.
132 | Parameter | Value | Default |
133 |-----------| ----- | ------- |
134 | namedetails | 0 or 1 | 0 |
136 When set to 1, include a full list of names for the result. These may include
137 language variants, older names, references and brand.
140 ### Language of results
142 | Parameter | Value | Default |
143 |-----------| ----- | ------- |
144 | accept-language | browser language string | content of "Accept-Language" HTTP header |
146 Preferred language order for showing search results. This may either be
147 a simple comma-separated list of language codes or have the same format
148 as the ["Accept-Language" HTTP header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language).
151 First-time users of Nominatim tend to be confused that they get different
152 results when using Nominatim in the browser versus in a command-line tool
153 like wget or curl. The command-line tools
154 usually don't send any Accept-Language header, prompting Nominatim
155 to show results in the local language. Browsers on the contratry always
156 send the currently chosen browser language.
158 ### Result restriction
160 There are two ways to influence the results. *Filters* exclude certain
161 kinds of results completely. *Boost parameters* only change the order of the
162 results and thus give a preference to some results over others.
164 | Parameter | Value | Default |
165 |-----------| ----- | ------- |
166 | countrycodes | comma-separated list of country codes | _unset_ |
168 Filer that limits the search results to one or more countries.
169 The country code must be the
170 [ISO 3166-1alpha2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code
171 of the country, e.g. `gb` for the United Kingdom, `de` for Germany.
173 Each place in Nominatim is assigned to one country code based
174 on OSM country boundaries. In rare cases a place may not be in any country
175 at all, for example, when it is in international waters. These places are
176 also excluded when the filter is set.
179 This parameter should not be confused with the 'country' parameter of
180 the structured query. The 'country' parameter contains a search term
181 and will be handled with some fuzziness. The `countrycodes` parameter
182 is a hard filter and as such should be prefered. Having both parameters
183 in the same query will work. If the parameters contradict each other,
184 the search will come up empty.
186 | Parameter | Value | Default |
187 |-----------| ----- | ------- |
188 | layer | comma-separated list of: `address`, `poi`, `railway`, `natural`, `manmade` | _unset_ (no restriction) |
190 The layer filter allows to select places by themes.
192 The `address` layer contains all places that make up an address:
193 address points with house numbers, streets, inhabited places (suburbs, villages,
194 cities, states tec.) and administrative boundaries.
196 The `poi` layer selects all point of interest. This includes classic POIs like
197 restaurants, shops, hotels but also less obvious features like recycling bins,
198 guideposts or benches.
200 The `railway` layer includes railway infrastructure like tracks.
201 Note that in Nominatim's standard configuration, only very few railway
202 features are imported into the database.
204 The `natural` layer collects feautures like rivers, lakes and mountains while
205 the `manmade` layer functions as a catch-all for features not covered by the
208 | Parameter | Value | Default |
209 |-----------| ----- | ------- |
210 | featureType | one of: `country`, `state`, `city`, `settlement` | _unset_ |
212 The featureType allows to have a more fine-grained selection for places
213 from the address layer. Results can be restricted to places that make up
214 the 'state', 'country' or 'city' part of an address. A featureType of
215 settlement selects any human inhabited feature from 'state' down to
218 When featureType ist set, then results are automatically restricted
219 to the address layer (see above).
222 Instead of using the featureType filters `country`, `state` or `city`,
223 you can also use a structured query without the finer-grained parameters
226 | Parameter | Value | Default |
227 |-----------| ----- | ------- |
228 | exclude_place_ids | comma-separeted list of place ids |
230 If you do not want certain OSM objects to appear in the search
231 result, give a comma separated list of the `place_id`s you want to skip.
232 This can be used to retrieve additional search results. For example, if a
233 previous query only returned a few results, then including those here would
234 cause the search to return other, less accurate, matches (if possible).
236 | Parameter | Value | Default |
237 |-----------| ----- | ------- |
238 | viewbox | `<x1>,<y1>,<x2>,<y2>` | _unset_ |
240 Boost parameter which focuses the search on the given area.
241 Any two corner points of the box are accepted as long as they make a proper
242 box. `x` is longitude, `y` is latitude.
244 | Parameter | Value | Default |
245 |-----------| ----- | ------- |
246 | bounded | 0 or 1 | 0 |
248 When set to 1, then it turns the 'viewbox' parameter (see above) into
249 a filter paramter, excluding any results outside the viewbox.
251 When `bounded=1` is given and the viewbox is small enough, then an amenity-only
252 search is allowed. Give the special keyword for the amenity in square
253 brackets, e.g. `[pub]` and a selection of objects of this type is returned.
254 There is no guarantee that the result returns all objects in the area.
259 | Parameter | Value | Default |
260 |-----------| ----- | ------- |
261 | polygon_geojson | 0 or 1 | 0 |
262 | polygon_kml | 0 or 1 | 0 |
263 | polygon_svg | 0 or 1 | 0 |
264 | polygon_text | 0 or 1 | 0 |
266 Add the full geometry of the place to the result output. Output formats
267 in GeoJSON, KML, SVG or WKT are supported. Only one of these
268 options can be used at a time.
270 | Parameter | Value | Default |
271 |-----------| ----- | ------- |
272 | polygon_threshold | floating-point number | 0.0 |
274 When one of the polygon_* outputs is chosen, return a simplified version
275 of the output geometry. The parameter describes the
276 tolerance in degrees with which the geometry may differ from the original
277 geometry. Topology is preserved in the geometry.
281 | Parameter | Value | Default |
282 |-----------| ----- | ------- |
283 | email | valid email address | _unset_ |
285 If you are making large numbers of request please include an appropriate email
286 address to identify your requests. See Nominatim's
287 [Usage Policy](https://operations.osmfoundation.org/policies/nominatim/) for more details.
289 | Parameter | Value | Default |
290 |-----------| ----- | ------- |
291 | dedupe | 0 or 1 | 1 |
293 Sometimes you have several objects in OSM identifying the same place or
294 object in reality. The simplest case is a street being split into many
295 different OSM ways due to different characteristics. Nominatim will
296 attempt to detect such duplicates and only return one match. Setting
297 this parameter to 0 disables this deduplication mechanism and
298 ensures that all results are returned.
300 | Parameter | Value | Default |
301 |-----------| ----- | ------- |
302 | debug | 0 or 1 | 0 |
304 Output assorted developer debug information. Data on internals of Nominatim's
305 "search loop" logic, and SQL queries. The output is HTML format.
306 This overrides the specified machine readable format.
312 ##### XML with KML polygon
314 * [https://nominatim.openstreetmap.org/search?q=135+pilkington+avenue,+birmingham&format=xml&polygon_kml=1&addressdetails=1](https://nominatim.openstreetmap.org/search?q=135+pilkington+avenue,+birmingham&format=xml&polygon_kml=1&addressdetails=1)
317 <?xml version="1.0" encoding="UTF-8" ?>
318 <searchresults timestamp="Tue, 08 Aug 2023 15:45:41 +00:00"
319 attribution="Data © OpenStreetMap contributors, ODbL 1.0. http://osm.org/copyright"
320 querystring="135 pilkington avenue, birmingham"
321 more_url="https://nominatim.openstreetmap.org/search?q=135+pilkington+avenue%2C+birmingham&polygon_kml=1&addressdetails=1&limit=20&exclude_place_ids=125279639&format=xml"
322 exclude_place_ids="125279639">
323 <place place_id="125279639"
328 boundingbox="52.5487473,52.5488481,-1.8165130,-1.8163464"
331 display_name="135, Pilkington Avenue, Maney, Sutton Coldfield, Wylde Green, Birmingham, West Midlands Combined Authority, England, B72 1LH, United Kingdom"
334 importance="9.999999994736442e-08">
339 <coordinates>-1.816513,52.5487566 -1.816434,52.5487473 -1.816429,52.5487629 -1.8163717,52.5487561 -1.8163464,52.5488346 -1.8164599,52.5488481 -1.8164685,52.5488213 -1.8164913,52.548824 -1.816513,52.5487566</coordinates>
344 <house_number>135</house_number>
345 <road>Pilkington Avenue</road>
346 <hamlet>Maney</hamlet>
347 <town>Sutton Coldfield</town>
348 <village>Wylde Green</village>
349 <city>Birmingham</city>
350 <ISO3166-2-lvl8>GB-BIR</ISO3166-2-lvl8>
351 <state_district>West Midlands Combined Authority</state_district>
352 <state>England</state>
353 <ISO3166-2-lvl4>GB-ENG</ISO3166-2-lvl4>
354 <postcode>B72 1LH</postcode>
355 <country>United Kingdom</country>
356 <country_code>gb</country_code>
361 ##### JSON with SVG polygon
363 [https://nominatim.openstreetmap.org/search?q=Unter%20den%20Linden%201%20Berlin&format=json&addressdetails=1&limit=1&polygon_svg=1](https://nominatim.openstreetmap.org/search?q=Unter%20den%20Linden%201%20Berlin&format=json&addressdetails=1&limit=1&polygon_svg=1)
369 "ISO3166-2-lvl4": "DE-BE",
372 "country": "Deutschland",
373 "country_code": "de",
374 "historic": "Kommandantenhaus",
376 "neighbourhood": "Friedrichswerder",
378 "road": "Unter den Linden",
388 "display_name": "Kommandantenhaus, 1, Unter den Linden, Friedrichswerder, Mitte, Berlin, 10117, Deutschland",
389 "importance": 0.8135042058306902,
390 "lat": "52.51720765",
391 "licence": "Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright",
392 "lon": "13.397834399325466",
395 "place_id": 108681845,
396 "svg": "M 13.3975116 -52.5172905 L 13.397549 -52.5170798 13.397715 -52.5170906 13.3977122 -52.5171064 13.3977392 -52.5171086 13.3977417 -52.5170924 13.3979655 -52.5171069 13.3979623 -52.5171233 13.3979893 -52.5171248 13.3979922 -52.5171093 13.3981577 -52.5171203 13.398121 -52.5173311 13.3978115 -52.5173103 Z",
402 ##### JSON with address details
404 [https://nominatim.openstreetmap.org/search?addressdetails=1&q=bakery+in+berlin+wedding&format=jsonv2&limit=1](https://nominatim.openstreetmap.org/search?addressdetails=1&q=bakery+in+berlin+wedding&format=jsonv2&limit=1)
410 "ISO3166-2-lvl4": "DE-BE",
413 "country": "Deutschland",
414 "country_code": "de",
415 "neighbourhood": "Sprengelkiez",
417 "road": "Lindower Straße",
421 "addresstype": "shop",
429 "display_name": "Ditsch, Lindower Straße, Sprengelkiez, Wedding, Mitte, Berlin, 13347, Deutschland",
430 "importance": 9.99999999995449e-06,
431 "lat": "52.54274275",
432 "licence": "Data © OpenStreetMap contributors, ODbL 1.0. http://osm.org/copyright",
433 "lon": "13.36690305710228",
437 "place_id": 204751033,
446 [https://nominatim.openstreetmap.org/search?q=17+Strada+Pictor+Alexandru+Romano%2C+Bukarest&format=geojson](https://nominatim.openstreetmap.org/search?q=17+Strada+Pictor+Alexandru+Romano%2C+Bukarest&format=geojson)
450 "type": "FeatureCollection",
451 "licence": "Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright",
456 "place_id": "35811445",
458 "osm_id": "2846295644",
459 "display_name": "17, Strada Pictor Alexandru Romano, Bukarest, Bucharest, Sector 2, Bucharest, 023964, Romania",
463 "importance": 0.62025
485 [https://nominatim.openstreetmap.org/search?q=%CE%91%CE%B3%CE%AF%CE%B1+%CE%A4%CF%81%CE%B9%CE%AC%CE%B4%CE%B1%2C+%CE%91%CE%B4%CF%89%CE%BD%CE%B9%CE%B4%CE%BF%CF%82%2C+Athens%2C+Greece&format=geocodejson](https://nominatim.openstreetmap.org/search?q=%CE%91%CE%B3%CE%AF%CE%B1+%CE%A4%CF%81%CE%B9%CE%AC%CE%B4%CE%B1%2C+%CE%91%CE%B4%CF%89%CE%BD%CE%B9%CE%B4%CE%BF%CF%82%2C+Athens%2C+Greece&format=geocodejson)
489 "type": "FeatureCollection",
492 "attribution": "Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright",
494 "query": "Αγία Τριάδα, Αδωνιδος, Athens, Greece"
501 "type": "place_of_worship",
502 "label": "Αγία Τριάδα, Αδωνιδος, Άγιος Νικόλαος, 5º Δημοτικό Διαμέρισμα Αθηνών, Athens, Municipality of Athens, Regional Unit of Central Athens, Region of Attica, Attica, 11472, Greece",
503 "name": "Αγία Τριάδα",