DanskAdresseAPIv1
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.

1. Find your starting point

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

Save the sequence number. That is your cursor.

2. Fetch the extract

Every dataset has its own extract — access addresses, addresses, street segments and postcodes:

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

3. Follow the changes

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

Save the highest sequence number you have processed and use it as sekvensnummerfra next time.

Fetch the extract BEFORE you start following events.

The other way round, changes can happen in between that are in neither the extract
nor your event stream.

Each dataset replicates on its own. Access addresses and addresses are two streams
with their own sequence numbers — they cannot be followed with a single cursor.

Replication requires the Enterprise plan.