CVR System-til-System or a CVR API?

The Danish Business Authority publishes the entire CVR register as an Elasticsearch index on distribution.virk.dk. It's called System-til-System (system-to-system) access. It's free and complete, but needs an application, and the responses are heavy to work with. apicvr.dk is built on top of it and gives you the same data as simple JSON.

What is System-til-System?

System-til-System is the Business Authority's official CVR data distribution. You get a username and password and send Elasticsearch queries to the cvr-permanent/virksomhed, cvr-permanent/produktionsenhed and cvr-permanent/deltager indexes. Responses include the full history of each company.

What a lookup looks like

bash
curl -u "$CVR_USER:$CVR_PASSWORD" \
  -H "Content-Type: application/json" \
  -X POST "http://distribution.virk.dk/cvr-permanent/virksomhed/_search" \
  -d '{
    "query": { "term": { "Vrvirksomhed.cvrNummer": 24256790 } },
    "size": 1
  }'

# The response is the full CVR document: names, addresses, participants
# and attributes as historical lists with validity periods.

Every field is a list with validity periods. To get the current name, you have to find the period that's still valid yourself:

python
# Find the name that is valid today in the raw System-til-System response
def current_name(vrvirksomhed):
    for navn in vrvirksomhed["navne"]:
        if navn["periode"]["gyldigTil"] is None:
            return navn["navn"]
    return None

The same goes for addresses, industry codes, status, headcount and especially participant relations, where owners and management are buried several levels deep.

The same lookup with apicvr.dk

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

{
  "vat": 24256790,
  "name": "NOVO NORDISK A/S",
  "address": "Novo Allé 1",
  "zipcode": 2880,
  "city": "Bagsværd",
  "status": "NORMAL",
  ...
}

apicvr.dk sends the query to System-til-System for you, picks out the current values and returns a flat object. No application, no password.

When should you use System-til-System directly?

For everyday lookups in a web shop, CRM, onboarding flow or spreadsheet, a ready-made API like apicvr.dk is faster to start with and easier to maintain.

apicvr.dk is open source. If you have your own System-til-System access, you can run your own instance with Docker. See GitHub.

Frequently asked questions

How do I get System-til-System access?

You apply to the Danish Business Authority and accept their terms. Once approved, you get a username and password for distribution.virk.dk.

Is System-til-System free?

Yes, access is free, but it requires approval and a technical integration with Elasticsearch.

Does apicvr.dk use the same data?

Yes. Every lookup goes live to distribution.virk.dk, so you get the same current information.