Data cleansing

Validate and normalise an address

Validates and normalises an address: corrects typos, fills in postal code and town, and returns the official DAR form. For checkout and forms where the customer typed the address themselves.

POST/v1/validate

Authentication

Authorizationstringheaderrequired

Your API key as a Bearer token.

Body

application/json
doerstring | null
etagestring | null
husnrstringrequired
postnrstringrequired
vejnavnstringrequired

Request

curl --request POST \
  --url "https://api.danskadresseapi.dk/v1/validate" \
  --header "Authorization: Bearer $API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
  "husnr": "1",
  "postnr": "1550",
  "vejnavn": "Rådhuspladsen"
}'
Try it
POST https://api.danskadresseapi.dk/v1/validate

Response

application/json

Validation result (valid, score and id — or suggestions)

One of these shapes:

Exact match.
idstring<uuid>required

The DAR id of the address found.

scoreenum<number>required
validenum<boolean>required
The house number exists, but not the given floor/door. adgangsadresse_id is the house number’s id.
scoreenum<number>required
validenum<boolean>required
reasonenum<string>required
messagestringrequired
adgangsadresse_idstring<uuid>required
No match — with the nearest candidates.
scoreenum<number>required
validenum<boolean>required
reasonenum<string>required
suggestionsobject[]required
Show child attributes(4)
suggestions.idstring<uuid>
suggestions.navnstring

The street name.

suggestions.husnrstring
suggestions.similaritynumber

Similarity 0–1.

200Eksempel
{
  "id": "00000000-0000-0000-0000-000000000000",
  "score": 1,
  "valid": true
}
401Missing key
{
  "error": {
    "code": "unauthorized",
    "message": "Missing or invalid API key."
  }
}
Validate and normalise an address — DanskAdresseAPI