3 The search API allows you to look up a location from a textual description.
4 Nominatim supports structured as well as 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 Note that this only limits the items to be found, it's not suited to return complete
10 lists of OSM objects of a specific type. For those use [Overpass API](https://overpass-api.de/).
14 The search API has the following two formats:
17 https://nominatim.openstreetmap.org/search/<query>?<params>
20 This format only accepts a free-form query string where the
21 parts of the query are separated by slashes.
24 https://nominatim.openstreetmap.org/search?<params>
27 In this form, the query may be given through two different sets of parameters:
31 Free-form query string to search for.
32 Free-form queries are processed first left-to-right and then right-to-left if that fails. So you may search for
33 [pilkington avenue, birmingham](//nominatim.openstreetmap.org/search?q=pilkington+avenue,birmingham) as well as for
34 [birmingham, pilkington avenue](//nominatim.openstreetmap.org/search?q=birmingham,+pilkington+avenue).
35 Commas are optional, but improve performance by reducing the complexity of the search.
38 * `street=<housenumber> <streetname>`
43 * `postalcode=<postalcode>`
45 Alternative query string format split into several parameters for structured requests.
46 Structured requests are faster but are less robust against alternative
47 OSM tagging schemas. **Do not combine with** `q=<query>` **parameter**.
49 All three query forms accept the additional parameters listed below.
53 * `format=[html|xml|json|jsonv2|geojson|geocodejson]`
55 See [Place Output Formats](Output.md) for details on each format. (Default: html)
57 * `json_callback=<string>`
59 Wrap JSON output in a callback function ([JSONP](https://en.wikipedia.org/wiki/JSONP)) i.e. `<string>(<json>)`.
60 Only has an effect for JSON output formats.
64 * `addressdetails=[0|1]`
66 Include a breakdown of the address into elements. (Default: 0)
71 Include additional information in the result if available,
72 e.g. wikipedia link, opening hours. (Default: 0)
77 Include a list of alternative names in the results. These may include
78 language variants, references, operator and brand. (Default: 0)
81 ### Language of results
83 * `accept-language=<browser language string>`
85 Preferred language order for showing search results, overrides the value
86 specified in the ["Accept-Language" HTTP header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language).
87 Either use a standard RFC2616 accept-language string or a simple
88 comma-separated list of language codes.
92 * `countrycodes=<countrycode>[,<countrycode>][,<countrycode>]...`
94 Limit search results to one or more countries. `<countrycode>` must be the
95 ISO 3166-1alpha2 code, e.g. `gb` for the United Kingdom, `de` for Germany.
98 * `exclude_place_ids=<place_id,[place_id],[place_id]`
100 If you do not want certain OSM objects to appear in the search
101 result, give a comma separated list of the `place_id`s you want to skip.
102 This can be used to broaden search results. For example, if a previous
103 query only returned a few results, then including those here would cause
104 the search to return other, less accurate, matches (if possible).
109 Limit the number of returned results. (Default: 10, Maximum: 50)
112 * `viewbox=<x1>,<y1>,<x2>,<y2>`
114 The preferred area to find search results. Any two corner points of the box
115 are accepted in any order as long as they span a real box.
120 When a viewbox is given, restrict the result to items contained with that
121 viewbox (see above). When `viewbox` and `bounded=1` are given, an amenity
122 only search is allowed. In this case, give the special keyword for the
123 amenity in square brackets, e.g. `[pub]`. (Default: 0)
128 * `polygon_geojson=1`
133 Output geometry of results as a GeoJSON, KML, SVG or WKT. Only one of these
134 options can be used at a time. (Default: 0)
136 * `polygon_threshold=0.0`
138 Simplify the output geometry before returning. The parameter is the
139 tolerance in degrees with which the geometry may differ from the original
140 geometry. Topology is preserved in the result. (Default: 0.0)
144 * `email=<valid email address>`
146 If you are making large numbers of request please include an appropriate email
147 address to identify your requests. See Nominatim's [Usage Policy](https://operations.osmfoundation.org/policies/nominatim/) for more details.
151 Sometimes you have several objects in OSM identifying the same place or
152 object in reality. The simplest case is a street being split in many
153 different OSM ways due to different characteristics. Nominatim will
154 attempt to detect such duplicates and only return one match unless
155 this parameter is set to 0. (Default: 1)
161 Output assorted developer debug information. Data on internals of Nominatim's
162 "Search Loop" logic, and SQL queries. The output is (rough) HTML format.
163 This overrides the specified machine readable format. (Default: 0)
170 ##### XML with polygon points
172 * [https://nominatim.openstreetmap.org/search?q=135+pilkington+avenue,+birmingham&format=xml&polygon=1&addressdetails=1](https://nominatim.openstreetmap.org/search?q=135+pilkington+avenue,+birmingham&format=xml&polygon=1&addressdetails=1)
173 * [https://nominatim.openstreetmap.org/search/gb/birmingham/pilkington%20avenue/135?format=xml&polygon=1&addressdetails=1](https://nominatim.openstreetmap.org/search/gb/birmingham/pilkington%20avenue/135?format=xml&polygon=1&addressdetails=1)
174 * [https://nominatim.openstreetmap.org/search/135%20pilkington%20avenue,%20birmingham?format=xml&polygon=1&addressdetails=1](https://nominatim.openstreetmap.org/search/135%20pilkington%20avenue,%20birmingham?format=xml&polygon=1&addressdetails=1)
177 <searchresults timestamp="Sat, 07 Nov 09 14:42:10 +0000" querystring="135 pilkington, avenue birmingham" polygon="true">
179 place_id="1620612" osm_type="node" osm_id="452010817"
180 boundingbox="52.548641204834,52.5488433837891,-1.81612110137939,-1.81592094898224"
181 polygonpoints="[['-1.81592098644987','52.5487429714954'],['-1.81592290792183','52.5487234624632'],...]"
182 lat="52.5487429714954" lon="-1.81602098644987"
183 display_name="135, Pilkington Avenue, Wylde Green, City of Birmingham, West Midlands (county), B72, United Kingdom"
184 class="place" type="house">
185 <house_number>135</house_number>
186 <road>Pilkington Avenue</road>
187 <village>Wylde Green</village>
188 <town>Sutton Coldfield</town>
189 <city>City of Birmingham</city>
190 <county>West Midlands (county)</county>
191 <postcode>B72</postcode>
192 <country>United Kingdom</country>
193 <country_code>gb</country_code>
198 ##### JSON with SVG polygon
200 [https://nominatim.openstreetmap.org/search/Unter%20den%20Linden%201%20Berlin?format=json&addressdetails=1&limit=1&polygon_svg=1](https://nominatim.openstreetmap.org/search/Unter%20den%20Linden%201%20Berlin?format=json&addressdetails=1&limit=1&polygon_svg=1)
206 "city_district": "Mitte",
207 "construction": "Unter den Linden",
208 "continent": "European Union",
209 "country": "Deutschland",
210 "country_code": "de",
212 "neighbourhood": "Scheunenviertel",
214 "public_building": "Kommandantenhaus",
225 "display_name": "Kommandantenhaus, 1, Unter den Linden, Scheunenviertel, Mitte, Berlin, 10117, Deutschland, European Union",
226 "importance": 0.73606775332943,
227 "lat": "52.51719785",
228 "licence": "Data \u00a9 OpenStreetMap contributors, ODbL 1.0. https://www.openstreetmap.org/copyright",
229 "lon": "13.3978352028938",
230 "osm_id": "15976890",
232 "place_id": "30848715",
233 "svg": "M 13.397511 -52.517283599999999 L 13.397829400000001 -52.517299800000004 13.398131599999999 -52.517315099999998 13.398159400000001 -52.517112099999999 13.3975388 -52.517080700000001 Z",
234 "type": "public_building"
238 ##### JSON with address details
240 [https://nominatim.openstreetmap.org/?addressdetails=1&q=bakery+in+berlin+wedding&format=json&limit=1](https://nominatim.openstreetmap.org/?addressdetails=1&q=bakery+in+berlin+wedding&format=json&limit=1)
245 "bakery": "B\u00e4cker Kamps",
246 "city_district": "Mitte",
247 "continent": "European Union",
248 "country": "Deutschland",
249 "country_code": "de",
250 "footway": "Bahnsteig U6",
251 "neighbourhood": "Sprengelkiez",
263 "display_name": "B\u00e4cker Kamps, Bahnsteig U6, Sprengelkiez, Wedding, Mitte, Berlin, 13353, Deutschland, European Union",
264 "icon": "https://nominatim.openstreetmap.org/images/mapicons/shopping_bakery.p.20.png",
267 "licence": "Data \u00a9 OpenStreetMap contributors, ODbL 1.0. https://www.openstreetmap.org/copyright",
269 "osm_id": "317179427",
271 "place_id": "1453068",
278 [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)
282 "type": "FeatureCollection",
283 "licence": "Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright",
288 "place_id": "35811445",
290 "osm_id": "2846295644",
291 "display_name": "17, Strada Pictor Alexandru Romano, Bukarest, Bucharest, Sector 2, Bucharest, 023964, Romania",
295 "importance": 0.62025
317 [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)
321 "type": "FeatureCollection",
324 "attribution": "Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright",
326 "query": "Αγία Τριάδα, Αδωνιδος, Athens, Greece"
333 "type": "place_of_worship",
334 "label": "Αγία Τριάδα, Αδωνιδος, Άγιος Νικόλαος, 5º Δημοτικό Διαμέρισμα Αθηνών, Athens, Municipality of Athens, Regional Unit of Central Athens, Region of Attica, Attica, 11472, Greece",
335 "name": "Αγία Τριάδα",