DEV Community

Cover image for Get Danish company data (CVR) as JSON — and why the CVR number is the VAT number
MortenIms1982
MortenIms1982

Posted on Edited on

Get Danish company data (CVR) as JSON — and why the CVR number is the VAT number

If you work with Danish companies, you'll meet the CVR number fast — and one quirk saves a lot of confusion:

In Denmark, a company's 8-digit CVR number is also its VAT (moms) number, just prefixed with DK. So CVR 24256790 → VAT DK24256790. One identifier, two jobs.

Danish company data comes from CVR (Det Centrale Virksomhedsregister) via Virk, run by the Danish Business Authority. Here's how to pull it as clean JSON.

One call

curl "https://www.globalentityapi.com/api/registry/search?country=Denmark&q=Novo%20Nordisk" \
  -H "x-api-key: gea_live_…"
Enter fullscreen mode Exit fullscreen mode
{
  "mode": "live",
  "country": "Denmark",
  "source": "cvr-virk",
  "results": [
    {
      "name": "NOVO NORDISK A/S",
      "orgNr": "24256790",
      "status": "Aktiv",
      "orgForm": "Aktieselskab",
      "industry": "Fremstilling af farmaceutiske præparater",
      "city": "Bagsværd"
    }
  ]
}
Enter fullscreen mode Exit fullscreen mode

Look up directly by CVR number the same way — just pass it as q:

curl "https://www.globalentityapi.com/api/registry/search?country=Denmark&q=24256790" \
  -H "x-api-key: gea_live_…"
Enter fullscreen mode Exit fullscreen mode

Deriving the VAT number

Because CVR = VAT, you can build the EU VAT ID with no extra call:

function cvrToVat(orgNr) {
  return "DK" + String(orgNr).replace(/\D/g, "");
}
// cvrToVat("24256790") -> "DK24256790"
Enter fullscreen mode Exit fullscreen mode

Then validate it against VIES if you need to confirm it's active for cross-border invoicing.

What you get for a Danish company

Field Example
name NOVO NORDISK A/S
orgNr 24256790 (CVR = VAT)
orgForm Aktieselskab (A/S)
status Aktiv
industry branchekode / NACE description
city Bagsværd

Same call, every other country

The value of a normalized layer is that Denmark isn't a special case in your code. Swap country and the shape stays identical:

curl ".../api/registry/search?country=United%20Kingdom&q=Tesco" -H "x-api-key: gea_live_…"
curl ".../api/registry/search?country=Germany&q=SAP%20SE"        -H "x-api-key: gea_live_…"
Enter fullscreen mode Exit fullscreen mode

66 registers across 30+ countries, one JSON schema. Full details here.

Try it

There's a live CVR demo (no signup) on the CVR API page — search Novo Nordisk, Maersk or Carlsberg. Keys come with a 7-day free trial, no card required.

Data comes live from CVR via Virk (data.virk.dk); attribution is retained on every record.

Top comments (0)