Get production units and P-numbers for a company

A Danish company has one CVR number, but a production unit (P-unit) for every physical site it operates from. When you look up a CVR number, all of the company's production units come back in the p_units field.

Fetching the production units

bash
curl https://apicvr.dk/api/v1/24256790

Example response

json
{
  "vat": 24256790,
  "name": "NOVO NORDISK A/S",
  ...
  "p_units": [
    {
      "p_number": 1007712304,
      "name": "Novo Nordisk A/S",
      "address": "Brogårdsvej 66",
      "zipcode": 2820,
      "city": "Gentofte",
      "startdate": "1999-10-18",
      "enddate": "2001-12-31",
      "industrycode": 244200,
      "industrydesc": "Fremstilling af aluminium",
      "employees": null,
      "protected": false
    },
    ...
  ]
}

Production-unit fields

FieldMeaning
p_numberThe P-number – 10 digits.
name, address, zipcode, cityThe unit's name and physical address.
industrycode, industrydescIndustry code for this specific site.
employeesHeadcount, when reported.
startdate, enddateWhen the unit opened and, if so, closed.
protectedWhether the unit has marketing protection.

Active units only

The list includes closed units too – large companies can have hundreds. Filter on enddate:

javascript
const res = await fetch("https://apicvr.dk/api/v1/24256790");
const company = await res.json();

const active = company.p_units.filter((p) => !p.enddate);
for (const p of active) {
  console.log(p.p_number, p.address, p.zipcode, p.city, p.employees ?? "-");
}

Tips

Frequently asked questions

Can I look up a P-number directly?

Not yet. Look up the company's CVR number and find the unit in p_units.

Why does a company include closed production units?

The list is the company's full history. Units with an enddate are closed.