]> git.openstreetmap.org Git - nominatim.git/blob - docs/api/Details.md
ignore linked country nodes for reverse geocoding
[nominatim.git] / docs / api / Details.md
1 # Place details
2
3 Lookup details about a single place by id. The default output is HTML for debugging search logic and results.
4
5 **The details page (including JSON output) exists for debugging only and must not be downloaded automatically**, see [Nominatim Usage Policy](https://operations.osmfoundation.org/policies/nominatim/).
6
7
8 ## Parameters
9
10 The details API supports the following two request formats:
11
12 ```
13   https://nominatim.openstreetmap.org/details?osmtype=[N|W|R]&osmid=<value>
14 ```
15
16 Both parameters are required, the type is one of node(N), way(W) or relation(R).
17
18 Or
19
20 ```
21   https://nominatim.openstreetmap.org/details?placeid=<value>
22 ```
23
24 Placeids are assigned sequentially during Nominatim data import. The id for a place is different between Nominatim installation (servers) and changes when data gets reimported. Therefore it can't be used as permanent id and shouldn't be used in bug reports.
25
26
27 Additional optional parameters are explained below.
28
29 ### Output format
30
31 * `format=[html|json]`
32
33 See [Place Output Formats](Output.md) for details on each format. (Default: html)
34
35 * `json_callback=<string>`
36
37 Wrap json output in a callback function (JSONP) i.e. `<string>(<json>)`.
38 Only has an effect for JSON output formats.
39
40 * `pretty=[0|1]`
41
42 For JSON output will add indentation to make it more human-readable. (Default: 0)
43
44
45 ### Output details
46
47 * `addressdetails=[0|1]`
48
49 Include a breakdown of the address into elements. (Default for JSON: 0, for HTML: 1)
50
51 * `keywords=[0|1]`
52
53 Include a list of name keywords and address keywords (word ids). (Default: 0)
54
55 * `linkedplaces=[0|1]`
56
57 Include details of places higher in the address hierarchy. E.g. for a street this is usually the city, state, postal code, country. (Default: 1)
58
59 * `hierarchy=[0|1]`
60
61 Include details of places lower in the address hierarchy. E.g. for a city this usually a list of streets, suburbs, rivers. (Default for JSON: 0, for HTML: 1)
62
63 * `group_hierarchy=[0|1]`
64
65 For JSON output will group the places by type. (Default: 0)
66
67 * `polygon_geojson=[0|1]`
68
69 Include geometry of result. (Default for JSON: 0, for HTML: 1)
70
71 ### Language of results
72
73 * `accept-language=<browser language string>`
74
75 Preferred language order for showing result, overrides the value
76 specified in the "Accept-Language" HTTP header.
77 Either use a standard RFC2616 accept-language string or a simple
78 comma-separated list of language codes.
79
80
81 ## Examples
82
83 ##### HTML
84
85 [https://nominatim.openstreetmap.org/details.php?osmtype=W&osmid=38210407]()
86
87 ##### JSON
88
89 [https://nominatim.openstreetmap.org/details.php?osmtype=W&osmid=38210407&format=json]()
90
91
92 ```json
93 {
94   "place_id": 85993608,
95   "parent_place_id": 72765313,
96   "osm_type": "W",
97   "osm_id": 38210407,
98   "category": "place",
99   "type": "square",
100   "admin_level": "15",
101   "localname": "Pariser Platz",
102   "names": {
103     "name": "Pariser Platz",
104     "name:be": "Парыжская плошча",
105     "name:de": "Pariser Platz",
106     "name:es": "Plaza de París",
107     "name:he": "פאריזר פלאץ",
108     "name:ko": "파리저 광장",
109     "name:la": "Forum Parisinum",
110     "name:ru": "Парижская площадь",
111     "name:uk": "Паризька площа",
112     "name:zh": "巴黎廣場"
113   },
114   "addresstags": {
115     "postcode": "10117"
116   },
117   "housenumber": null,
118   "calculated_postcode": "10117",
119   "country_code": "de",
120   "indexed_date": "2018-08-18T17:02:45+00:00",
121   "importance": 0.339401620591472,
122   "calculated_importance": 0.339401620591472,
123   "extratags": {
124     "wikidata": "Q156716",
125     "wikipedia": "de:Pariser Platz"
126   },
127   "calculated_wikipedia": "de:Pariser_Platz",
128   "rank_address": 30,
129   "rank_search": 30,
130   "isarea": true,
131   "centroid": {
132     "type": "Point",
133     "coordinates": [
134       13.3786822618517,
135       52.5163654
136     ]
137   },
138   "geometry": {
139     "type": "Point",
140     "coordinates": [
141       13.3786822618517,
142       52.5163654
143     ]
144   }
145 }
146 ```