]> git.openstreetmap.org Git - nominatim.git/blobdiff - docs/api/Details.md
Merge remote-tracking branch 'upstream/master'
[nominatim.git] / docs / api / Details.md
index 357b6a4b92ef6e3088d07c08777b11525c2db633..b5405c836e932ef38bc5296b42b55347a73d5476 100644 (file)
@@ -10,12 +10,18 @@ Lookup details about a single place by id. The default output is HTML for debugg
 The details API supports the following two request formats:
 
 ```
-  https://nominatim.openstreetmap.org/details?osmtype=[N|W|R]&osmid=<value>
+  https://nominatim.openstreetmap.org/details?osmtype=[N|W|R]&osmid=<value>&class=<value>
 ```
 
-Both parameters are required, the type is one of node(N), way(W) or relation(R).
-
-Or
+`osmtype` and `osmid` are required parameter. The type is one of node (N), way (W)
+or relation (R). The id must be a number. The `class` parameter is optional and
+allows to distinguish between entries, when the corresponding OSM object has more
+than one main tag. For example, when a place is tagged with `tourism=hotel` and
+`amenity=restaurant`, there will be two place entries in Nominatim, one for a
+restaurant, one for a hotel. You need to specify `class=tourism` or `class=amentity`
+to get exactly the one you want. If there are multiple places in the database
+but the `class` parameter is left out, then one of the places will be chosen
+at random and displayed.
 
 ```
   https://nominatim.openstreetmap.org/details?placeid=<value>
@@ -34,7 +40,7 @@ See [Place Output Formats](Output.md) for details on each format. (Default: html
 
 * `json_callback=<string>`
 
-Wrap json output in a callback function (JSONP) i.e. `<string>(<json>)`.
+Wrap JSON output in a callback function (JSONP) i.e. `<string>(<json>)`.
 Only has an effect for JSON output formats.
 
 * `pretty=[0|1]`
@@ -82,11 +88,11 @@ comma-separated list of language codes.
 
 ##### HTML
 
-[https://nominatim.openstreetmap.org/details.php?osmtype=W&osmid=38210407]()
+[https://nominatim.openstreetmap.org/details.php?osmtype=W&osmid=38210407](https://nominatim.openstreetmap.org/details.php?osmtype=W&osmid=38210407)
 
 ##### JSON
 
-[https://nominatim.openstreetmap.org/details.php?osmtype=W&osmid=38210407&format=json]()
+[https://nominatim.openstreetmap.org/details.php?osmtype=W&osmid=38210407&format=json](https://nominatim.openstreetmap.org/details.php?osmtype=W&osmid=38210407&format=json)
 
 
 ```json