Fetching the production units
bash
curl https://apicvr.dk/api/v1/24256790Example 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
| Field | Meaning |
|---|---|
p_number | The P-number – 10 digits. |
name, address, zipcode, city | The unit's name and physical address. |
industrycode, industrydesc | Industry code for this specific site. |
employees | Headcount, when reported. |
startdate, enddate | When the unit opened and, if so, closed. |
protected | Whether 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
- The lookup fetches every production unit, so large groups mean large responses. If you only need owners and management, use
/api/v1/{cvr}/direktion-og-ansvarlig. - Marketing protection applies per unit. A company can accept marketing while one of its units is protected.
- A unit's industry can differ from the company's main industry.
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.