This package provides a simple integration of the Official KVK Api for your PHP project.
With composer, add:
$ composer require werkspot/kvk-api
use Werkspot\KvkApi\Http\Endpoint\Production;
use Werkspot\KvkApi\Http\Search\ProfileQuery;
use Werkspot\KvkApi\ClientFactory;
$client = ClientFactory::create('<YOUR_API_KEY>', new Production());
$profileQuery = new ProfileQuery();
$profileQuery->setKvkNumber(18079951);
$kvkPaginator = $client->getProfile($profileQuery);
foreach ($kvkPaginator->getItems() as $company) {
// {your code}
}
// get next set of data
$kvkPaginator = $client->getNextPage($kvkPaginator);
This package comes with 2 types of tests: Unit and Integration. To run them you can use the make commands in the projects root.
$ make test-unit
$ make test-integration
KVK API has been developed by LauLaman.