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 Filter 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 preferred. 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) |
192 The layer filter allows to select places by themes.
194 The `address` layer contains all places that make up an address:
195 address points with house numbers, streets, inhabited places (suburbs, villages,
196 cities, states tec.) and administrative boundaries.
198 The `poi` layer selects all point of interest. This includes classic POIs like
199 restaurants, shops, hotels but also less obvious features like recycling bins,
200 guideposts or benches.
202 The `railway` layer includes railway infrastructure like tracks.
203 Note that in Nominatim's standard configuration, only very few railway
204 features are imported into the database.
206 The `natural` layer collects features like rivers, lakes and mountains while
207 the `manmade` layer functions as a catch-all for features not covered by the
210 | Parameter | Value | Default |
211 |-----------| ----- | ------- |
212 | featureType | one of: `country`, `state`, `city`, `settlement` | _unset_ |
214 The featureType allows to have a more fine-grained selection for places
215 from the address layer. Results can be restricted to places that make up
216 the 'state', 'country' or 'city' part of an address. A featureType of
217 settlement selects any human inhabited feature from 'state' down to
220 When featureType is set, then results are automatically restricted
221 to the address layer (see above).
224 Instead of using the featureType filters `country`, `state` or `city`,
225 you can also use a structured query without the finer-grained parameters
228 | Parameter | Value | Default |
229 |-----------| ----- | ------- |
230 | exclude_place_ids | comma-separated list of place ids |
232 If you do not want certain OSM objects to appear in the search
233 result, give a comma separated list of the `place_id`s you want to skip.
234 This can be used to retrieve additional search results. For example, if a
235 previous query only returned a few results, then including those here would
236 cause the search to return other, less accurate, matches (if possible).
238 | Parameter | Value | Default |
239 |-----------| ----- | ------- |
240 | viewbox | `<x1>,<y1>,<x2>,<y2>` | _unset_ |
242 Boost parameter which focuses the search on the given area.
243 Any two corner points of the box are accepted as long as they make a proper
244 box. `x` is longitude, `y` is latitude.
246 | Parameter | Value | Default |
247 |-----------| ----- | ------- |
248 | bounded | 0 or 1 | 0 |
250 When set to 1, then it turns the 'viewbox' parameter (see above) into
251 a filter parameter, excluding any results outside the viewbox.
253 When `bounded=1` is given and the viewbox is small enough, then an amenity-only
254 search is allowed. Give the special keyword for the amenity in square
255 brackets, e.g. `[pub]` and a selection of objects of this type is returned.
256 There is no guarantee that the result returns all objects in the area.
261 | Parameter | Value | Default |
262 |-----------| ----- | ------- |
263 | polygon_geojson | 0 or 1 | 0 |
264 | polygon_kml | 0 or 1 | 0 |
265 | polygon_svg | 0 or 1 | 0 |
266 | polygon_text | 0 or 1 | 0 |
268 Add the full geometry of the place to the result output. Output formats
269 in GeoJSON, KML, SVG or WKT are supported. Only one of these
270 options can be used at a time.
272 | Parameter | Value | Default |
273 |-----------| ----- | ------- |
274 | polygon_threshold | floating-point number | 0.0 |
276 When one of the polygon_* outputs is chosen, return a simplified version
277 of the output geometry. The parameter describes the
278 tolerance in degrees with which the geometry may differ from the original
279 geometry. Topology is preserved in the geometry.
283 | Parameter | Value | Default |
284 |-----------| ----- | ------- |
285 | email | valid email address | _unset_ |
287 If you are making large numbers of request please include an appropriate email
288 address to identify your requests. See Nominatim's
289 [Usage Policy](https://operations.osmfoundation.org/policies/nominatim/) for more details.
291 | Parameter | Value | Default |
292 |-----------| ----- | ------- |
293 | dedupe | 0 or 1 | 1 |
295 Sometimes you have several objects in OSM identifying the same place or
296 object in reality. The simplest case is a street being split into many
297 different OSM ways due to different characteristics. Nominatim will
298 attempt to detect such duplicates and only return one match. Setting
299 this parameter to 0 disables this deduplication mechanism and
300 ensures that all results are returned.
302 | Parameter | Value | Default |
303 |-----------| ----- | ------- |
304 | debug | 0 or 1 | 0 |
306 Output assorted developer debug information. Data on internals of Nominatim's
307 "search loop" logic, and SQL queries. The output is HTML format.
308 This overrides the specified machine readable format.
314 ##### XML with KML polygon
316 * [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)
319 <?xml version="1.0" encoding="UTF-8" ?>
320 <searchresults timestamp="Tue, 08 Aug 2023 15:45:41 +00:00"
321 attribution="Data © OpenStreetMap contributors, ODbL 1.0. http://osm.org/copyright"
322 querystring="135 pilkington avenue, birmingham"
323 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"
324 exclude_place_ids="125279639">
325 <place place_id="125279639"
330 boundingbox="52.5487473,52.5488481,-1.8165130,-1.8163464"
333 display_name="135, Pilkington Avenue, Maney, Sutton Coldfield, Wylde Green, Birmingham, West Midlands Combined Authority, England, B72 1LH, United Kingdom"
336 importance="9.999999994736442e-08">
341 <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>
346 <house_number>135</house_number>
347 <road>Pilkington Avenue</road>
348 <hamlet>Maney</hamlet>
349 <town>Sutton Coldfield</town>
350 <village>Wylde Green</village>
351 <city>Birmingham</city>
352 <ISO3166-2-lvl8>GB-BIR</ISO3166-2-lvl8>
353 <state_district>West Midlands Combined Authority</state_district>
354 <state>England</state>
355 <ISO3166-2-lvl4>GB-ENG</ISO3166-2-lvl4>
356 <postcode>B72 1LH</postcode>
357 <country>United Kingdom</country>
358 <country_code>gb</country_code>
363 ##### JSON with SVG polygon
365 [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)
371 "ISO3166-2-lvl4": "DE-BE",
374 "country": "Deutschland",
375 "country_code": "de",
376 "historic": "Kommandantenhaus",
378 "neighbourhood": "Friedrichswerder",
380 "road": "Unter den Linden",
390 "display_name": "Kommandantenhaus, 1, Unter den Linden, Friedrichswerder, Mitte, Berlin, 10117, Deutschland",
391 "importance": 0.8135042058306902,
392 "lat": "52.51720765",
393 "licence": "Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright",
394 "lon": "13.397834399325466",
397 "place_id": 108681845,
398 "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",
404 ##### JSON with address details
406 [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)
412 "ISO3166-2-lvl4": "DE-BE",
415 "country": "Deutschland",
416 "country_code": "de",
417 "neighbourhood": "Sprengelkiez",
419 "road": "Lindower Straße",
423 "addresstype": "shop",
431 "display_name": "Ditsch, Lindower Straße, Sprengelkiez, Wedding, Mitte, Berlin, 13347, Deutschland",
432 "importance": 9.99999999995449e-06,
433 "lat": "52.54274275",
434 "licence": "Data © OpenStreetMap contributors, ODbL 1.0. http://osm.org/copyright",
435 "lon": "13.36690305710228",
439 "place_id": 204751033,
448 [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)
452 "type": "FeatureCollection",
453 "licence": "Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright",
458 "place_id": "35811445",
460 "osm_id": "2846295644",
461 "display_name": "17, Strada Pictor Alexandru Romano, Bukarest, Bucharest, Sector 2, Bucharest, 023964, Romania",
465 "importance": 0.62025
487 [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)
491 "type": "FeatureCollection",
494 "attribution": "Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright",
496 "query": "Αγία Τριάδα, Αδωνιδος, Athens, Greece"
503 "type": "place_of_worship",
504 "label": "Αγία Τριάδα, Αδωνιδος, Άγιος Νικόλαος, 5º Δημοτικό Διαμέρισμα Αθηνών, Athens, Municipality of Athens, Regional Unit of Central Athens, Region of Attica, Attica, 11472, Greece",
505 "name": "Αγία Τριάδα",