ภาพรวม
Endpoints
สถานะผลหวย
status
success
มีเลขออกแล้ว
pending
ถึงวันหวยแล้ว แต่ยังไม่ออกเลข
close
วันนั้นปิดรับ / ไม่ใช่งวด
หมวด categories
ค่าที่ใช้บ่อย
| category | ความหมาย |
|---|---|
lottothaihot | หวยยอดฮิตประเทศไทย (รวม LPP ลาวพัฒนาพิเศษ) |
lottoforeign | หวยต่างประเทศ |
maekhong | หวยแม่โขง (จาก LAOLOTTO) |
liw | หวย LIW ทุก 15 นาที (จาก liwlottery.com) |
stock | หวยหุ้นต่างประเทศ |
GET /api/results
ผลหวยตามวันที่
ดึงผลหวยทุกหมวดของวันที่เลือก รวมแม่โขงและ LIW
Query parameters
| ชื่อ | จำเป็น | ตัวอย่าง | รายละเอียด |
|---|---|---|---|
date | ไม่ | 2026-08-21 | รูปแบบ YYYY-MM-DD (ค่าเริ่มต้น = วันนี้ เวลาไทย) |
sync | ไม่ | 1 | บังคับดึงใหม่จากต้นทางทันที |
ตัวอย่าง URL
https://thailottoapi.com/api/resultshttps://thailottoapi.com/api/results?date=2026-08-21https://thailottoapi.com/api/results?date=2026-08-21&sync=1ฟิลด์สำคัญ
| ฟิลด์ | รายละเอียด |
|---|---|
key | รหัสหวย เช่น thailotto, mkn, liw#1915 |
label | ชื่อแสดง |
status | success | pending | close |
statusMessage | ข้อความสถานะเมื่อยังไม่มีเลข |
drawDate / drawDateDisplay | วันงวด / รูปแบบ DD.MM.YYYY |
result / top3 / bottom2 / bottom3 | เลขที่ออก (string) |
dataresult | วัตถุดิบ รวม result_image / result_video ของ LIW |
schedule | เวลาเปิด–ปิดรับ |
icon | URL ไอคอน |
ตัวอย่าง response
{
"ok": true,
"date": "2026-08-21",
"count": 83,
"categories": {
"lottothaihot": { "title": "...", "columns": "thai", "items": [ /* ... */ ] },
"lottoforeign": { "title": "...", "items": [ /* ... */ ] },
"maekhong": { "title": "ผลหวยแม่โขง", "items": [ /* ... */ ] },
"liw": { "title": "ผลหวย LIW", "items": [ /* ... */ ] },
"stock": { "title": "...", "items": [ /* ... */ ] }
}
}GET /api/schedules
เงื่อนไขเปิด–ปิด / ออกผล
ตารางเวลาและรายละเอียดของแต่ละหวย ไม่ผูกกับวันที่
Query parameters
| ชื่อ | จำเป็น | ตัวอย่าง | รายละเอียด |
|---|---|---|---|
key | ไม่ | malaylotto | ดึงหวยเดียว |
category | ไม่ | stock | กรองหมวด: lottothaihot | lottoforeign | maekhong | liw | stock |
ตัวอย่าง URL
https://thailottoapi.com/api/scheduleshttps://thailottoapi.com/api/schedules?key=malaylottohttps://thailottoapi.com/api/schedules?category=maekhongฟิลด์สำคัญ
| ฟิลด์ | รายละเอียด |
|---|---|
key / label | รหัสและชื่อหวย |
openDetail / closeDetail | ข้อความเปิดรับ / ปิดรับ |
resultApprox | เวลาออกผลโดยประมาณ |
drawRule | เงื่อนไขวันที่มีผล |
statusGuide | ความหมาย success / pending / close |
notes | หมายเหตุเพิ่มเติม |
ตัวอย่าง response
{
"ok": true,
"count": 36,
"guide": {
"success": "มีผลแล้ว",
"pending": "ถึงวันหวยแล้ว แต่ยังไม่ออกเลข",
"close": "วันนั้นไม่เปิดรับ / ไม่ใช่งวด"
},
"categories": { /* จัดกลุ่มตามหมวด */ },
"items": [ /* รายการหวย */ ]
}POST /api/sync
บังคับซิงก์ผลเข้าฐานข้อมูล
สำหรับระบบภายใน — ต้องส่ง header ความลับ
endpoint นี้ต้องมีรหัสลับ — ไม่เปิดสาธารณะ
ตัวอย่าง URL
ฟิลด์สำคัญ
| ฟิลด์ | รายละเอียด |
|---|---|
Header | x-sync-secret: <SYNC_SECRET> |
Body JSON | { "date": "2026-08-21" } (ไม่ส่ง = วันนี้) |
ตัวอย่าง response
{
"ok": true,
"queryDate": "2026-08-21",
"saved": 90,
"successCount": 70
}curl
ตัวอย่างเรียกใช้
# ผลวันนี้
curl "https://thailottoapi.com/api/results"
# ผลวันที่กำหนด
curl "https://thailottoapi.com/api/results?date=2026-08-21"
# เงื่อนไขหวยทั้งหมด
curl "https://thailottoapi.com/api/schedules"
# เงื่อนไขหวยเดียว
curl "https://thailottoapi.com/api/schedules?key=mkn"
# บังคับ sync (ต้องมี secret)
curl -X POST "https://thailottoapi.com/api/sync" \
-H "content-type: application/json" \
-H "x-sync-secret: YOUR_SECRET" \
-d '{"date":"2026-08-21"}'