документация

Документация Encar API

Три эндпоинта, один заголовок, JSON на выходе. Всё ниже — полный справочник; второй, платной документации не существует.

Базовый URL

https://api.encar-api.com/api

Авторизация

Передавайте ключ в заголовке x-api-key при каждом запросе. Никакого OAuth и никаких токенов для обновления. Отсутствующий или неизвестный ключ отвечает 401.

curl -H "x-api-key: avg_free_..." \
  "https://api.encar-api.com/api/cars?manufacturer=BMW&model=X5\
&fuel=diesel&priceTo=40000&sort=priceAsc&count=24"

Три эндпоинта

endpointwhat it does
GET /carsПоиск объявлений с фильтрами. Возвращает total, page, count и results[].
GET /car?id=Один автомобиль целиком, с проверкой наличия в момент запроса.
GET /countСколько объявлений подходит под набор фильтров, без их выгрузки.

Справочник

Каждый раздел раскрывается здесь, и каждый заголовок — это ещё и отдельная страница, на которую можно сослаться.

Параметры поиска — GET /cars

Их можно сочетать в одном вызове. В ответе есть total, page, count и results[], поэтому листать можно по total без второго запроса.

parameterwhat it does
manufacturerBrand, as Encar writes it: BMW, Hyundai, Kia, Genesis, Mercedes-Benz, Audi.
modelModel name, e.g. X5 (G05). Partial names match, and a generation name narrows further: model=The New Carnival returns that generation alone, not the whole nameplate.
qFree-text search across brand, model and badge. Aliases: keyword, search.
fueldiesel · gasoline · hybrid · electric · lpg.
transmissionautomatic · manual.
colorExterior colour.
seatsSeat count: 5, 7, 9. Several at once as seats=7,9. The two ends are ranges, not counts — 2 means two seats or fewer and 10 means ten or more, which is how the source files them. A car's own figure comes back as details.seats from /car.
yearFrom / yearToModel year bounds, as plain years: 2018, 2024.
mileageFrom / mileageToOdometer bounds in kilometres.
priceFrom / priceToPrice bounds in EUR — converted for you, not won.
sortpriceAsc or priceDesc. Left out, results come back newest first.
pagePage index, zero-based. Default 0.
countListings per page. Default 24, maximum 500.
Параметры поиска — GET /cars →

Как выглядит объявление

Данные приходят из корейского источника, поэтому четыре поля по умолчанию читаются неверно. Каждая такая ошибка тихая — страница отрисуется, просто неправильно.

fieldmeaning
IdEncar listing id. Pass it to /car to get the full vehicle.
Manufacturer / Model / BadgeKorean source values. Badge is partly Korean — prefer the de / en block below.
de / enThe same car translated: manufacturer, modelGroup, model, badge, fuelType. Render these.
PriceIn units of 10,000 KRW. EUR ≈ Price × 6.7, so 4339 is about €29,070 — not €4,339.
YearYYYYMM, not a year: 201902 is February 2019. FormYear holds the plain "2019".
MileageKilometres, as an integer.
FuelTypeKorean. The translated value is in de.fuelType / en.fuelType.
Photo / Photos[]Relative paths. Prefix them with the image host; with Photo, append 001.jpg.
priceDropPresent when the seller cut the price: previousPrice, droppedAt.
powerPs / powerKwEngine output, where the trim is known.
OfficeCityStateWhere the car stands, as a Korean region name.
Как выглядит объявление →

Лимиты и ошибки

В каждом ответе есть X-RateLimit-Limit, X-RateLimit-Remaining и X-RateLimit-Reset, поэтому лимит видно заранее, а не по факту.

statusmeaning
200A normal answer. Check X-RateLimit-Remaining while you are here.
400A parameter could not be parsed — a non-numeric yearFrom, for instance.
401Missing or unknown key. Send it as the x-api-key header.
404 SOLD_OR_REMOVEDFrom /car: the vehicle is gone from Encar. Drop it on your side.
429Daily allowance spent. X-RateLimit-Remaining tells you before it happens.
503The Korean source did not answer in time. Retry once, then fall back.
Лимиты и ошибки →

Получите свой API-ключ

Бесплатно · 100 запросов в сутки

Получить доступ →