Skip to content

autoapicom/auto-api-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

auto-api-client-php

Packagist Version PHP Version License

PHP wrapper for auto-api.com — unified access to car listings from encar, mobile.de, autoscout24, che168 and other marketplaces.

Covers 8 sources across Korea, Europe, China and UAE. Fetch offers, filter by brand/year/price, track listing changes over time. Requires PHP 8.1+ and Guzzle.

Installation

composer require autoapi/client

Usage

use AutoApi\Client;

$client = new Client('your-api-key', 'https://api1.auto-api.com');

Get filters

$filters = $client->getFilters('encar');

Search offers

$offers = $client->getOffers('mobilede', [
    'page' => 1,
    'brand' => 'BMW',
    'year_from' => 2020,
]);

// Pagination
$page = $offers['meta']['page'];
$nextPage = $offers['meta']['next_page'];

Get single offer

$offer = $client->getOffer('encar', '40427050');

Track changes

$changeId = $client->getChangeId('encar', '2025-01-15');
$changes = $client->getChanges('encar', $changeId);

// Next batch
$nextChangeId = $changes['meta']['next_change_id'];
$moreChanges = $client->getChanges('encar', $nextChangeId);

Get offer by URL

$info = $client->getOfferByUrl('https://encar.com/dc/dc_cardetailview.do?carid=40427050');

Error handling

use AutoApi\Exception\AuthException;
use AutoApi\Exception\ApiException;

try {
    $offers = $client->getOffers('encar', ['page' => 1]);
} catch (AuthException $e) {
    // 401/403 — invalid API key
} catch (ApiException $e) {
    echo $e->getStatusCode();
    echo $e->getMessage();
}

Supported sources

Source Platform Region
encar encar.com South Korea
mobilede mobile.de Germany
autoscout24 autoscout24.com Europe
che168 che168.com China
dongchedi dongchedi.com China
guazi guazi.com China
dubicars dubicars.com UAE
dubizzle dubizzle.com UAE

Other languages

Language Package
TypeScript @autoapicom/client
Python autoapicom-client
Go auto-api-go
C# AutoApi.Client
Java auto-api-client
Ruby auto-api-client
Rust auto-api-client

Documentation

auto-api.com

About

PHP wrapper for the auto-api.com car listings API (encar, mobile.de, autoscout24 and more)

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages