Nominatim/docs/api/Details.md

181 lines
5.4 KiB
Markdown
Raw Normal View History

2018-08-21 18:15:47 +03:00
# Place details
Show all details about a single place saved in the database.
2018-08-21 18:15:47 +03:00
2023-08-29 13:14:44 +03:00
This API endpoint is meant for visual inspection of the data in the database,
mainly together with [Nominatim-UI](https://github.com/osm-search/nominatim-ui/).
2023-08-28 11:31:58 +03:00
The parameters of the endpoint and the output may change occasionally between
versions of Nominatim. Do not rely on the output in scripts or applications.
!!! warning
2023-08-28 11:31:58 +03:00
The details endpoint at https://nominatim.openstreetmap.org
may not used in scripts or bots at all.
See [Nominatim Usage Policy](https://operations.osmfoundation.org/policies/nominatim/).
2018-08-21 18:15:47 +03:00
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
``` xml
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 parameters. 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
``` xml
https://nominatim.openstreetmap.org/details?place_id=<value>
2018-08-21 18:15:47 +03:00
```
Place IDs 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 cannot be used as
a permanent id and shouldn't be used in bug reports.
2018-08-21 18:15:47 +03:00
2023-08-28 11:31:58 +03:00
!!! danger "Deprecation warning"
The API can also be used with the URL
`https://nominatim.openstreetmap.org/details.php`. This is now deprecated
and will be removed in future versions.
2018-08-21 18:15:47 +03:00
2023-08-28 11:31:58 +03:00
## Parameters
This section lists additional optional parameters.
2018-08-21 18:15:47 +03:00
### Output format
2023-08-28 11:31:58 +03:00
| Parameter | Value | Default |
|-----------| ----- | ------- |
| json_callback | function name | _unset_ |
2018-08-21 18:15:47 +03:00
2023-08-29 13:14:44 +03:00
When set, then JSON output will be wrapped in a callback function with
2023-08-28 11:31:58 +03:00
the given name. See [JSONP](https://en.wikipedia.org/wiki/JSONP) for more
information.
2018-08-21 18:15:47 +03:00
### Output details
2023-08-28 11:31:58 +03:00
| Parameter | Value | Default |
|-----------| ----- | ------- |
| addressdetails | 0 or 1 | 0 |
2018-08-21 18:15:47 +03:00
2023-08-28 11:31:58 +03:00
When set to 1, include a breakdown of the address into elements.
2018-08-21 18:15:47 +03:00
2023-08-28 11:31:58 +03:00
| Parameter | Value | Default |
|-----------| ----- | ------- |
| keywords | 0 or 1 | 0 |
2018-08-21 18:15:47 +03:00
2023-08-28 11:31:58 +03:00
When set to 1, include a list of name keywords and address keywords
in the result.
2018-08-21 18:15:47 +03:00
2023-08-28 11:31:58 +03:00
| Parameter | Value | Default |
|-----------| ----- | ------- |
| linkedplaces | 0 or 1 | 1 |
2018-08-21 18:15:47 +03:00
2023-08-28 11:31:58 +03:00
Include details of places that are linked with this one. Places get linked
together when they are different forms of the same physical object. Nominatim
links two kinds of objects together: place nodes get linked with the
corresponding administrative boundaries. Waterway relations get linked together with their
members.
2018-08-21 18:15:47 +03:00
2023-08-28 11:31:58 +03:00
| Parameter | Value | Default |
|-----------| ----- | ------- |
| hierarchy | 0 or 1 | 0 |
2024-09-15 17:08:26 +03:00
Include details of POIs and address that depend on the place. Only POIs
that use this place to determine their address will be returned.
2018-08-21 18:15:47 +03:00
2023-08-28 11:31:58 +03:00
| Parameter | Value | Default |
|-----------| ----- | ------- |
| group_hierarchy | 0 or 1 | 0 |
2018-08-21 18:15:47 +03:00
2023-08-28 11:31:58 +03:00
When set to 1, the output of the address hierarchy will be
grouped by type.
2018-08-21 18:15:47 +03:00
2023-08-28 11:31:58 +03:00
| Parameter | Value | Default |
|-----------| ----- | ------- |
| polygon_geojson | 0 or 1 | 0 |
2018-08-21 18:15:47 +03:00
2023-08-28 11:31:58 +03:00
Include geometry of result.
2018-08-21 18:15:47 +03:00
### Language of results
2023-08-28 11:31:58 +03:00
| Parameter | Value | Default |
|-----------| ----- | ------- |
| accept-language | browser language string | content of "Accept-Language" HTTP header |
2018-08-21 18:15:47 +03:00
2023-08-28 11:31:58 +03:00
Preferred language order for showing search results. This may either be
a simple comma-separated list of language codes or have the same format
as the ["Accept-Language" HTTP header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language).
2018-08-21 18:15:47 +03:00
## Examples
##### JSON
2024-09-15 17:08:26 +03:00
[https://nominatim.openstreetmap.org/details?osmtype=W&osmid=38210407&format=json](https://nominatim.openstreetmap.org/details?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
]
}
}
```