Skip to content

yuyinitos/kvk-api

 
 

Repository files navigation

Kvk Api

This package provides a simple integration of the Official KVK Api for your PHP project.

Build Status Scrutinizer Code Quality Code Coverage Latest Stable Version License

Installation

With composer, add:

$ composer require yuyinitos/kvk-api

Usage

profile query

use Yuyinitos\KvkApi\Http\Endpoint\Production;
use Yuyinitos\KvkApi\Http\Search\ProfileQuery;
use Yuyinitos\KvkApi\KvkClientFactory;

$client = KvkClientFactory::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);

Search query

use Yuyinitos\KvkApi\Http\Endpoint\Production;
use Yuyinitos\KvkApi\Http\Search\SearchQuery;
use Yuyinitos\KvkApi\KvkClientFactory;

$client = KvkClientFactory::create('<YOUR_API_KEY>', new Production());


$searchQuery = new SearchQuery();
$searchQuery->setStreet('ABEBE Bikilalaan');
$kvkPaginator = $client->fetchSearch($searchQuery);

// get next set of data
$kvkPaginator = $client->getNextPage($kvkPaginator);

Tests

To run the tests you can use the make commands in the projects root.

$ make test-cs
$ make test-unit
$ make test-integration

You can also automatically fix the coding standards with:

$ make fix-cs

Author

KVK API has been created by LauLaman and is currently maintained by the developers at Yuyinitos.

About

KVK API php client

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 99.3%
  • Makefile 0.7%