Skip to content

TypeScript/Node.js client for auto-api.com — fetch car listings from encar, mobile.de, autoscout24, che168 and other marketplaces

License

Notifications You must be signed in to change notification settings

autoapicom/auto-api-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

auto-api-client-typescript

npm version Node version License

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/client

Usage

import { Client } from '@autoapicom/client';

const client = new Client('your-api-key');

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

Documentation

auto-api.com

About

TypeScript/Node.js client for auto-api.com — fetch car listings from encar, mobile.de, autoscout24, che168 and other marketplaces

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published