, (*1)
DVLASearch - API Client
This PHP composer package provides a simple object orientated way to interact with the http://dvlasearch.co.uk API., (*2)
Setup:, (*3)
Using composer add the package to your project:, (*4)
composer require opensaucesystems/dvlasearch, (*5)
Initializing the client:, (*6)
<?php
require 'vendor/autoload.php';
/**
* Initialize the API client class
*/
$dvlasearch = new opensaucesystems\dvlasearch\APIClient(
'DvlaSearchDemoAccount' // API key
);
Making calls:, (*7)
To interact with the API, its as simple as calling a class method or property, endpoints are dynamically loaded when traversed to., (*8)
For example:, (*9)
print_r($dvlasearch->vin->find('WMX1903782A004387'), true);, (*10)
stdClass Object
(
[co2Emissions] => 219 g/km
[model] => Amg Gt
[twelveMonthRate] =>
[transmission] => Automatic
[vrm] => 10GRX
[colour] => WHITE
[sixMonthRate] =>
[yearOfManufacture] => 2015
[dateOfFirstRegistration] => 31 July 2015
[fuelType] => PETROL
[revenueWeight] => 1890kg
[typeApproval] => M1
[vin] => WMX1903782A004387
[wheelPlan] => 2 AXLE RIGID BODY
[motDetails] => No details held by DVLA
[make] => MERCEDES-BENZ
[taxDetails] => Tax due: 01 August 2016
)
See: examples.php for further calls and there results., (*11)