Address web services REST 2

Address web services REST 2

Close

    Address web services REST 2

    11. Description of obsolete methods

    11.1.1 QueryAutoComplete2

    AutoComplete is used to support users when entering non-personal addresses. The autocomplete request returns all address components found for an input when the user enters partial input. The address components that can be searched are towns, streets or buildings. The level of the query (towns, streets or buildings) is determined by the search request. 

    A term is considered a match if the search term occurs at the beginning of a word in a reference term (not case sensitive). If multiple search parameters are passed at the same time, all search criteria must be fulfilled. 

    Match type Search parameters

      Reference
      Field
    Value
     
    Full match

    Streetname

    Lindenstrasse

    Lindenstrasse

    (Not: Lindenweg)

    Match at beginning of word

    Streetname Linden

    Lindenstrasse

    Lindenweg

    (Not: Dorflindenstrasse)

    Match at beginning of a word in a substring

    Streetname

    Linden

    Ausser-Lindenegg

    In der Linden

    (Not: Unter-Blindenbach)

    Multiple search parameters at the same level

    Zipcode

    60

    6010 Kriens

    6047 Kastanienbaum

    (Not: 6048 Horw)

    (Not: 3098 Köniz)

    TownName

    K  
    Multiple search parameters at different levels

    Zipcode

    60

    Wiesenau, 6018 Buttisholz

    Obere Wiese, 6020 

    Emmenbrücke

      Streetname

    wies

    (Not: Wiesenstrasse, 5012 Schönenwerd)

    (Not: Haldenring, 6020 Emmenbrücke)

    Search for towns

    The following request for the “POST /autocomplete2” method searches for towns:

    {
      "request": {
        "Onrp": 0,
        "Zipcode": "817",
        "ZipAddition": "",
        "TownName": "n",
        "StrId": 0,
        "Streetname": "",
        "HouseKey": 0,
        "HouseNumber": "",
        "HouseNumberAddition": ""
      },
    "zipOrderMode":0
    }

    The service responds:

    {
     "QueryAutoCompleteResult": {
       "AutoCompleteResult":    [
           {
             "HouseKey": 0,
             "HouseNumber": "",
             "HouseNumberAddition": "",
             "Onrp": 4542,
             "StrId": 0,
             "Streetname": "",
             "TownName": "Niederglatt ZH",
             "ZipAddition": "00",
             "Zipcode": "8172"
          },
                {
             "HouseKey": 0,
             "HouseNumber": "",
             "HouseNumberAddition": "",
             "Onrp": 4543,
             "StrId": 0,
             "Streetname": "",
             "TownName": "Neerach",
             "ZipAddition": "00",
             "Zipcode": "8173"
          }
       ],
       "Status": 0
    }}

    11.1.2 Search for streets

    Multiple variants can be selected to search for streets.

    11.1.2.1 Search for streets without restriction to town

    This search variant searches all streets regardless of the town.

    Building

    HouseKey

    -

    HouseNumber

    O

    HouseNumberAdditon

    O

    Street

    Strld

    „0“

    Streetname

    X

    Town

    Onrp

    „0“

    Zipcode

    O

    ZipAddition

    -

    TownName

    O

    “0” = static value ‘0’ / O = empty / X = filled / - = no influence on search

    The following request for the “POST /autocomplete2” method searches for streets with no town restriction:

    <soapenv:Envelope xmlns:soapenv="https://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="https://tempuri.org/" xmlns:syn="https://schemas.datacontract.org/2004/07/SynSrvDataContracts">   <soapenv:Header/>   <soapenv:Body>      <tem:QueryAutoComplete2>         <tem:request>             <syn:HouseKey>0</syn:HouseKey>            <syn:HouseNumber></syn:HouseNumber>            <syn:HouseNumberAddition></syn:HouseNumberAddition>            <syn:Onrp>0</syn:Onrp>            <syn:StrId>0</syn:StrId>            <syn:Streetname>Alte Stationsstrasse</syn:Streetname>            <syn:TownName></syn:TownName>            <syn:ZipAddition></syn:ZipAddition>            <syn:Zipcode></syn:Zipcode>         </tem:request>         <tem:zipOrderMode>NumericAscending</tem:zipOrderMode>      </tem:QueryAutoComplete2>   </soapenv:Body></soapenv:Envelope>

    The service responds

    {
     "QueryAutoCompleteResult": {
       "AutoCompleteResult":    [
           {
             "HouseKey": 0,
             "HouseNumber": "",
             "HouseNumberAddition": "",
             "Onrp": 4530,
             "StrId": 24583,
             "Streetname": "Alte Stationsstrasse",
             "TownName": "Oberglatt ZH",
             "ZipAddition": "00",
             "Zipcode": "8154"
          },
                {
             "HouseKey": 0,
             "HouseNumber": "",
             "HouseNumberAddition": "",
             "Onrp": 5137,
             "StrId": 75022,
             "Streetname": "Alte Stationsstrasse",
             "TownName": "Bonstetten",
             "ZipAddition": "00",
             "Zipcode": "8906"
          },
               {
             "HouseKey": 0,
             "HouseNumber": "",
             "HouseNumberAddition": "",
             "Onrp": 4540,
             "StrId": 58009546,
             "Streetname": "Alte Stationsstrasse",
             "TownName": "Niederweningen",
             "ZipAddition": "00",
             "Zipcode": "8166"
          }
    
       ],
       "Status": 0
    }}

    11.1.3 Search for buildings

    Multiple variants can be selected to search for buildings

    11.1.3.1 Search for buildings without restriction to street or town

    This search variant searches all buildings regardless of town or street.

    Building

    HouseKey

    -

    HouseNumber

    X*

    HouseNumberAdditon

    X*

    Street

    Strld

    „0“

    Streetname

    O

    Town

    Onrp

    „0“

    Zipcode

    O

    ZipAddition

    -

    TownName

    O

    “0” = static value ‘0’ / O = empty / X = filled / - = no influence on search 
    * House number can be empty if house number addition entered or house number addition can be empty if house number entered

    The following request for the “POST /autocomplete2” method searches for buildings with no town or street restriction:
    {
      "request": {
        "Onrp": 0,
        "Zipcode": "",
        "ZipAddition":"",
        "TownName": "",
        "StrId": 0,
        "Streetname": "",
        "HouseKey": 0,
        "HouseNumber": "105",
        "HouseNumberAddition": "N"
      },
    "zipOrderMode":0
    }

    The service responds

    {
     "QueryAutoCompleteResult": {
       "AutoCompleteResult":    [
           {
             "HouseKey": 76190424,
             "HouseNumber": "105",
             "HouseNumberAddition": "N",
             "Onrp": 3589,
             "StrId": 72028859,
             "Streetname": "quartiere Nef",
             "TownName": "Lostallo",
             "ZipAddition": "00",
             "Zipcode": "6558"      
          },
         {
             "HouseKey": 30039869,
             "HouseNumber": "105",
             "HouseNumberAddition": "N",
             "Onrp": 1634,
             "StrId": 30022575,
             "Streetname": "le Chênois",
             "TownName": "Charmoille",
             "ZipAddition": "00",
             "Zipcode": "2947"      
          },
          {
             "HouseKey": 76243990,
             "HouseNumber": "105",
             "HouseNumberAddition": "N",
             "Onrp": 1632,
             "StrId": 30001307,
             "Streetname": "sur le Creux de Loups",
             "TownName": "Bonfol",
             "ZipAddition": "00",
             "Zipcode": "2944"      
          }
       ],
       "Status": 0
    }}

    11.1.3.2 Search for buildings with restriction to street using search terms

    This search variant searches all buildings within matching streets.

    Building

    HouseKey

    -

    HouseNumber

    X*

    HouseNumberAdditon

    X*

    Street

    Strld

    „0“

    Streetname

    X

    Town

    Onrp

    „0“

    Zipcode

    O

    ZipAddition

    -

    TownName

    O

    “0” = static value ‘0’ / O = empty / X = filled / - = no influence on search 
    * House number can be empty if house number addition entered or house number addition can be empty if house number entered

    The following request for the “POST /autocomplete2” method searches for buildings with restriction to street:
    {
      "request": {
        "Onrp": 0,
        "Zipcode": "",
        "ZipAddition":"",
        "TownName": "",
        "StrId": 0,
        "Streetname": "le",
        "HouseKey": 0,
        "HouseNumber": "105",
        "HouseNumberAddition": "N"
      },
    "zipOrderMode":0
    }

    The service responds

    {
     "QueryAutoCompleteResult": {
       "AutoCompleteResult":    [       
         {
             "HouseKey": 30039869,
             "HouseNumber": "105",
             "HouseNumberAddition": "N",
             "Onrp": 1634,
             "StrId": 30022575,
             "Streetname": "le Chênois",
             "TownName": "Charmoille",
             "ZipAddition": "00",
             "Zipcode": "2947"      
          },
          {
             "HouseKey": 76243990,
             "HouseNumber": "105",
             "HouseNumberAddition": "N",
             "Onrp": 1632,
             "StrId": 30001307,
             "Streetname": "sur le Creux de Loups",
             "TownName": "Bonfol",
             "ZipAddition": "00",
             "Zipcode": "2944"      
          }
       ],
       "Status": 0
    }}

    11.1.3.3 Search for buildings with restriction to town using search terms

    This search variant searches all buildings within matching towns. 

    Building

    HouseKey

    -

    HouseNumber

    X*

    HouseNumberAdditon

    X*

    Street

    Strld

    „0“

    Streetname

    O

    Town

    Onrp

    „0“

    Zipcode

    X**

    ZipAddition

    TownName

    X**

    “0” = static value ‘0’ / O = empty / X = filled / - = no influence on search 
    * House number can be empty if house number addition entered or house number addition can be empty if house number entered 
    ** Postcode can be empty if town entered, or town can be empty if postcode entered 

    The following request for the “POST /autocomplete2” method searches for buildings with restriction to towns:
    {
      "request": {
        "Onrp": 0,
        "Zipcode": "",
        "ZipAddition":"",
        "TownName": "zh",
        "StrId": 0,
        "Streetname": "",
        "HouseKey": 0,
        "HouseNumber": "105",
        "HouseNumberAddition": "b"
      },
    "zipOrderMode":0
    }

    The service responds

    {
     "QueryAutoCompleteResult": {
       "AutoCompleteResult":    [       
         {
             "HouseKey": 57524080,
             "HouseNumber": "105",
             "HouseNumberAddition": "B",
             "Onrp": 4659,
             "StrId": 26183,
             "Streetname": "Russikerstrasse",
             "TownName": "Pfäffikon ZH",
             "ZipAddition": "00",
             "Zipcode": "8330"      
          },
          {
             "HouseKey": 76428690,
             "HouseNumber": "105",
             "HouseNumberAddition": "B",
             "Onrp": 4990,
             "StrId": 28408,
             "Streetname": "Lerchenbergstrasse",
             "TownName": "Erlenbach ZH",
             "ZipAddition": "00",
             "Zipcode": "8703"      
          }
       ],
       "Status": 0
    }}

    11.1.3.4 Search for buildings with restriction to exactly one street

    This search variant searches all buildings within a single street. The street is defined using the StrId.  

    Building

    HouseKey

    -

    HouseNumber

    X*

    HouseNumberAdditon

    X*

    Street

    Strld

    X

    Streetname

    -**

    Town

    Onrp

    -

    Zipcode

    -**

    ZipAddition

    -**

    TownName

    -**

    “0” = static value ‘0’ / O = empty / X = filled / - = no influence on search 
    * House number can be empty if house number addition entered or house number addition can be empty if house number entered 
    ** When an StrId number is specified, these search parameters are ignored, even if a value is entered

    The following request for the “POST /autocomplete2” method searches for buildings with restriction to street:
    {
      "request": {
        "Onrp": 0,
        "Zipcode": "",
        "ZipAddition":"",
        "TownName": "",
        "StrId": 75022,
        "Streetname": "",
        "HouseKey": 0,
        "HouseNumber": "1",
        "HouseNumberAddition": ""
      },
    "zipOrderMode":0
    }

    The service responds

    {
     "QueryAutoCompleteResult": {
       "AutoCompleteResult":    [       
         {
             "HouseKey": 57513045,
             "HouseNumber": "10",
             "HouseNumberAddition": "",
             "Onrp": 5137,
             "StrId": 75022,
             "Streetname": "Alte Stationsstrasse",
             "TownName": "Bonstetten",
             "ZipAddition": "00",
             "Zipcode": "8906"      
          },
          {
             "HouseKey": 57513049,
             "HouseNumber": "14",
             "HouseNumberAddition": "",
             "Onrp": 5137,
             "StrId": 75022,
             "Streetname": "Alte Stationsstrasse",
             "TownName": "Bonstetten",
             "ZipAddition": "00",
             "Zipcode": "8906"      
          },
          {
             "HouseKey": 57513051,
             "HouseNumber": "16",
             "HouseNumberAddition": "",
             "Onrp": 5137,
             "StrId": 75022,
             "Streetname": "Alte Stationsstrasse",
             "TownName": "Bonstetten",
             "ZipAddition": "00",
             "Zipcode": "8906"      
          },
          {
             "HouseKey": 76129508,
             "HouseNumber": "11",
             "HouseNumberAddition": "",
             "Onrp": 5137,
             "StrId": 75022,
             "Streetname": "Alte Stationsstrasse",
             "TownName": "Bonstetten",
             "ZipAddition": "00",
             "Zipcode": "8906"      
          },
          {
             "HouseKey": 76200318,
             "HouseNumber": "12",
             "HouseNumberAddition": "A",
             "Onrp": 5137,
             "StrId": 75022,
             "Streetname": "Alte Stationsstrasse",
             "TownName": "Bonstetten",
             "ZipAddition": "00",
             "Zipcode": "8906"      
          },
          {
             "HouseKey": 76200319,
             "HouseNumber": "12",
             "HouseNumberAddition": "B",
             "Onrp": 5137,
             "StrId": 75022,
             "Streetname": "Alte Stationsstrasse",
             "TownName": "Bonstetten",
             "ZipAddition": "00",
             "Zipcode": "8906"      
          }
       ],
       "Status": 0
    }}

    11.1.3.5 Search for buildings with restriction to street and town using search terms

    This search variant searches all buildings within matching streets and towns.

    Building

    HouseKey

    -

    HouseNumber

    X*

    HouseNumberAdditon

    X*

    Street

    Strld

    „0“

    Streetname

    X

    Town

    Onrp

    „0“

    Zipcode

    X**

    ZipAddition

    TownName

    X**

    “0” = static value ‘0’ / O = empty / X = filled / - = no influence on search 
    * House number can be empty if house number addition entered or house number addition can be empty if house number entered 
    ** Postcode can be empty if town entered, or town can be empty if postcode entered

    The following request for the “POST /autocomplete2” method searches for buildings with restriction to street and town:
    {
      "request": {
        "Onrp": 0,
        "Zipcode": "8",
        "ZipAddition":"",
        "TownName": "w",
        "StrId": 0,
        "Streetname": "weg",
        "HouseKey": 0,
        "HouseNumber": "15",
        "HouseNumberAddition": ""
      },
    "zipOrderMode":0
    }

    The service responds

    {
     "QueryAutoCompleteResult": {
       "AutoCompleteResult":    [       
         {
             "HouseKey": 57002169,
             "HouseNumber": "15",
             "HouseNumberAddition": "",
             "Onrp": 5064,
             "StrId": 29692,
             "Streetname": " Karl-Stamm-Weg ",
             "TownName": "Wädenswil",
             "ZipAddition": "00",
             "Zipcode": "8820"      
          },
          {
             "HouseKey": 58139878,
             "HouseNumber": "15",
             "HouseNumberAddition": "",
             "Onrp": 5064,
             "StrId": 29692,
             "Streetname": "Julius-Hauser-Weg",
             "TownName": "Wädenswil",
             "ZipAddition": "00",
             "Zipcode": "8820"      
          },
          {
             "HouseKey": 57231933,
             "HouseNumber": "15",
             "HouseNumberAddition": "",
             "Onrp": 4690,
             "StrId": 67626,
             "Streetname": "Salomon-Bleuler-Weg",
             "TownName": "Winterthur",
             "ZipAddition": "00",
             "Zipcode": "8400"      
          },
          {
             "HouseKey": 76267671,
             "HouseNumber": "15",
             "HouseNumberAddition": "",
             "Onrp": 4710,
             "StrId": 76118558,
             "Streetname": "Maria-Kübler-Weg",
             "TownName": "Winterthur",
             "ZipAddition": "00",
             "Zipcode": "8406"      
          }
    
    
       ],
       "Status": 0
    }}

    11.1.4 zipOrderMode

    The zipOrderMode element can be used to define how the output is sorted. There are three different modes:

    Mode

    Value in JSON request Effect
    NumericAscending

    0 The output is sorted in ascending order according to postcode. All hits are displayed.

    ZipTypeNotPoBox

    1 The output is sorted based on the postcode type. The P.O. Box postcodes are displayed at the end.

    ZipPoBox

    2 The output is sorted based on the postcode type. The P.O. Box postcodes are displayed at the start.

     

    11.2 BuildingVerification

    With BuildingVerification, a non-personalized address can be checked for accuracy. If the address is accurate, the house key and the address are entered with the Swiss Post spelling.

    Request

    GET\ buildingverification2?streetname={streetname}&houseno={houseNo}&housenoaddition={houseNoAddition}&zipcode={zipcode}&townName={townname}

    Parameters

    The following parameters can also be entered: 

    Element Data type Description
    streetname
    String
    Street name
    houseNo
    String
    House number
    houseNoAddition
    String
    Additional house number information
    zipcode
    String
    Postcode
    townname
    String
    Town name

    Response

    {
        "QueryBuildingVerification2Result": {
            "BuildingVerificationData": {
                "Canton": "LU",
                "CountryCode": "CH",
                "HouseKey": 165890,
                "HouseNo": "2",
                "HouseNoAddition": "",
                "ONRP": "3290",
                "PSTAT": 2,
                "STRID": "908074",
                "StreetName": "Höchweid",
                "TownName": "Werthenstein",
                "ZipAddition": "00",
                "ZipCode": "6106"
            },
            "Status": 0
        }
    }
    Property Meaning
    Housekey

    Unique building key

    HouseNumber

    House number

    HouseNumberAddition

    House number supplement

    HouseNumberHouseNumberAddition

    House number complete

    Pstat

    Postal validation status

    Streetname

    Street name

    StreetnameLong

    Street name

    TownName

    Town name

    TownNameLong

    Town name

    ZipAddition

    Postcode addition (fifth and sixth 

    digit)

    Zipcode

    Four-digit postcode