# Your first API call in five minutes

> Create a free key, look up an address with curl, Python or Node, and read the response.
>
> https://danadresse.dk/en/guides/kom-i-gang · verified 2026-11-02
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](/dashboard/signup) and enter your email.
2. Type in the 6-digit code you receive by email.
3. Open [Keys](/dashboard/keys) and click **Create key**. Pick *live* for real traffic or *test* for development (see [Test keys](/en/guides/testnoegler-sandbox)).

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:

```bash id=export-key run=no
export DANADRESSE_API_KEY="dawa_live_your_key_here"
```

## 3. Make the first call

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

```bash id=first-curl run=live expect="tekst"
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 id=first-python run=live expect="Rådhuspladsen"
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:

```js id=first-node run=live expect="Rådhuspladsen"
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 id=first-response run=no
[
  {
    "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:

| Field | Contents |
|---|---|
| `forslagstekst` | The address as one line, ready to show the user |
| `data.id` | The address UUID. Store it so you can look the address up again later |
| `data.adgangsadresseid` | Id of the building entrance (without floor and door) |
| `data.x`, `data.y` | Longitude and latitude (WGS84) |

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

```bash id=lookup-by-id run=live expect="adressebetegnelse"
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 id=ratelimit-headers run=no
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](/en/guides/graenser-og-429) for how to handle a response with status 429.

## Next steps

- Using the key in a browser? Read [Browser keys and allowed domains](/en/guides/browser-noegler-domaener) first.
- Coming from DAWA? [Switch from DAWA by changing the base URL](/en/guides/migrer-fra-dawa).
- Build an address field: [Autocomplete widget in plain JavaScript](/en/guides/vanilla-autocomplete-widget).
