Public API quickstart
เริ่มใช้ Smongrot Public API ใน 3 ขั้นตอน — ใช้เวลาไม่เกิน 60 วินาที
1. สร้าง API Key
- Sign in ด้วย email
- เข้า Dashboard → กด Create Key → ตั้งชื่อ (เช่น
MyTuningApp) - 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-Limit | 1000 | โควตาต่อวัน (UTC) |
X-RateLimit-Remaining | 987 | เหลือกี่ req |
X-RateLimit-Reset | 29322 | seconds จนถึง 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 ทั้งหมด
| Method | Path | ทำอะไร |
|---|---|---|
GET | /ecu-models | List ECU catalog |
GET | /ecu-models/:ecu_code | ECU รายละเอียด |
GET | /tune-presets | List official presets |
GET | /tune-presets/:id | Preset รายละเอียด |
GET | /schemas | JSON Schemas |
GET | /health | Ping |