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