@autoapicom/client
v1.0.5
Published
Auto-api.com client for Node.js — fetch car listings from encar, mobile.de, autoscout24 and 5 other sources
Maintainers
Readme
auto-api-client-typescript
TypeScript client for the auto-api.com car listings API. Zero dependencies — uses the built-in fetch.
Search and filter offers across 8 marketplaces (encar, mobile.de, autoscout24, che168, dongchedi, guazi, dubicars, dubizzle), track price changes, pull individual listings by ID or URL.
Installation
npm install @autoapicom/clientUsage
import { Client } from '@autoapicom/client';
const client = new Client('your-api-key', 'https://api1.auto-api.com');Get filters
const filters = await client.getFilters('encar');Search offers
const offers = await client.getOffers('mobilede', {
page: 1,
brand: 'BMW',
year_from: 2020,
});
// Pagination
console.log(offers.meta.page);
console.log(offers.meta.next_page);Get single offer
const offer = await client.getOffer('encar', '40427050');Track changes
const changeId = await client.getChangeId('encar', '2025-01-15');
const changes = await client.getChanges('encar', changeId);
// Next batch
const nextBatch = await client.getChanges('encar', changes.meta.next_change_id);Get offer by URL
const info = await client.getOfferByUrl('https://encar.com/dc/dc_cardetailview.do?carid=40427050');Error handling
import { Client, AuthError, ApiError } from '@autoapicom/client';
try {
const offers = await client.getOffers('encar', { page: 1 });
} catch (e) {
if (e instanceof AuthError) {
// 401/403 — invalid API key
} else if (e instanceof ApiError) {
console.log(e.statusCode);
console.log(e.message);
}
}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 | |----------|---------| | PHP | autoapi/client | | Python | autoapicom-client | | Go | auto-api-go | | C# | AutoApi.Client | | Java | auto-api-client | | Ruby | auto-api-client | | Rust | auto-api-client |
