ECU Models

Catalog ของ ECU ที่ Smongrot รองรับ — brand, model, protocol, map dimensions, supported PIDs, DTC definitions

List ECU models

GET /v1/ecu-models

Query parameters

ParamTypeDefaultหมายถึง
brandstring—filter ตาม brand เช่น Honda
protocolkline | canbus—filter ตาม protocol
verifiedtrue | false—filter ตาม is_verified
limitint25จำนวน (max 100)
cursorstring—opaque cursor สำหรับ next page

Example

curl "https://api.smongrot.com/v1/ecu-models?brand=Honda&verified=true&limit=5" \
  -H "Authorization: Bearer sk_live_..."
{
  "data": [
    {
      "ecu_code": "K2TG-T21",
      "brand": "Honda",
      "model": "Wave 125i NEW",
      "year_range": "2010-2013",
      "protocol": "kline",
      "fuel_map_size": "16x16",
      "ignition_map_size": "16x16",
      "supported_pids": null,
      "dtc_definitions": null,
      "is_verified": true
    }
  ],
  "count": 5,
  "next_cursor": "eyJhZnRlciI6IktZWi1UMDMifQ=="
}

Get single ECU

GET /v1/ecu-models/:ecu_code

Example

curl "https://api.smongrot.com/v1/ecu-models/K2TG-T21" \
  -H "Authorization: Bearer sk_live_..."
{
  "data": {
    "ecu_code": "K2TG-T21",
    "brand": "Honda",
    "model": "Wave 125i NEW",
    "year_range": "2010-2013",
    "protocol": "kline",
    "fuel_map_size": "16x16",
    "ignition_map_size": "16x16",
    "supported_pids": null,
    "dtc_definitions": null,
    "is_verified": true
  }
}

Response fields

FieldTypeหมายถึง
ecu_codestringรหัส ECU (Honda part number)
brandstringยี่ห้อรถ
modelstringโมเดลรถ
year_rangestring | nullช่วงปี เช่น "2010-2013"
protocolkline | canbusK-Line หรือ CAN Bus
fuel_map_sizestringขนาด fuel map เช่น "16x16"
ignition_map_sizestringขนาด ignition map
supported_pidsobject | nullPIDs ที่อ่านได้ (JSON)
dtc_definitionsobject | nullDTC codes และคำอธิบาย (JSON)
is_verifiedbooleanผ่านการทดสอบจริงบนรถแล้ว

Pagination

Sort order = ecu_code ASC. ถ้ามี result มากกว่า limit — จะได้ next_cursor string ที่ opaque

async function listAll(brand: string) {
  const all = [];
  let cursor: string | null = null;
  do {
    const url = new URL("https://api.smongrot.com/v1/ecu-models");
    url.searchParams.set("brand", brand);
    url.searchParams.set("limit", "100");
    if (cursor) url.searchParams.set("cursor", cursor);
    const res = await fetch(url, { headers: { Authorization: `Bearer ${KEY}` } });
    const { data, next_cursor } = await res.json();
    all.push(...data);
    cursor = next_cursor;
  } while (cursor);
  return all;
}

Errors

  • 404 not_found — ecu_code ไม่มีใน catalog
  • 401 unauthorized — key ผิด/หมด
  • 429 rate_limit_exceeded — เกินโควตา