PHP code example of coderstephen / edmunds-sdk

1. Go to this page and download the library: Download coderstephen/edmunds-sdk 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/ */

    

coderstephen / edmunds-sdk example snippets


$client = new Edmunds\SDK\VehicleApiClient('YOUR_API_KEY_HERE');

$response = $client->makeCall('/api/inventory/v2/inventories', [
    'zipcode' => '90404'
]);

foreach ($response->inventories as $inventory) {
    echo $inventory->vin;
}

$client = new Edmunds\SDK\VehicleApiClient('YOUR_API_KEY_HERE');

use Edmunds\SDK;

$client = new SDK\VehicleApiClient('YOUR_API_KEY_HERE');

$makesIn2009 = $client->getMakes(null, 2009);
foreach ($makesIn2009->getModels() as $model) {
    $modelYear = $model->getYear(2009);
    printf('Model name: %s', $model->name);

    foreach ($modelYear->getStyles() as $style) {
        $firstPhoto = $style->getPhotos()[0];
        printf('Image URL: %s', $firstPhoto->getBestQualityUrl());
    }
}

$cache = new Edmunds\SDK\ApiCache('/path/to/cache');
$client = new Edmunds\SDK\VehicleApiClient('YOUR_API_KEY_HERE', $cache);