PHP code example of bastiaanh / overheid-kvk

1. Go to this page and download the library: Download bastiaanh/overheid-kvk library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

bastiaanh / overheid-kvk example snippets


$kvk = new Overheid\Kvk();
$kvk->setApiKey('459a874e2f3...');

$details = $kvk->get('20106830');
var_dump($result);

array (size=15)
  'actief' => boolean true
  'bestaandehandelsnaam' => string 'Freshheads B.V.' (length=15)
  'dossiernummer' => string '20106830' (length=8)
  'handelsnaam' => string 'Freshheads B.V.' (length=15)
  'handelsnaam_url' => string 'freshheads-bv' (length=13)
  'huisnummer' => string '21' (length=2)
  'huisnummertoevoeging' => string '' (length=0)
  'plaats' => string 'Tilburg' (length=7)
  'postcode' => string '5041EB' (length=6)
  'statutairehandelsnaam' => string 'Freshheads B.V.' (length=15)
  'straat' => string 'Wilhelminapark' (length=14)
  'straat_url' => string 'wilhelminapark' (length=14)
  'subdossiernummer' => string '0000' (length=4)
  'type' => string 'Hoofdvestiging' (length=14)
  'vestigingsnummer' => int 18389392

$result = $kvk->suggest('oudet', 5);
var_dump($result);

array (size=2)
  'handelsnaam' => 
    array (size=5)
      0 => 
        array (size=2)
          'text' => string 'Oude Tijdhof Optiek' (length=19)
          'extra' => 
            array (size=1)
              'id' => string '62540661/0000' (length=13)
      1 => 
        array (size=2)
          'text' => string 'Oude Tijdhof Optiek B.V.' (length=24)
          'extra' => 
            array (size=1)
              'id' => string '05076440/0000' (length=13)
      2 => 
        array (size=2)
          'text' => string 'Oude Tol Groenprojecten' (length=23)
          'extra' => 
            array (size=1)
              'id' => string '22063560/0000' (length=13)
      3 => 
        array (size=2)
          'text' => string 'Oude Toren Beheer B.V.' (length=22)
          'extra' => 
            array (size=1)
              'id' => string '17073018/0000' (length=13)
      4 => 
        array (size=2)
          'text' => string 'Oude Toren Consultancy' (length=22)
          'extra' => 
            array (size=1)
              'id' => string '57244359/0000' (length=13)
  'straat' => 
    array (size=5)
      0 => 
        array (size=2)
          'text' => string 'OUDE TELGTERWEG' (length=15)
          'extra' => 
            array (size=1)
              'postcode' => string '3851EE' (length=6)
      1 => 
        array (size=2)
          'text' => string 'Oude Telgterweg' (length=15)
          'extra' => 
            array (size=1)
              'postcode' => string '3853PH' (length=6)
      2 => 
        array (size=2)
          'text' => string 'Oude Trambaan' (length=13)
          'extra' => 
            array (size=1)
              'postcode' => string '6093CE' (length=6)
      3 => 
        array (size=2)
          'text' => string 'OUDE TRAMBAAN' (length=13)
          'extra' => 
            array (size=1)
              'postcode' => string '2265DA' (length=6)
      4 => 
        array (size=2)
          'text' => string 'OUDE TERBORGSEWEG' (length=17)
          'extra' => 
            array (size=1)
              'postcode' => string '7004KA' (length=6)

Overheid\Kvk::search([parameters : array = array()]):Overheid\Resultset

/** @var Overheid\Resultset $results */
$results = $kvk->search(array('filters' => array('postcode' => '3083cz')));

echo count($results) . ' results <br/>';
foreach ($results as $index => $result) {
    echo 'result ' . $index . ': <br />';
    var_dump($result);
}