Obtaining international regions

This tutorial shows you how you obtain international regions, which you need for creating international realestates.

Since we don't geocode international realestate, we work with a country code and region name instead. This tutorial shows you how to obtain these values by our geohierarchy rest api.

You don't need an extra permission for using this api.

In order to create an international realestate, you will need:

  1. country code. The geohierarchy api does not hand it over, yet. Until then, you can take the country code from the official ISO-List
  2. region name. Follow the steps below to obtain it:

Method: GET,
Request URL:

1
https://rest.immobilienscout24.de/restapi/api/gis/v1.0/continent/{continent-id}/country/{country-id}/region/

Stepwise approach:

  • get the continent id with the get request

    1
    https://rest.immobilienscout24.de/restapi/api/gis/v1.0/continent
    

    Take the continentid from the response. e.g "1" for Europe

1
2
3
4
5
6
7
8
9
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<gis:continents xmlns:common="http://rest.immobilienscout24.de/schema/common/1.0" xmlns:gis="http://rest.immobilienscout24.de/schema/platform/gis/1.0" xmlns:xlink="http://www.w3.org/1999/xlink">
  <Continent xlink:href="http://rest.immobilienscout24.de/restapi/api/gis/v1.0/continent/1" id="1" label="Europa"/>
  <Continent xlink:href="http://rest.immobilienscout24.de/restapi/api/gis/v1.0/continent/2" id="2" label="Asien"/>
  <Continent xlink:href="http://rest.immobilienscout24.de/restapi/api/gis/v1.0/continent/3" id="3" label="Afrika"/>
  <Continent xlink:href="http://rest.immobilienscout24.de/restapi/api/gis/v1.0/continent/4" id="4" label="Amerika"/>
  <Continent xlink:href="http://rest.immobilienscout24.de/restapi/api/gis/v1.0/continent/5" id="5" label="Australien"/>
  <Continent xlink:href="http://rest.immobilienscout24.de/restapi/api/gis/v1.0/continent/6" id="6" label="Antarktika"/>
</gis:continents>
  • get the country id with the GET request

    1
    https://rest.immobilienscout24.de/restapi/api/gis/v1.0/continent/1/country
    

    Take the country id "40" from the response (we've shortened it):

1
2
3
4
5
6
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<gis:countries xmlns:common="http://rest.immobilienscout24.de/schema/common/1.0" xmlns:gis="http://rest.immobilienscout24.de/schema/platform/gis/1.0" xmlns:xlink="http://www.w3.org/1999/xlink">
  <Country xlink:href="http://rest.immobilienscout24.de/restapi/api/gis/v1.0/continent/1/country/8" id="8" label="Albanien"/>
  <Country xlink:href="http://rest.immobilienscout24.de/restapi/api/gis/v1.0/continent/1/country/20" id="20" label="Andorra"/>
  <Country xlink:href="http://rest.immobilienscout24.de/restapi/api/gis/v1.0/continent/1/country/40" id="40" label="Österreich"/>
</gis:countries>
  • get the region name with the GET request

    1
    https://rest.immobilienscout24.de/restapi/api/gis/v1.0/continent/1/country/40/region
    

    Take the region name from the response:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<gis:regions xmlns:common="http://rest.immobilienscout24.de/schema/common/1.0" xmlns:gis="http://rest.immobilienscout24.de/schema/platform/gis/1.0" xmlns:xlink="http://www.w3.org/1999/xlink">
  <Region xlink:href="http://rest.immobilienscout24.de/restapi/api/gis/v1.0/continent/1/country/40/region/1" id="1" label="Burgenland"/>
  <Region xlink:href="http://rest.immobilienscout24.de/restapi/api/gis/v1.0/continent/1/country/40/region/2" id="2" label="Kärnten"/>
  <Region xlink:href="http://rest.immobilienscout24.de/restapi/api/gis/v1.0/continent/1/country/40/region/3" id="3" label="Niederösterreich"/>   
  <Region xlink:href="http://rest.immobilienscout24.de/restapi/api/gis/v1.0/continent/1/country/40/region/4" id="4" label="Oberösterreich"/>  
  <Region xlink:href="http://rest.immobilienscout24.de/restapi/api/gis/v1.0/continent/1/country/40/region/5" id="5" label="Salzburg"/>
  <Region xlink:href="http://rest.immobilienscout24.de/restapi/api/gis/v1.0/continent/1/country/40/region/6" id="6" label="Steiermark"/>
  <Region xlink:href="http://rest.immobilienscout24.de/restapi/api/gis/v1.0/continent/1/country/40/region/7" id="7" label="Tirol"/>
  <Region xlink:href="http://rest.immobilienscout24.de/restapi/api/gis/v1.0/continent/1/country/40/region/8" id="8" label="Vorarlberg"/>
  <Region xlink:href="http://rest.immobilienscout24.de/restapi/api/gis/v1.0/continent/1/country/40/region/9" id="9" label="Wien"/>
</gis:regions>