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';
use CarsxeDeveloper\Carsxe\Carsxe;
// Initialize the client
$API_KEY = 'YOUR_API_KEY_HERE';
$carsxe = new Carsxe($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'
]);
echo json_encode($intvin, JSON_PRETTY_PRINT);
} catch (Exception $error) {
echo "Error: " . $error->getMessage();
}<?php
try {
$marketvalue = $carsxe->marketValue([
'vin' => 'WBAFR7C57CC811956'
]);
echo json_encode($marketvalue, JSON_PRETTY_PRINT);
} catch (Exception $error) {
echo "Error: " . $error->getMessage();
}<?php
try {
$history = $carsxe->history([
'vin' => 'WBAFR7C57CC811956'
]);
echo json_encode($history, JSON_PRETTY_PRINT);
} catch (Exception $error) {
echo "Error: " . $error->getMessage();
}<?php
try {
$decoded_plate = $carsxe->plateDecoder([
'plate' => '7XER187',
'state' => 'CA',
'country' => 'US'
]);
echo json_encode($decoded_plate, JSON_PRETTY_PRINT);
} catch (Exception $error) {
echo "Error: " . $error->getMessage();
}<?php
try {
$images = $carsxe->images([
'make' => 'BMW',
'model' => 'X5',
'year' => '2019'
]);
echo json_encode($images, JSON_PRETTY_PRINT);
} catch (Exception $error) {
echo "Error: " . $error->getMessage();
}<?php
try {
$recalls = $carsxe->recalls([
'vin' => '1C4JJXR64PW696340'
]);
echo json_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'
]);
echo json_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'
]);
echo json_encode($vinocr, JSON_PRETTY_PRINT);
} catch (Exception $error) {
echo "Error: " . $error->getMessage();
}<?php
try {
$yymm = $carsxe->yearMakeModel([
'year' => '2012',
'make' => 'BMW',
'model' => '5 Series'
]);
echo json_encode($yymm, JSON_PRETTY_PRINT);
} catch (Exception $error) {
echo "Error: " . $error->getMessage();
}<?php
try {
$obdcode = $carsxe->obdCodesDecoder([
'code' => 'P0115'
]);
echo json_encode($obdcode, JSON_PRETTY_PRINT);
} catch (Exception $error) {
echo "Error: " . $error->getMessage();
}<?php
try {
$lienAndTheft = $carsxe->lienAndTheft([
'vin' => '2C3CDXFG1FH762860'
]);
echo json_encode($lienAndTheft, JSON_PRETTY_PRINT);
} catch (Exception $error) {
echo "Error: " . $error->getMessage();
}Start building powerful automotive applications with CarsXE's PHP SDK!