Skip to content

Export - locality


Endpoint for exporting sets of localities in a specific country given certain search parameters.

Endpoint URL

(POST | GET) https://valid.geposit.se/1.6/export/locality/{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 parameter Value
api_key Required
A valid API key
query Required
The query string that will be used to filter what locality suggestions to fetch.

Example:
query=Storg Returns localities that begins with Storg
max_rows Required
The maximum number of rows that should be returned.
offset_rows Position from where to start the extraction (used for pagination, to step through a large search result, and get {nth} number of rows at a time).
response_format Sets the format for the API response. The following values are supported:
- xml
- json
- text (Default value)
columns A comma-separated list of what attributes you want to include in the response.
List of supported columns
Example:
query=Storg&columns=locality,adm1_code,adm1
locality Filter results to only return localities 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

Supported columns

Column name Explanation
locality Locality / City
adm1_code Administrative division - level 1 - code
adm1 Administrative division - level 1 - name
adm2_code Administrative division - level 2 - code
adm2 Administrative division - level 2 - name
adm3_code Administrative division - level 3 - code
adm3 Administrative division - level 3 - name
adm4_code Administrative division - level 4 - code
adm4 Administrative division - level 4 - name
adm5_code Administrative division - level 5 - code
adm5 Administrative division - level 5 - name

List of supported administrative divisions in each country

Response

Key Value type Value description
name String The name of the API
type String The type of service used, in this case "Export"
version String The API version
charset String The character encoding of the response, always utf-8
data Array An array with zero or more data objects (referenced below)
If the data array is empty it means that no rows matched your query.

data object

What attributes you'll find in the data object is controlled by the columns parameter. Here is an explanation of each possible attribute.

Key Value type Value description
locality String Locality / city
adm1_code String Administrative division - level 1 - code
adm1 String Administrative division - level 1 - name
adm2_code String Administrative division - level 2 - code
adm2 String Administrative division - level 2 - name
adm3_code String Administrative division - level 3 - code
adm3 String Administrative division - level 3 - name
adm4_code String Administrative division - level 4 - code
adm4 String Administrative division - level 4 - name
adm5_code String Administrative division - level 5 - code
adm5 String Administrative division - level 5 - name

List of supported administrative divisions in each country