Tune Presets
Official tune presets — mechanic authored และ Smongrot staff verified. คืน delta bundle (ไม่ใช่ full fuel/ignition map)
List presets
GET /v1/tune-presets
เฉพาะ presets ที่ is_official=true เท่านั้น — draft/private presets ไม่แสดง
Query parameters
| Param | Type | Default | หมายถึง |
|---|---|---|---|
ecu_model | string | — | filter ตาม ECU family (เช่น K2TG-T21) |
limit | int | 25 | จำนวน (max 100) |
cursor | string | — | opaque cursor |
Example
curl "https://api.smongrot.com/v1/tune-presets?ecu_model=K2TG-T21" \
-H "Authorization: Bearer sk_live_..."
{
"data": [
{
"id": "a0000001-0000-0000-0000-00000000a001",
"ecu_model": "K2TG-T21",
"name": "ประหยัด",
"icon": "🌱",
"description_th": "ลดน้ำมันรอบกลาง 3-5% นุ่มกว่า เดินทางไกล",
"deltas": [
{ "table_label": "Fuel Map (รอบกลาง)", "delta": -4.0, "unit": "%" },
{ "table_label": "Fuel Map (รอบสูง)", "delta": -2.5, "unit": "%" },
{ "table_label": "Ignition (รอบกลาง)", "delta": 1.5, "unit": "°" }
],
"validated_on": 24,
"created_at": "2026-06-01T00:00:00Z"
}
],
"count": 1,
"next_cursor": null
}
Get single preset
GET /v1/tune-presets/:id
Example
curl "https://api.smongrot.com/v1/tune-presets/a0000001-0000-0000-0000-00000000a001" \
-H "Authorization: Bearer sk_live_..."
Returns the same object as list.
Response fields
| Field | Type | หมายถึง |
|---|---|---|
id | uuid | Preset ID |
ecu_model | string | ECU family (เช่น K2TG-T21) — join กับ ecu_models.ecu_code |
name | string | ชื่อ preset (Thai) |
icon | string | Emoji |
description_th | string | คำอธิบายภาษาไทย |
deltas | array | Array of delta objects (ดูข้างล่าง) |
validated_on | int | จำนวนคันที่ทดสอบแล้ว |
created_at | timestamp | ISO 8601 UTC |
Delta object
interface Delta {
table_label: string; // "Fuel Map (รอบกลาง)"
delta: number; // -4.0
unit: "%" | "°"; // percentage หรือ degree
}
Fuel Map deltas = % ปรับ (positive = เพิ่มน้ำมัน, negative = ลด)
Ignition Timing deltas = ° (positive = จุดระเบิดเร็วขึ้น, negative = ช้าลง)
เอา delta ไปทำอะไร
Deltas = relative adjustment จาก stock values ไม่ใช่ absolute values ให้:
- Fetch stock map ของ ECU นั้น (จาก XDF/BIN — ไม่รวมใน API v1)
- Apply delta ต่อ region ตามชื่อ
table_label - Flash กลับ ECU
⚠️ อย่า apply preset ตรงกับรถที่ ECU ไม่ตรง — delta ที่ safe สำหรับ Wave 125i อาจไม่ safe กับ Click 125i
Errors
404 not_found— preset id ไม่มี หรือis_official=false401 unauthorized429 rate_limit_exceeded
ทำไมไม่มี full fuel/ignition map?
API v1 = delta bundles ที่ safe และ share ได้ ไม่มี raw XDF/BIN เพื่อ:
- ป้องกันไม่ให้ dev ที่ไม่มี license แจก tune ที่ทำเสียเครื่อง
- เก็บ author IP ไว้ (mechanic เป็นเจ้าของ full tune)
v2 จะมี write endpoint ให้ partner shop upload full tune ผ่าน moderation pipeline