astrom8 ไทย Get API key

Built for fortune products everywhere

Integration patterns — sample code plus the endpoints behind them

💬

LINE OA Fortune Bot

Many Thai fortune tellers reach followers through a LINE Official Account, and every message a user sends fires a webhook for you to handle.

Use astrom8 to call /api/v3/thai/calendar/day when users ask about today's lucky day. Reply with a LINE flex message built from the response.

No need to maintain reuk tables yourself. Without birth data the day's reuk is the same for every user, so one cached call a day can answer all of them. Starter allows 120 requests a minute, Pro 600.

typescript
// LINE webhook handler (Cloudflare Worker)
export default {
  async fetch(req: Request, env: Env) {
    const event = (await req.json()).events?.[0]
    if (event?.message?.text === 'today') {
      const r = await fetch('https://api.astrom8.com/api/v3/thai/calendar/day', {
        method: 'POST',
        headers: {
          Authorization: `Bearer ${env.ASTROM8_KEY}`,
          'Content-Type': 'application/json',
        },
        body: JSON.stringify({
          // Bangkok civil date (UTC+7), not the UTC date
          date: new Date(Date.now() + 7 * 3600_000).toISOString().slice(0, 10),
          timezoneOffsetMinutes: 420,
          latitude: 13.7563,
          longitude: 100.5018,
        }),
      }).then(r => r.json())

      return replyToLine(event.replyToken, {
        type: 'flex',
        altText: `${r.reuk.reuk_bon.class_th} (${r.reuk.reuk_bon.score}/5)`,
        contents: buildFlexCard(r),
      })
    }
  }
}
Endpoints used: /api/v3/thai/calendar/day, /api/v3/tarot/reports/three-card
📅

Auspicious Date Picker App

Customers pick wedding dates, opening days, moving dates, important meetings — every date needs to clear multiple reuk systems.

Each day is scored per system — Atthaloka, Dithi and Reuk Bon, 1–5 each — with Thai and English labels that explain why a day rates high or low.

Your app shows a 30-day calendar color-coded by score — users click any day and see the explanation immediately.

typescript
// Loop 30 days, color-code by score
const post = (path: string, body: object) =>
  fetch(`https://api.astrom8.com${path}`, {
    method: 'POST',
    headers: {
      Authorization: `Bearer ${process.env.ASTROM8_API_KEY}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify(body),
  }).then(r => r.json())

// Bangkok civil date (UTC+7) for day i
const bangkokDate = (i: number) =>
  new Date(Date.now() + 7 * 3600_000 + i * 86_400_000).toISOString().slice(0, 10)

const days = []
for (let i = 0; i < 30; i++) {
  const date = bangkokDate(i)
  const r = await post('/api/v3/thai/calendar/day', {
    date,
    timezoneOffsetMinutes: 420,
    latitude: 13.7563,
    longitude: 100.5018,
    birth_day_of_week: user.birth_day, // 'sun' … 'sat' or 'rahu'
  })
  days.push({
    date,
    score: r.reuk.reuk_bon.score,
    label: r.reuk.reuk_bon.class_th,
    color: r.reuk.reuk_bon.score >= 5 ? 'emerald'
         : r.reuk.reuk_bon.score >= 3 ? 'amber' : 'zinc',
  })
}
Endpoints used: /api/v3/thai/calendar/day (looped per day)
🪐

Astrology Chart Platform

Different customer segments want different astrology systems — Vedic for Indian audiences, Western for international, BaZi for Chinese community.

astrom8 puts all three behind one API key and one credit balance — call them in parallel as needed. One vendor, one OpenAPI spec for every request body.

Wheel Image Generation (Starter and up) turns the result into a personalized Maha Thaksa PNG, 1024×1024, ready to share on Instagram or Facebook.

typescript
// Run four calls in parallel with one key
const post = (path: string, body: object) =>
  fetch(`https://api.astrom8.com${path}`, {
    method: 'POST',
    headers: {
      Authorization: `Bearer ${process.env.ASTROM8_API_KEY}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify(body),
  }).then(r => r.json())

const bangkok = { latitude: 13.7563, longitude: 100.5018, timezoneOffsetMinutes: 420 }
const today = new Date(Date.now() + 7 * 3600_000).toISOString().slice(0, 10)

const [vedic, western, bazi, wheel] = await Promise.all([
  post('/api/v3/vedic/panchang', { date: today, ...bangkok }),
  // natal takes the birth time in UTC (08:30 Bangkok = 01:30Z)
  post('/v1/natal-chart', { birth_datetime: '1990-05-20T01:30:00Z', latitude: 13.7563, longitude: 100.5018 }),
  post('/api/v3/chinese/bazi', { date: '1990-05-20', time: '08:30', ...bangkok }),
  // the wheel image needs Starter or above (Free gets a 403)
  post('/api/v3/thai/wheel/image', { date: today, timezoneOffsetMinutes: 420, birth_day_of_week: user.birth_day }),
])

return { vedic, western, bazi, wheel_image_url: wheel.image_url }
Endpoints used: /api/v3/vedic/panchang, /v1/natal-chart, /api/v3/chinese/bazi, /api/v3/thai/wheel/image
👥

HR talent screening

Structured HR assessment combining BaZi day-master profiling, native Thaksa outlook, bilingual narratives, role-fit scoring, and optional signed PDF output.

Available on the Growth plan and up — pair the signal with your standard interviews and skills screens. Contact us for volume or enterprise contracts.

Available · Growth

Available through the API on Growth and up — reach out for org-wide pricing or custom quotas. Contact us →

Endpoint: POST /api/v3/reports/hr-screening (PDF via include_pdf when enabled)