Going further

Replication

Keep your own copy of the address register current — without fetching all of it every night.

Replication is two steps: fetch the dataset once, then follow only the changes — with the same replication calls as in DAWA.

1. Find your starting point

Bash
curl "https://api.danskadresseapi.dk/dawa/replikering/senesteSekvensnummer" \
  -H "Authorization: Bearer YOUR_KEY"

Store the sequence number. It's your cursor.

2. Fetch the extract

Each dataset has its own extract — e.g. access addresses, addresses, road segments and postcodes:

Bash
curl "https://api.danskadresseapi.dk/dawa/replikering/adgangsadresser?sekvensnummer=12345" \
  -H "Authorization: Bearer YOUR_KEY"

3. Follow the changes

Bash
curl "https://api.danskadresseapi.dk/dawa/replikering/adgangsadresser/haendelser?sekvensnummerfra=12346" \
  -H "Authorization: Bearer YOUR_KEY"

Store the highest sequence number you've processed, and use the next one as sekvensnummerfra next time.

Fetch the extract BEFORE you start following events.

Do it the other way round and changes can happen in between that are in neither
the extract nor your event stream.

Each dataset is replicated on its own. Access addresses and addresses are two streams —
follow each of them from your stored sequence number.

Replication requires the Enterprise plan.

Replication — DanskAdresseAPI