PHP-eksempel på integration med CVRcheck API. Brug file_get_contents eller cURL til at hente CVR-data, regnskaber og ejerskab.
<?php
$cvr = "28271026";
$json = file_get_contents("https://api.cvrcheck.dk/v1/company/$cvr");
$company = json_decode($json, true);
echo $company["name"] . " - " . $company["status"];
$ch = curl_init("https://api.cvrcheck.dk/v1/financials/$cvr");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["Authorization: Bearer $apiKey"]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$financials = json_decode(curl_exec($ch), true);