Public API quickstart

เริ่มใช้ Smongrot Public API ใน 3 ขั้นตอน — ใช้เวลาไม่เกิน 60 วินาที

1. สร้าง API Key

  1. Sign in ด้วย email
  2. เข้า Dashboard → กด Create Key → ตั้งชื่อ (เช่น MyTuningApp)
  3. Copy key ที่ขึ้นต้นด้วย sk_live_... — จะแสดงครั้งเดียว ระวังหลุด

2. ยิง request แรก

curl "https://api.smongrot.com/v1/ecu-models" \
  -H "Authorization: Bearer sk_live_..."

Response:

{
  "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",
      "is_verified": true
    }
  ],
  "count": 39,
  "next_cursor": null
}

3. รู้จัก rate limit

ทุก response มี header:

Headerตัวอย่างหมายถึง
X-RateLimit-Limit1000โควตาต่อวัน (UTC)
X-RateLimit-Remaining987เหลือกี่ req
X-RateLimit-Reset29322seconds จนถึง UTC midnight

Free tier = 1,000 req/day. ยิงเกิน → 429 Too Many Requests พร้อม Retry-After header

Base URL

https://api.smongrot.com/v1

ระหว่าง beta (Cloudflare Worker ยังไม่ setup): https://kcxjdcppzcdnzgzerhxd.functions.supabase.co/public-api/v1

Endpoints ทั้งหมด

MethodPathทำอะไร
GET/ecu-modelsList ECU catalog
GET/ecu-models/:ecu_codeECU รายละเอียด
GET/tune-presetsList official presets
GET/tune-presets/:idPreset รายละเอียด
GET/schemasJSON Schemas
GET/healthPing

Next steps