# Encar API — South Korea's #1 used-car marketplace scraper: search live Encar listings by make, model, year, price, mileage, fuel, transmission and region, then pull full car detail (price in KRW, year, mileage, fuel, transmission, color, options, inspection & accident-record status, warranty, photos and dealer firm) and browse all Korean & imported makes with live counts. No API key, no login required.

> Search live Encar used-car listings by structured filters: make, model, trim, car_type (domestic/imported), fuel, transmission, region, price_min/max (in 만원 = 10,000 KRW), year_min/max and mileage_min/max. Sortable + paginated. Returns rich cards with price (native 만원 + KRW), year, mileage, fuel, transmission, region, trust/condition flags, thumbnail and photos.
> ReefAPI engine `encar` · 3 endpoints · clean JSON, no scraping or browsers to manage.

## How to call
- **Endpoint:** `POST https://api.reefapi.com/encar/v1/<action>` with a JSON body.
- **Auth:** header `x-api-key: <YOUR_REEFAPI_KEY>` — create one free (1,000 credits, no card): https://reefapi.com/signup
- **Response (every call):** `{ ok: boolean, data: ..., meta: { record_count, credits, ... }, error: { code, message } }` — branch on `ok`. Failed or blocked calls are free.
- **One key + one shared credit pool** across every ReefAPI API. Per-call credits are listed on each endpoint below.
- **Use it from an AI agent (MCP):** connect `https://api.reefapi.com/mcp` (remote streamable-http, `Authorization: Bearer <key>`) and your assistant can call these actions directly.

## Endpoints

### POST /encar/v1/search — 1 credit
Search live Encar used-car listings by structured filters: make, model, trim, car_type (domestic/imported), fuel, transmission, region, price_min/max (in 만원 = 10,000 KRW), year_min/max and mileage_min/max. Sortable + paginated. Returns rich cards with price (native 만원 + KRW), year, mileage, fuel, transmission, region, trust/condition flags, thumbnail and photos.

**Parameters:**
- `make` (string, optional) — Vehicle make. English names (Hyundai, Kia, BMW, Mercedes-Benz, Audi, Toyota, Tesla, Genesis…) are auto-translated to Encar's Korean brand; you may also pass the exact Korean name from a search result.
- `model` (string, optional) — Model name — use the EXACT model string returned by `search` (Korean, e.g. '더 뉴 아반떼'). Pair with `make`.
- `trim` (string, optional) — Trim / badge — the exact value from a search result's `trim`.
- `car_type` (enum, optional) — Limit to domestic Korean or imported cars. Omit for both. [one of: domestic, imported]
- `fuel` (enum, optional) — Fuel / powertrain type. [one of: gasoline, diesel, lpg, hybrid, electric, hydrogen, gasoline_hybrid, cng]
- `transmission` (enum, optional) — Transmission type. [one of: automatic, manual]
- `region` (string, optional) — Dealer region (Korean province/city: 서울 Seoul, 경기 Gyeonggi, 부산 Busan, 인천 Incheon, 대구 Daegu…).
- `price_min` (integer, optional) — Minimum price in 만원 (10,000 KRW). 1000 = ₩10,000,000.
- `price_max` (integer, optional) — Maximum price in 만원 (10,000 KRW). 4000 = ₩40,000,000.
- `year_min` (integer, optional) — Minimum model year (e.g. 2020). YYYYMM also accepted (202006).
- `year_max` (integer, optional) — Maximum model year (e.g. 2024). YYYYMM also accepted (202412).
- `mileage_min` (integer, optional) — Minimum odometer reading in kilometres.
- `mileage_max` (integer, optional) — Maximum odometer reading in kilometres.
- `sort` (enum, optional, default "newest") — Result ordering. [one of: newest, price_asc, price_desc, mileage_asc, mileage_desc, year_desc, year_asc]
- `page` (integer, optional, default 1) — Page number (1-based).
- `size` (integer, optional, default 20) — Results per page (1–50). Defaults to 20.

**Returns:** cars[]{id, make, model, trim, year, year_month, form_year, mileage_km, price_manwon, price_krw, fuel_type, transmission, ev_type, region, sell_type, trust_flags[], condition_flags[], thumbnail, photos[], url} + meta{total_results, pagination}

**Example request body:**
```json
{
  "make": "Hyundai",
  "size": 20
}
```

### POST /encar/v1/detail — 1 credit
Full detail for one car by `id`: price (만원 + KRW), make/model/grade (Korean + English), year, mileage, displacement, transmission, fuel, color, seats, body type, options, warranty, inspection & accident-record availability, seizing/pledge counts, VIN (when public), all photos, view count, free-text description and the selling dealer's firm. Dealer personal data (name/phone/id/address) is redacted unless include_pii is set.

**Parameters:**
- `id` (string, required) — Encar car id — the number in a dc_cardetailview carid= URL or a search result's `id`.

**Returns:** car{id, vehicle_no, vin, make, make_en, model, model_group, grade, grade_en, year, year_month, domestic, import_type, mileage_km, displacement_cc, transmission, fuel_type, color, seat_count, body_type, price_manwon, price_krw, status, trust_flags[], home_service, warranty_body_months, accident_record_available, accident_resume_available, inspection_available, seizing_count, pledge_count, photos[], option_codes[], view_count, first_advertised_at, description, dealer{firm_name, firm_code, user_type}, url}

### POST /encar/v1/makes — 0 credits
Browse all Korean (domestic) and imported makes available on Encar, each with its live listing count. Use a returned make name with `search`'s `make` filter. Counts are pulled live from the search API (not a stale list).

**Parameters:**
- `car_type` (enum, optional) — Limit to domestic Korean or imported cars. Omit for both. [one of: domestic, imported]

**Returns:** makes[]{make, make_en, car_type, count}

## More
- Try it live, no code: https://reefapi.com/playground?engine=encar
- Human docs page: https://reefapi.com/docs/encar
- Every ReefAPI API in one file (for your AI): https://reefapi.com/llms-full.txt
