Your first API call in five minutes

Create a free key, look up an address with curl, Python or Node, and read the response.

3 min Level: Beginner ✓ Code tested

This guide takes you from nothing to a working address lookup. You need an email address and a terminal.

The base URL is https://api.danadresse.dk. Endpoints, parameters and JSON fields are the same as in DAWA, so existing DAWA code works once you have changed the domain and added a key.

1. Create an account and a key

  1. Go to danadresse.dk/dashboard/signup and enter your email.
  2. Type in the 6-digit code you receive by email.
  3. Open Keys and click Create key. Pick live for real traffic or test for development (see Test keys).

The key starts with dawa_live_ or dawa_test_ and is shown only once. Store it in your password manager or a .env file, never in Git.

The free plan includes 2,000 calls per month and 360 calls per minute. No credit card is needed.

2. Put the key in an environment variable

Every example in these guides reads the key from DANADRESSE_API_KEY, so you can copy them as they are:

Shell#export-key
export DANADRESSE_API_KEY="dawa_live_your_key_here"

3. Make the first call

Find the addresses that match "Rådhuspladsen 1":

Shell#first-curl
curl -s "https://api.danadresse.dk/autocomplete?q=R%C3%A5dhuspladsen%201&per_side=3" \
  -H "X-Api-Key: $DANADRESSE_API_KEY"

The same call in Python (needs pip install requests):

Python#first-python
import os
import requests

r = requests.get(
    "https://api.danadresse.dk/autocomplete",
    params={"q": "Rådhuspladsen 1", "per_side": 3},
    headers={"X-Api-Key": os.environ["DANADRESSE_API_KEY"]},
    timeout=10,
)
r.raise_for_status()
for suggestion in r.json():
    print(suggestion["forslagstekst"])

And in Node 18 or later, which has fetch built in:

JavaScript#first-node
const url = new URL("https://api.danadresse.dk/autocomplete");
url.searchParams.set("q", "Rådhuspladsen 1");
url.searchParams.set("per_side", "3");

const res = await fetch(url, {
  headers: { "X-Api-Key": process.env.DANADRESSE_API_KEY },
});
if (!res.ok) throw new Error(`HTTP ${res.status}: ${await res.text()}`);
for (const suggestion of await res.json()) console.log(suggestion.forslagstekst);

4. Read the response

/autocomplete returns a list of suggestions. Each one has a type (vejnavn, adgangsadresse or adresse), display text and a data object with ids and coordinates:

JSON#first-response
[
  {
    "type": "adresse",
    "tekst": "Rådhuspladsen 1, 3300 Frederiksværk",
    "forslagstekst": "Rådhuspladsen 1, 3300 Frederiksværk",
    "caretpos": 35,
    "data": {
      "id": "762a9a1f-a5fb-4e47-b1b2-9fa94026bc80",
      "vejnavn": "Rådhuspladsen",
      "husnr": "1",
      "postnr": "3300",
      "postnrnavn": "Frederiksværk",
      "kommunekode": "0260",
      "adgangsadresseid": "0a3f507f-0959-32b8-e044-0003ba298018",
      "x": 12.01612365,
      "y": 55.97657023
    }
  }
]

The fields you will use most:

FieldContents
forslagstekstThe address as one line, ready to show the user
data.idThe address UUID. Store it so you can look the address up again later
data.adgangsadresseidId of the building entrance (without floor and door)
data.x, data.yLongitude and latitude (WGS84)

Fetch the full address by id once the user has picked a suggestion:

Shell#lookup-by-id
curl -s "https://api.danadresse.dk/adresser/762a9a1f-a5fb-4e47-b1b2-9fa94026bc80" \
  -H "X-Api-Key: $DANADRESSE_API_KEY"

5. Keep an eye on usage

Every response carries headers that tell you how much of the quota is left:

HTTP#ratelimit-headers
X-RateLimit-Limit: 2000
X-RateLimit-Remaining: 1997
X-RateLimit-Reset: 1796083200

The numbers above are only an example. X-RateLimit-Reset is a Unix timestamp for when the month resets. The per-minute limit is in X-RateLimit-Minute-Limit, X-RateLimit-Minute-Remaining and X-RateLimit-Minute-Reset. When a free account goes past its monthly quota, it is still served up to 2,400 calls (20 % extra), and those responses carry X-Quota-Grace: true. See Limits, quotas and 429 for how to handle a response with status 429.

Next steps

Related guides

Markdown source Spotted an error? Tell us API-reference (Swagger)

Try it with a free key

2,000 calls/month on the free plan. No credit card.

Create account →