Skip to content

Administrative Divisions

POST location/divisions

Returns the administrative divisions which enclose the point specified by the given coordinates or by the given address.

The levels are based on the OSM administrative divisions. The following tables show the level designations for each country.

AT:

Level Level Designation Example
(Local) Name Official ID
4 Bundesland Burgenland 1
6 Politischer Bezirk Eisenstadt(Stadt) 101
8 Gemeinde Eisenstadt 10101
100 Postleitzahl 7000 7000

CH:

Level Level Designation Example
English German French Italian (Local) Name Official ID
4 Canton Kanton Canton Cantone Zürich 1
6 District Bezirk District Distretto Zürich 112
8 Municipality Gemeinde Commune Comune Zürich 261
100 Postal code Postleitzahl Code postal Codice postale Zürich 8001

DE:

Level Level Designation Example
(Local) Name Official ID
4 Bundesland Hamburg 02
6 Landkreis / Kreis / Kreisfreie Stadt / Stadtkreis Hamburg 02000
8 Stadt / Gemeinde Hamburg 020000000000
11 Stadtviertel HafenCity 02000000034
100 Postleitzahl 20354 20354

FR:

Level Level Designation Example
(Local) Name Official ID
4 Region Île-de-France 11
6 Département Paris 75
8 Commune Paris 75056
9 Arrondissement Paris 7e Arrondissement 75107
11 IRIS Champ de Mars 751072812
100 Code postal 75013 75013

NL:

Level Level Designation Example
(Local) Name Official ID
4 Provincie Noord-Holland Noord-Holland
8 Gemeente Amsterdam Amsterdam
100 Postcode 1012 1012

Request#

Example Request:

curl -X POST 'https://api.pricehubble.com/api/v1/location/divisions?access_token=74126eab0a9048d993bda4b1b55ae074' \
  -H 'Content-Type: application/json' \
  -d '{
    "location": {
      "coordinates": {
        "latitude": 47.3968601,
        "longitude": 8.5153549
      },
      "address": {
        "postCode": "8037",
        "city": "Zurich",
        "street": "Nordstrasse",
        "houseNumber": "391"
      }
    },
    "countryCode": "CH"
}'
Field Description Type Remarks
location Location for which information should be retrieved Location
countryCode ISO country code string AT, CH, DE, FR and NL are currently supported

Response#

{
  "coordinates": {
    "latitude": 47.3968601,
    "longitude": 8.5153549
  },
  "divisionLevel4": {
    "officialId": "1",
    "name": "Zürich",
    "levelDesignation": "Kanton",
    "geometry": {
      "coordinates": [
        [8.41007342863389, 47.2483758360245],
        ...
      ],
      "type": "Polygon"
    }
  },
  "divisionLevel6": {
    "officialId": "112",
    "name": "Zürich",
    "levelDesignation": "Bezirk",
    "geometry": {
      "coordinates": [
        [8.59715430748838, 47.4060055090607],
        ...
      ],
      "type": "Polygon"
    }
  },
  "divisionLevel8": {
    "officialId": "261",
    "name": "Zürich",
    "levelDesignation": "Stadt",
    "geometry": {
      "coordinates": [
        [8.5736748773714, 47.4200362257283],
        ...
      ],
      "type": "Polygon"
    }
  },
  "divisionLevel100": {
    "officialId": "8037",
    "name": "8037",
    "levelDesignation": "Postleitzahl",
    "geometry": {
      "coordinates": [
        [8.51312630529578, 47.3944516312076],
        ...
      ],
      "type": "Polygon"
    }
  }
}
Field Description Type Remarks
coordinates Coordinates resolved from the address specified in the request (or coordinates from the request if they have been provided) Coordinates
divisionLevel4 The level 4 division Division
divisionLevel6 The level 6 division Division Not supported in NL
divisionLevel8 The level 8 division Division
divisionLevel9 The level 9 division Division Only available in FR
divisionLevel11 The level 11 division Division Only available in FR and DE
divisionLevel100 The level 100 division Division

Division#

Field Description Type Remarks
officialId The official ID of the administrative division as defined by the administration/government string
name The name of the administrative division string The name is returned in the local language (e.g. "Genève" and not "Geneva" is returned)
levelDesignation The administrative division level designation string The designation is returned in the local language (e.g. "Stadt" and not "City" is returned for the city of Zürich)
geometry The geometry of the administrative division GeoJSON Polygon or GeoJSON MultiPolygon.