appvise / kvk-api
PHP KVK API client
Installs: 19 496
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 1
Forks: 9
Open Issues: 7
Requires
- php: ^7.3|^8.0
- ext-json: *
Requires (Dev)
- guzzlehttp/guzzle: ^6.3
- phpunit/phpunit: ^6.5
Suggests
- guzzlehttp/guzzle: ^6.3
This package is auto-updated.
Last update: 2025-03-11 11:07:43 UTC
README
As for 1 april 2022 there are some new API's available for interacting with KVK. This library makes this easy for you. Check for installation and usage details below.
Documentation
Installation
Install this package via composer
composer require appvise/kvk-api
Probably you want to install the KVK (Staat der Nederlanden Private Root CA - G1) certificate into you trusted chains. For more information head to: Certificate information
Usage
Zoeken API
use Appvise\KvkApi\Http\SearchQuery; use Appvise\KvkApi\KvkClientFactory; use Appvise\KvkApi\Exception\ApiException; use Appvise\KvkApi\Exception\NotFoundException; // for more information check: // https://developers.kvk.nl/nl/support/tls-certificate-chain-trust-instructions $rootCertificate = <location_of_root_certificate>; $client = KvkClientFactory::create(<YOUR_API_KEY>, 'test | production', $rootCertificate); $query = new SearchQuery(); $query->setKvkNumber('KVK nummer to search for'); try { $resultaten = $this->client->search($query); foreach ($resultaten->getResultaten() as $searchResult) { // do something with $searchResult } } catch(NotFoundException | ApiException $exception) { // handle error }
BasisProfiel API
use Appvise\KvkApi\Http\ProfileQuery; use Appvise\KvkApi\KvkClientFactory; use Appvise\KvkApi\Exception\ApiException; use Appvise\KvkApi\Exception\NotFoundException; // for more information check: // https://developers.kvk.nl/nl/support/tls-certificate-chain-trust-instructions $rootCertificate = <location_of_root_certificate>; $client = KvkClientFactory::create(<YOUR_API_KEY>, 'test | production', $rootCertificate); $query = new ProfileQuery(); $query->setKvkNumber('KVK nummer to fetch basis profile information for'); try { $basisProfile = $this->client->getBasisProfiel($query); // do something with $basisProfile } catch(NotFoundException | ApiException $exception) { // handle error }
Tests
composer test