Dylan-DutchAndBold / kvk-api

KVK API php client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 werkspot/kvk-api

Usage

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);

Tests

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

Author

KVK API has been developed by LauLaman.

About

KVK API php client

License:MIT License


Languages

Language:PHP 99.2%Language:Makefile 0.8%