Skip to content

Simple library for getting vehicle data by license plate number.

Notifications You must be signed in to change notification settings

automex/rdw-opendata-php

 
 

Repository files navigation

RDW Open Data

CI Status
Lint Lint
Coverage Coverage
Tests Tests

Simple library for getting vehicle data by vehicle registration plate and with some additional helper functions.

Data source: https://opendata.rdw.nl

Example usage

You call the static get method on the RDW class. You can pass two parameters: license and data except for the "tellerstandoordeel" that takes the following parameters code and data.

Example 1

use RDWOA\RDW;

$data = RDW::get('XP004T');

echo $data->merk; // BUGATTI

Example 2

use RDWOA\RDW;

$data = RDW::get('XP004T', 'brandstof');

echo $data->brandstof_omschrijving; // Benzine

Example 3

You can pass on two parameters to retrieve the miliage judgement: code and data = tellerstandoordeel.

use RDWOA\RDW;

$data = RDW::get('XP004T');

$oordeel = RDW::get($data->code_toelichting_tellerstandoordeel, 'tellerstandoordeel');

echo $oordeel;  // Niet geregistreerd

Example 4

You can use the helper function getFormattedLicensePlate for formatting license plates on the HELPER class. You can pass one parameter: license.

use RDWOA\RDW;
use RDWOA\HELPER;

$data = RDW::get('XP004T');

$kenteken = RDW::getFormattedLicensePlate($data->kenteken);

echo $kenteken; // XP-004-T

Possible data sets

  • info
  • assen
  • brandstof
  • carrosserie
  • carrosserieSpecifiek
  • voertuigklasse
  • bijzonderheden
  • voertuigSubcategorie
  • rupsbanden
  • tellerstandoordeel

Changelog

Version 1.4
* Added new data set "rupsbanden".
* Added new unit test for "rupsbanden".

Version 1.3
* Fixed couple of issues.
* Removed Travis for running PHPUnit Tests.
* Added GitHub Actions for running PHPUnit Tests.
* Added a new helper function for formatting license plates.
* Added new unit tests for helper function getFormattedLicensePlate.
* Updated the docs to reflect all updates.

Version 1.2
* Added new data sets "bijzonderheden" and "voertuigSubcategorie".
* Added new unit tests for "bijzonderheden" and "voertuigSubcategorie".

Version 1.1
* Added new data set "Assen".
* Fixed and updated failing unit tests.
* Added new unit tests for "Assen".

Version 1.0
* Project forked from jeffreyvr/rdw-opendata-php

Todo

  • The "Tellerstandoordeel" feels overkill, it should probably be more like a helper method in the helper class instead of the current implementation requeating this static information true the API.

About

Simple library for getting vehicle data by license plate number.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • PHP 100.0%