Administrative Division Names and Slugs
POST
location/names_slugs
Returns the names and the URL slugs for the specified administrative divisions.
The end point is in use for the search throw multiple locations either need extra data about locations to get URLs/names for the different languages.
Only available in CH
.
Request#
Example Request#
The example request contains two parameters: "slugs": ["city-bern"] - it is the slug for the city Bern, and "divisionLevels": [{"divisionLevel": 8,"officialId": 261}] - it is divisionLevel:officialId for the city Zürich. So the example result contains data for the both geolocations.
curl -X POST 'https://api.pricehubble.com/api/v1/location/names_slugs' \
-H "Authorization: Bearer LWkU3VwcJojIw7O8v8o39IQJPC2ptSdd" \
-d '{
"slugs": [
"city-bern"
],
"divisionLevels": [
{
"divisionLevel": 8,
"officialId": 261
}
]
}'
Request Fields#
Field | Description | Type | Remarks |
---|---|---|---|
slugs | Comma-separated list of the URL slugs | string | Value examples city-zurich , canton-bern . An empty list [] is allowed. |
divisionLevels | Comma-separated list of {"divisionLevel": divisionLevel , "officialId": officialId } |
string | Value examples {"divisionLevel": 4, "officialId": 3}, {"divisionLevel": 8, "officialId": 261}. An empty list [] is allowed. |
*Maximum total ammount of the locations, slugs and divisionLevels is 10
Response#
Example response#
[
{
"name": {
"de": "Bern",
"fr": "Berne",
"it": "Berna",
"en": "Bern"
},
"divisionLevel": {
"level": 8,
"designation": "Gemeinde",
"name": "Bern",
"officialId": "351"
},
"slug": {
"it": "luogo-berna",
"fr": "lieu-berne",
"en": "city-bern",
"de": "ort-bern"
},
"latitude": 46.9479739,
"longitude": 7.4474468
},
{
"name": {
"de": "Zürich",
"fr": "Zurich",
"it": "Zurigo",
"en": "Zurich"
},
"divisionLevel": {
"level": 8,
"designation": "Gemeinde",
"name": "Zürich",
"officialId": "261"
},
"slug": {
"it": "luogo-zurigo",
"fr": "lieu-zurich",
"en": "city-zurich",
"de": "ort-zuerich"
},
"latitude": 47.3768866,
"longitude": 8.541694
}
]
Response Fields#
Field | Description | Type | Remarks |
---|---|---|---|
divisionLevel | The level division | Division | |
name | Names of the administrative division in all supported languages | Name | Supported languages: "de", "en", "it" and "fr" |
slug | URL slugs of the administrative division in all supported languages | Slug | Supported languages: "de", "en", "it" and "fr" |
latitude | Latitude of the center point | float | |
longitude | Longitude of the center point | float |
Name#
Field | Description | Type | Remarks |
---|---|---|---|
de | Name in German language | string | |
en | Name in English language | string | |
fr | Name in Franch language | string | |
it | Name in Italian language | string |
Slug#
Field | Description | Type | Remarks |
---|---|---|---|
de | URL slug for German version | string | |
en | URL slug for English version | string | |
fr | URL slug for Franch version | string | |
it | URL slug for Italian version | string |