เริ่มต้นใช้งาน
เริ่มใช้งานใน 5 นาที
จาก zero ถึง first request — เลือกภาษาที่ทีมคุณใช้
1. สมัครและสร้าง API key
สร้าง account ฟรี ไปที่ Dashboard > API Keys แล้วกด Create key. คัดลอก key ตอนสร้าง เพราะระบบจะแสดงครั้งเดียว
สมัครฟรี →2. เรียก API ครั้งแรก
ใช้ endpoint เด่นที่สุดของเรา — Thai Calendar Day — รวมฤกษ์ 5 ระบบใน request เดียว
// Bun / Node 18+ — uses the native fetch
const res = await fetch('https://api.astrom8.com/api/v3/thai/calendar/day', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ASTROM8_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
date: '2026-05-09',
birth_date: '1990-05-20',
birth_day_of_week: 'mon',
lat: 13.7563,
lng: 100.5018,
}),
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const data = await res.json()
console.log(data.day_quality.label_th)3. อ่าน response
ทุก field มี label ภาษาไทย+อังกฤษ ใช้กับ UI ได้เลย
{
"day_quality": {
"score": 85,
"label_th": "มงคล",
"label_en": "Auspicious"
},
"thaksa": {
"position_th": "เจ้าชะตา",
"score": 5
},
"maha_thaksa": {
"today_position": {
"position_th": "เดช",
"score": 5
}
},
"reuk_bon": {
"nakshatra_th": "อนุราธา",
"class": 1,
"label_th": "ฤกษ์ดีเยี่ยม"
},
"dithi": {
"lunar_day": 12,
"label_th": "ฤกษ์ดี"
},
"wan_phra": false,
"pee_chong": false,
"request_id": "req_a1b2c3d4"
}4. ขั้นตอนต่อไป
อ่านเรื่อง Authentication, Rate Limits, แล้วลอง endpoint อื่นในหมวดที่เกี่ยวข้องกับ use case ของคุณ