Addresses

Autocomplete across addresses, street names and postal codes

Type-ahead across addresses, street names and postal codes — the endpoint an address field calls on every keystroke. Fuzzy and typo-tolerant. Narrow the result type with type and the geography with postnr.

GET/v1/autocomplete

Authentication

Authorizationstringheaderrequired

Your API key as a Bearer token.

Parameters

qstringqueryrequired

Free-text search (prefix + fuzzy).

typestringquery

Result type. Omitted = addresses. vejnavn gives one suggestion per street name, postnummer one per postal code (data then holds navn/href and nr/navn/stormodtager/href respectively).

Allowed values:adresseadgangsadressevejnavnpostnummer
postnrstringquery

Restrict to a postal code.

kommunekodestringquery

Restrict to a municipality (4 digits).

per_sideintegerquery

Number of suggestions. Wins over limit if both are sent.

default: 201–100
limitintegerquery

Older name for the number of suggestions (max 50). Use per_side.

default: 201–50
motorstringquery

dawa = the response comes from the DAWA engine (same as /dawa/autocomplete): step-wise with street-name suggestions first and caretpos in the middle of the text. The response has the header X-Source: dawa-engine (or v1-fallback if the engine does not answer). Does not apply to type=postnummer.

dawastringquery

1 = exactly DAWA's fields (omits confidence, forslag and similarity).

Request

curl --request GET \
  --url "https://api.danskadresseapi.dk/v1/autocomplete" \
  --url-query "q=<q>" \
  --header "Authorization: Bearer $API_KEY"
Try it
GET https://api.danskadresseapi.dk/v1/autocomplete

Response

application/json

List of suggestions

dataobject

The object itself: the address/access address (with id), the street name (navn, href) or the postal code (nr, navn, stormodtager, href).

typestring

adresse | adgangsadresse | vejnavn | postnummer

tekststring
caretposinteger

Where the cursor should be placed after the suggestion is chosen.

forslagstekststring

The text shown in the suggestion list.

stormodtagerpostnrboolean

Address suggestions only.

200Eksempel
[
  {
    "data": {},
    "type": "adgangsadresse",
    "tekst": "Rådhuspladsen 1, 1550 København V",
    "caretpos": 0,
    "forslagstekst": "…",
    "stormodtagerpostnr": false
  }
]
401Missing key
{
  "error": {
    "code": "unauthorized",
    "message": "Missing or invalid API key."
  }
}