A robust PHP package for interacting with the Dutch Chamber of Commerce (KvK) API. This package is a fork of vormkracht10/kvk-api with additional features and improvements.
- Search companies by name, KvK number, RSIN, or establishment number
- Fetch detailed company profiles
- Built-in caching to minimize API calls
- Rate limiting to respect API guidelines
- Comprehensive error handling
- PSR-7 compliant
For each company, you can retrieve:
- KvK number
- Establishment number
- Trade name(s)
- Address(es) including:
- Type
- Full address
- Street
- House number
- Postal code
- City
- Country
- Website(s)
- Basic profile information (new)
Install the package via Composer:
composer require mantix/kvk-apiRequired dependencies:
composer require illuminate/support
composer require psr/http-message
composer require guzzlehttp/guzzleFirst, obtain your API key from the KvK Developer Portal.
use Mantix\KvkApi\ClientFactory;
$apiKey = '<YOUR_KVK_API_KEY>';
$kvk = ClientFactory::create($apiKey);// Search by company name
$companies = $kvk->search('Mantix');
// Search with pagination
$kvk->setPage(1)
->setResultsPerPage(10);
$companies = $kvk->search('Mantix');// By KvK number
$companies = $kvk->searchByKvkNumber('12345678');
// By RSIN
$companies = $kvk->searchByRsin('123456789');
// By establishment number
$companies = $kvk->searchByVestigingsnummer('000012345678');// Fetch detailed company profile
$profile = $kvk->getBaseProfile('12345678');// Search with additional parameters
$companies = $kvk->search('Mantix', [
'pagina' => 1,
'resultatenPerPagina' => 10,
// Add any other API parameters
]);
// Using SSL certificate
$rootCertificate = '<PATH_TO_SSL_CERT>';
$kvk = ClientFactory::create($apiKey, $rootCertificate);The package includes comprehensive error handling:
use Mantix\KvkApi\Exceptions\KvkApiException;
try {
$companies = $kvk->search('Mantix');
} catch (KvkApiException $e) {
// Handle API-specific errors
echo $e->getMessage();
} catch (\Exception $e) {
// Handle general errors
echo $e->getMessage();
}composer testContributions are welcome! Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.