Skip to content

Administrative Division Autocomplete

POST location/autocomplete

Returns the administrative divisions which names start with the substring specified by the given query. Only available in CH.

Request#

Example Request#

curl -X POST  'https://api.pricehubble.com/api/v1/location/autocomplete' \
   -H "Authorization: Bearer LWkU3VwcJojIw7O8v8o39IQJPC2ptSdd" \
   -d '{
        "query": "zuri",
        "includeCantons": true,
        "language": "en",
      }'

Request Fields#

Field Description Type Remarks
query Query substring from which administrative division name should be started. Minimal length is 3 characters string Values examples Uri, zuri, Zurich, Zürich, Bern, 4001, 8003
includeCantons Whether to return cantons administrative divisions boolean Default value is false
language Optional language identifier string Valid values are en, de, fr and it. Default language is en

Response#

Example response#

{
    "language": "en",
    "totalItems": 2,
    "items": [
        {
            "name": "Zurich",
            "parents": "Zurich, Switzerland",
            "slug": "city-zurich",
            "divisionLevel": {
                "level": 8,
                "designation": "Gemeinde",
                "name": "Zürich",
                "officialId": "261"
            },
            "coordinates": {
                "latitude": 47.3768866,
                "longitude": 8.541694
            }
        },
        {
            "name": "Zurich (ZH)",
            "parents": "Switzerland",
            "slug": "canton-zurich",
            "divisionLevel": {
                "level": 4,
                "designation": "Kanton",
                "name": "Zürich",
                "officialId": "1"
            },
            "coordinates": {
                "latitude": 47.3768866,
                "longitude": 8.541694
            }
        }
    ]
}

The levels are based on the OSM administrative divisions.

Response Fields#

Field Description Type Remarks
name Name of the administrative division in language that specified with the language parameter of the request string
parents Description of the parent administrative divisions string
slug URL's slug of the administrative division in language that specified with the language parameter of the request string
divisionLevel The level division Division