Get started with CarsXE's PHP SDK to integrate comprehensive vehicle data into your PHP applications.
The CarsXE PHP SDK provides a simple and powerful way to integrate vehicle data into your PHP applications. This guide will help you get started quickly.
For more information, see the package on Packagist.
Install the CarsXE PHP package using Composer:
composer require carsxe/carsxe
First, require the autoloader and initialize the CarsXE client:
<?php
require_once__DIR__.'/vendor/autoload.php';
useCarsxeDeveloper\Carsxe\Carsxe;
// Initialize the client
$API_KEY ='YOUR_API_KEY_HERE';
$carsxe =newCarsxe($API_KEY);<?php
$vin ='WBAFR7C57CC811956';
try {
$vehicle = $carsxe->specs(['vin'=> $vin]);
echo $vehicle['input']['vin'];
} catch (Exception $error) {
echo"Error: ". $error->getMessage();
}<?php
try {
$intvin = $carsxe->intVinDecoder([
'vin'=>'WF0MXXGBWM8R43240'
]);
echojson_encode($intvin, JSON_PRETTY_PRINT);
} catch (Exception $error) {
echo"Error: ". $error->getMessage();
}<?php
try {
$marketvalue = $carsxe->marketValue([
'vin'=>'WBAFR7C57CC811956'
]);
echojson_encode($marketvalue, JSON_PRETTY_PRINT);
} catch (Exception $error) {
echo"Error: ". $error->getMessage();
}<?php
try {
$history = $carsxe->history([
'vin'=>'WBAFR7C57CC811956'
]);
echojson_encode($history, JSON_PRETTY_PRINT);
} catch (Exception $error) {
echo"Error: ". $error->getMessage();
}<?php
try {
$decoded_plate = $carsxe->plateDecoder([
'plate'=>'7XER187',
'state'=>'CA',
'country'=>'US'
]);
echojson_encode($decoded_plate, JSON_PRETTY_PRINT);
} catch (Exception $error) {
echo"Error: ". $error->getMessage();
}<?php
try {
$images = $carsxe->images([
'make'=>'BMW',
'model'=>'X5',
'year'=>'2019'
]);
echojson_encode($images, JSON_PRETTY_PRINT);
} catch (Exception $error) {
echo"Error: ". $error->getMessage();
}<?php
try {
$recalls = $carsxe->recalls([
'vin'=>'1C4JJXR64PW696340'
]);
echojson_encode($recalls, JSON_PRETTY_PRINT);
} catch (Exception $error) {
echo"Error: ". $error->getMessage();
}<?php
try {
$plateimg = $carsxe->plateImageRecognition([
'upload_url'=>'https://imagedelivery.net/moyiiSImjJPI_EZVxNMBBw/f49aed53-d736-4370-f3f4-97418841c800/public'
]);
echojson_encode($plateimg, JSON_PRETTY_PRINT);
} catch (Exception $error) {
echo"Error: ". $error->getMessage();
}<?php
try {
$vinocr = $carsxe->vinOcr([
'upload_url'=>'https://imagedelivery.net/moyiiSImjJPI_EZVxNMBBw/f49aed53-d736-4370-f3f4-97418841c800/public'
]);
echojson_encode($vinocr, JSON_PRETTY_PRINT);
} catch (Exception $error) {
echo"Error: ". $error->getMessage();
}<?php
try {
$yymm = $carsxe->yearMakeModel([
'year'=>'2012',
'make'=>'BMW',
'model'=>'5 Series'
]);
echojson_encode($yymm, JSON_PRETTY_PRINT);
} catch (Exception $error) {
echo"Error: ". $error->getMessage();
}<?php
try {
$obdcode = $carsxe->obdCodesDecoder([
'code'=>'P0115'
]);
echojson_encode($obdcode, JSON_PRETTY_PRINT);
} catch (Exception $error) {
echo"Error: ". $error->getMessage();
}<?php
try {
$lienAndTheft = $carsxe->lienAndTheft([
'vin'=>'2C3CDXFG1FH762860'
]);
echojson_encode($lienAndTheft, JSON_PRETTY_PRINT);
} catch (Exception $error) {
echo"Error: ". $error->getMessage();
}Start building powerful automotive applications with CarsXE's PHP SDK!