Nominatim/docs/api/Details.md

153 lines
4.5 KiB
Markdown
Raw Normal View History

2018-08-21 18:15:47 +03:00
# Place details
Lookup details about a single place by id. The default output is HTML for debugging search logic and results.
2018-08-22 14:55:43 +03:00
**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/).
2018-08-21 18:15:47 +03:00
## Parameters
2018-08-22 14:55:43 +03:00
The details API supports the following two request formats:
2018-08-21 18:15:47 +03:00
```
https://nominatim.openstreetmap.org/details?osmtype=[N|W|R]&osmid=<value>&class=<value>
2018-08-21 18:15:47 +03:00
```
`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.
2018-08-21 18:15:47 +03:00
```
https://nominatim.openstreetmap.org/details?place_id=<value>
2018-08-21 18:15:47 +03:00
```
2018-08-22 14:55:43 +03:00
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.
2018-08-21 18:15:47 +03:00
Additional optional parameters are explained below.
### Output format
* `format=[html|json]`
See [Place Output Formats](Output.md) for details on each format. (Default: html)
* `json_callback=<string>`
2019-05-21 14:55:16 +03:00
Wrap JSON output in a callback function (JSONP) i.e. `<string>(<json>)`.
2018-08-21 18:15:47 +03:00
Only has an effect for JSON output formats.
2018-08-22 14:55:43 +03:00
* `pretty=[0|1]`
2018-08-21 18:15:47 +03:00
2018-08-22 14:55:43 +03:00
For JSON output will add indentation to make it more human-readable. (Default: 0)
2018-08-21 18:15:47 +03:00
### Output details
* `addressdetails=[0|1]`
Include a breakdown of the address into elements. (Default for JSON: 0, for HTML: 1)
* `keywords=[0|1]`
Include a list of name keywords and address keywords (word ids). (Default: 0)
* `linkedplaces=[0|1]`
2018-08-22 14:55:43 +03:00
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)
2018-08-21 18:15:47 +03:00
* `hierarchy=[0|1]`
2018-08-22 14:55:43 +03:00
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)
2018-08-21 18:15:47 +03:00
* `group_hierarchy=[0|1]`
For JSON output will group the places by type. (Default: 0)
* `polygon_geojson=[0|1]`
Include geometry of result. (Default for JSON: 0, for HTML: 1)
### Language of results
* `accept-language=<browser language string>`
2018-08-22 14:55:43 +03:00
Preferred language order for showing result, overrides the value
2018-08-21 18:15:47 +03:00
specified in the "Accept-Language" HTTP header.
Either use a standard RFC2616 accept-language string or a simple
comma-separated list of language codes.
## Examples
##### HTML
[https://nominatim.openstreetmap.org/details.php?osmtype=W&osmid=38210407](https://nominatim.openstreetmap.org/details.php?osmtype=W&osmid=38210407)
2018-08-21 18:15:47 +03:00
##### 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)
2018-08-21 18:15:47 +03:00
```json
{
"place_id": 85993608,
"parent_place_id": 72765313,
"osm_type": "W",
"osm_id": 38210407,
"category": "place",
"type": "square",
"admin_level": "15",
"localname": "Pariser Platz",
"names": {
"name": "Pariser Platz",
"name:be": "Парыжская плошча",
"name:de": "Pariser Platz",
"name:es": "Plaza de París",
"name:he": "פאריזר פלאץ",
"name:ko": "파리저 광장",
"name:la": "Forum Parisinum",
"name:ru": "Парижская площадь",
"name:uk": "Паризька площа",
"name:zh": "巴黎廣場"
},
"addresstags": {
"postcode": "10117"
},
"housenumber": null,
"calculated_postcode": "10117",
"country_code": "de",
"indexed_date": "2018-08-18T17:02:45+00:00",
"importance": 0.339401620591472,
"calculated_importance": 0.339401620591472,
"extratags": {
"wikidata": "Q156716",
"wikipedia": "de:Pariser Platz"
},
"calculated_wikipedia": "de:Pariser_Platz",
"rank_address": 30,
"rank_search": 30,
"isarea": true,
"centroid": {
"type": "Point",
"coordinates": [
13.3786822618517,
52.5163654
]
},
"geometry": {
"type": "Point",
"coordinates": [
13.3786822618517,
52.5163654
]
}
}
```