API documentation
Every endpoint returns JSON shaped as { success, data } on success and { success: false, message } on error.
Base URL: https://lottery.thiti.dev
Quick start
Sign up and issue an API key on the member page, then fetch the latest draw with this command.
bash
curl https://lottery.thiti.dev/api/v1/latest \
-H "X-API-Key: YOUR_API_KEY"Authentication
Send your API key in the X-API-Key header with every request.
HTTP header
X-API-Key: YOUR_API_KEYEndpoints
GET/api/v1/latest
Get the latest draw.
Example request
curl https://lottery.thiti.dev/api/v1/latest \
-H "X-API-Key: YOUR_API_KEY"Example response
{
"success": true,
"data": {
"resultDate": "2026-12-01",
"results": [
{
"fieldName": "first",
"nameTh": "",
"nameEn": "",
"price": 6000000,
"numbers": [{ "value": "123456", "round": 1 }]
}
]
}
}GET/api/v1/result/{date}
Get a draw by its date (YYYY-MM-DD).
Example request
curl https://lottery.thiti.dev/api/v1/result/2026-12-01 \
-H "X-API-Key: YOUR_API_KEY"POST/api/v1/check
Check up to 100 six-digit ticket numbers per request. Without date, the latest draw is used.
Example request
const res = await fetch('https://lottery.thiti.dev/api/v1/check', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'YOUR_API_KEY',
},
body: JSON.stringify({ numbers: ['123456', '654321'], date: '2026-12-01' }),
});
const { success, data } = await res.json();Example response
{
"success": true,
"data": {
"resultDate": "2026-12-01",
"results": [
{
"number": "123456",
"won": true,
"totalAmount": 6000000,
"prizes": [
{
"fieldName": "first",
"prizeNameTh": "",
"prizeNameEn": "",
"prize": "first",
"amount": 6000000,
"matchedNumber": "123456",
"round": 1
}
]
},
{ "number": "654321", "won": false, "totalAmount": 0, "prizes": [] }
]
}
}Error codes
| 400 | Invalid input, such as a malformed date or ticket number. |
| 401 | API key missing, invalid, revoked or expired. |
| 403 | Account suspended (Account is suspended.) or no active plan (Subscription is not active.) |
| 404 | No results found (for the requested date, or none stored yet). |
| 500 | Internal server error, including while validating the API key. |
JSON
{ "success": false, "message": "Invalid API key." }Interactive reference
See every schema and try the API on the Swagger page. /swagger (opens in a new tab)