Loading...
Sign in to see the examples with your own API key.

Batches

The Batches API washes a whole file of addresses. Upload a CSV, check the columns we found, run it, and download the same file with every row washed against DAR (Danmarks Adresseregister) the way Datavask washes one address: the corrected address, its parts, its DAR ids, its datavask category and its coordinates. Your own columns come back untouched. The same files are in the Adressevask tab of your console.

Batches need your subscription's admin key: the files hold your own data, so the API key used for address look-ups can't reach them. Domain tokens are refused.

1. Upload

POST https://api.getaddress.dk/batches?name=kunder.csv&api-key={your-admin-key}  

The body is the file itself (Content-Type: text/csv): up to 100,000 rows and 20 MB, any encoding Excel or Google Sheets writes, separated by commas, semicolons, tabs or pipes. We find the address columns for you: the headers and up to 20 sample rows are read by an AI service (Anthropic, which doesn't train on them) to work out which columns hold the address. The rest of the file is never sent. Nothing is charged. 20 uploads a day.

curl -X POST "https://api.getaddress.dk/batches?name=kunder.csv&api-key={your-admin-key}" -H "Content-Type: text/csv" --data-binary @kunder.csv

Response (201)

{
    "id": "6f1c0e2a9b8d4c7e8a1b2c3d4e5f6a7b",
    "file_name": "kunder.csv",
    "status": "ready",
    "rows": 1200,
    "mapping": {
        "has_header": true,
        "columns": [
            { "column": 2, "role": "street", "header": "Vej" },
            { "column": 3, "role": "number", "header": "Husnr" },
            { "column": 4, "role": "unit", "header": "Etage/dør" },
            { "column": 5, "role": "postcode", "header": "Postnr" },
            { "column": 6, "role": "suburb", "header": "By" }
        ]
    },
    "mapping_reason": "Brugte Vej, Husnr, Etage/dør, Postnr og By; Bemærkning er leveringsnoter.",
    "needs_review": false,
    "price_cents": null,
    "free": false,
    "expires": "2026-10-12T09:30:00+00:00",
    …
}

price_cents is what running the batch costs up front, in øre (hundredths of a Danish krone, DKK), at the price per 1,000 rows set in your console. It is null while paying for a batch isn't switched on. refunded_cents is in øre too.

2. Check the columns

When needs_review is true, look at mapping before running. To choose the columns yourself, send every address column (numbered from 0) with its role, in reading order:

RoleIn a Danish address
streetVejnavn
numberHusnummer, e.g. 217A
unitEtage and dør, e.g. 2. tv
lineA whole or partial address in one cell
postcodePostnummer
suburbThe town: postnummernavn or supplerende bynavn
PUT https://api.getaddress.dk/batches/{id}/mapping?api-key={your-admin-key}
{
    "has_header": true,
    "columns": [ { "column": 1, "role": "line" }, { "column": 4, "role": "postcode" }, { "column": 5, "role": "suburb" } ]
}

3. Run

POST https://api.getaddress.dk/batches/{id}/run?api-key={your-admin-key}

A free batch starts at once (status running). Otherwise the response carries checkout_url: open it to pay in DKK (Stripe's page asks for your CVR number), and the batch starts when the payment is made (status awaiting_payment until then). Every row is paid for up front and the rows that don't match are refunded when the batch finishes, so you pay only for matched rows. Files up to 200 rows are free once a day on the Free plan (Gratis).

4. Wait, then download

GET https://api.getaddress.dk/batches/{id}?api-key={your-admin-key}

rows_done counts up while it runs. Ask every few seconds; a batch of 100,000 rows takes minutes, and we email you when it's done. When status is done, download it:

GET https://api.getaddress.dk/batches/{id}/result?api-key={your-admin-key}

GET /batches lists your subscription's batches, newest first.

The washed file

Your columns, in order and as they were, then these. UTF-8, your own separator, and a header row (a file without one gets column_1, column_2 …).

ColumnHolds
ga_statusmatched (datavask category A or B; charged), ambiguous (category C: several addresses could be meant), not_found, or invalid (no address, or over 200 characters).
ga_kategoriDatavask's category: A a sure match, B a sure match with small differences (a typo, an abbreviation), C unsure. Empty for not_found and invalid.
ga_idThe address's DAR id, for /adresser/{id}.
ga_adgangsadresseidIts access address's id, for /adgangsadresser/{id}.
ga_adresseThe address on one line (DAWA's betegnelse).
ga_vejnavn, ga_husnr, ga_etage, ga_dør, ga_supplerendebynavn, ga_postnr, ga_postnrnavn, ga_kommunekodeIts parts, named as in DAWA's records.
ga_bredde, ga_længdeIts latitude and longitude (WGS84).
ga_kandidaterFor an ambiguous row, up to 5 address ids it could be, separated by ;.

Keeping your data

Your file and the washed file are deleted 7 days after upload. A batch is then gone from the API too.

Top