Try It!

Suggest Address

This endpoint returns suggestions of addresses in a specific country given certain search parameters - usually used for "autocomplete" purposes to help a user type a valid address into a form/input field.

Endpoint URL

(GET) https://app-api.geposit.se/v2.0/suggest/address/{COUNTRY_CODE}

where {COUNTRY_CODE} is replaced with one of the following supported country codes:

  • se (Sweden)
  • no (Norway)
  • dk (Denmark)
  • fi (Finland)

Supported parameters

Query parameterValue
api_keyRequired
A valid API key
queryRequired
The query string that will be used to filter what address suggestions to fetch.

Example:
query=Storg Returns addresses that begins with Storg
max_rowsThe maximum number of suggestions that should be returned.
Possible values are 1 to 100.
Default value is 15.

Example: query=Storg&max_rows=20 Returns 20 streets in Sweden beginning with storg.
response_formatSets the format for the API response. The following values are supported:
_ xml
_ json (default)
* text
postcodeFilter results to only return addresses with a certain postcode or where the postcode begins with a pattern.

Example:
query=Storg&postcode=11217
query=Storg&postcode=112*

* In case you're not providing a full postcode the asterix must be used as a suffix after the postcode parameter value
localityFilter results to only return addresses with a certain locality or where the locality begins with a pattern.

Example:
query=Storg&locality=Falun
query=Storg&locality=Fal*

* In case you're not providing a full locality the asterix must be used as a suffix after the locality parameter value
street_numberFilter results to only return addresses with a certain street number.

Example:
query=Storg&street_number=12
extra_numberFilter results to only return addresses with a certain secondary street number.

Example:
query=Landsvägen&street_number=12&extra_number=102
letterFilter results to only return addresses with a certain letter.

Example:
query=Storgatan&street_number=12&letter=A
administrativeIncludes the administrative division relations for the address in the response.
_ true
_ false (Default value)

See Glossary for list of supported administrative divisions in each country
coordinateIncludes the coordinate for the address in the response.
_ true
_ false (Default value)
property_designationIncludes property designation for Swedish addresses (Fastighetsbeteckning).
true
false (Default value)
uuidIncludes the uuid for the address in the response.
_ true
_ false (Default value)
groupReturns results as groups of suggestions. (A group is a collection of suggstion objects).
_ true
_ false (Default value)
Example Group Object:
{
"address_type": "NC",
"street": "Aareavaara",
"postcode": "98491",
"locality": "Pajala",
"group_path": "lps|Pajala|98491|Aareavaara",
"group_count": 70
},
group_pathFilter results to only return addresses within a certain group.
Example:
query=Aa&group_path=lps|Pajala|98491|Aareavaara
street_number_prefixEnsures that the response strictly focuses on only considering the prefix values of street numbers when matching the provided street number.
Example:
When 10 is sent as the street number,
_ true Will return addresses with street numbers such as, 10,105,1005
_ false (Default value) Will return addresses only with the street number as 10.

Note
To be able to request uuid attribute, you need to have a specific permission.

Response

KeyValue TypeValue description
versionStringThe API version
suggestionsArrayAn array with zero or more suggestion objects (referenced below)
If the suggestions array is empty it means that no suggestions were found.

If an invalid request was sent suggestions will be replaced with a status_code and status_text attribute. - status (Integer)

Status code that gives detailed information about the suggest result. This code details both general errors and detailed suggest errors.

  • status_text (String)
    The description of the corresponding status code that gives detailed information about the suggest result.

Suggestion object

KeyValue typeValue description
streetStringStreet name
street_numberStringStreet number
extra_numberStringAdditional/extra street number *

* Some addresses have dual street number attributing, e.g. Landsbyvägen 2-220. In these cases street_number will be 2 and extra_number will be 220
letterStringLetter used in street number attribution, e.g. Storgatan 12A
postcodeStringPostal code of the address
localityStringLocality / city of the address
latitudeFloatLatitude of the address if existing
longitudeFloatLongitude of the address if existing
property_designationStringIncludes property designation for Swedish addresses (Fastighetsbeteckning).
adm_codeStringAdministrative code for levels 1-5

See Glossary for list of supported administrative divisions in each country
adm_nameStringAdministrative name for levels 1-5

See Glossary for list of supported administrative divisions in each country

Note
Sometimes, you might see an additional parameters like street_alt and locality_alt in the response for suggestion requests against Finland (country code: fi). These attributes represent the alternative street name and alternative locality names which comes in Swedish language.

Also it is possible to use Swedish address names on suggestion requests against Finland (country code: fi).

Localisation object

localeStringLocale for this translation
streetStringTranslation for street
localityStringTranslation for locality

Examples

Example - A default request

curl https://app-api.geposit.se/v2.0/suggest/address/se -d "query=Storg&response_format=json&api_key={API_KEY}"
{
  "version": "2.0",
  "suggestions": [
    {
      "street": "Storgatan",
      "street_number": "1",
      "extra_number": "",
      "letter": "",
      "postcode": "11444",
      "locality": "Stockholm"
    },
    {
      "street": "Storgatan",
      "street_number": "1",
      "extra_number": "",
      "letter": "",
      "postcode": "15172",
      "locality": "Södertälje"
    },
    {
      "street": "Storgatan",
      "street_number": "1",
      "extra_number": "",
      "letter": "",
      "postcode": "15330",
      "locality": "Järna"
    },
   ...
  ]
}

XML

TEXT
<?xml version="1.0" encoding="UTF-8"?>
<api>
    <version>2.0</version>
    <suggestions>
        <suggestion>
            <street>Storgatan</street>
            <street_number>1</street_number>
            <extra_number></extra_number>
            <letter></letter>
            <postcode>11444</postcode>
            <locality>Stockholm</locality>
        </suggestion>
        <suggestion>
            <street>Storgatan</street>
            <street_number>1</street_number>
            <extra_number></extra_number>
            <letter></letter>
            <postcode>15172</postcode>
            <locality>Södertälje</locality>
        </suggestion>
        <suggestion>
            <street>Storgatan</street>
            <street_number>1</street_number>
            <extra_number></extra_number>
            <letter></letter>
            <postcode>15330</postcode>
            <locality>Järna</locality>
        </suggestion>
    </suggestions>
</api>
Storgatan;1;;;11444;Stockholm
Storgatan;1;;;15172;Södertälje
Storgatan;1;;;15330;Järna
Storgatan;1;;;21141;Malmö
Storgatan;1;;;23197;Klagstorp
Storgatan;1;;;23331;Svedala
Storgatan;1;;;23940;Falsterbo
Storgatan;1;;;24130;Eslöv
Storgatan;1;;;24172;Marieholm
Storgatan;1;;;24231;Hörby
Storgatan;1;;;24330;Höör
Storgatan;1;;;24531;Staffanstorp