ମୂଳ ବିଷୟବସ୍ତୁକୁ ଯାଆନ୍ତୁ
API key ନିଅନ୍ତୁ

ଗାଇଡ୍ · ଜ୍ୟୋତିଷ

Daily Panchang

ଏକ ସ୍ଥାନୀୟ ଦୈନିକ ପଞ୍ଚାଙ୍ଗ କ୍ୟାଲେଣ୍ଡର ତିଆରି କରନ୍ତୁ।

ସ୍ୟାଣ୍ଡବକ୍ସରେ ଏହି ଅନୁରୋଧ ଚେଷ୍ଟା କରନ୍ତୁ

1 କାମ କରୁଥିବା ଏକ ଅନୁରୋଧ କରନ୍ତୁ

POST /v1/astrology/calculate
curl -X POST "$MANTRILO_API_URL/v1/astrology/calculate" \
  -H "Authorization: Bearer $MANTRILO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"date":"2026-11-15","latitude":28.6139,"longitude":77.209,"timezone":"Asia/Kolkata","operation":"daily-panchang"}'
ଯାଞ୍ଚିତ ନୂଆଦିଲ୍ଲୀ ରେସପନ୍ସର ଅଂଶ200 OK
{
  "data": {
    "operation": "daily-panchang",
    "engineVersion": "mantrilo-vedic-1",
    "date": "2026-11-15",
    "timezone": "Asia/Kolkata",
    "basis": "local_sunrise",
    "sunrise": "06:43:19",
    "sunset": "17:27:50",
    "tithi": {
      "number": 6,
      "name": "Shashti",
      "paksha": "Shukla",
      "endsAt": "2026-11-16T02:01:40.095280+05:30"
    },
    "nakshatra": {
      "number": 21,
      "name": "Uttara Ashadha",
      "pada": 2,
      "lord": "Sun",
      "endsAt": "2026-11-15T23:29:06.472952+05:30"
    },
    "yoga": {
      "number": 10,
      "name": "Ganda",
      "endsAt": "2026-11-16T07:16:28.084160+05:30"
    },
    "karanas": [
      {
        "number": 3,
        "name": "Kolav",
        "endsAt": "2026-11-15T12:44:29.104828+05:30"
      },
      {
        "number": 4,
        "name": "Tetil",
        "endsAt": "2026-11-16T02:01:40.095280+05:30"
      }
    ],
    "rahuKalam": {
      "start": "16:07",
      "end": "17:27"
    }
  },
  "calculated": true
}

2 ଆପଣଙ୍କ ସର୍ଭରରୁ ଏହାକୁ କଲ୍ କରନ୍ତୁ

key କୁ ଆପଣଙ୍କ ବ୍ୟାକଏଣ୍ଡରେ ରଖନ୍ତୁ ଏବଂ କେବଳ କଣ୍ଟେଣ୍ଟ ଆପଣଙ୍କ ଆପ୍‌କୁ ଫେରାନ୍ତୁ। ଏହି Node.js ସର୍ଭର ଗୋଟିଏ ରୁଟ୍ ଦିଏ ଯାହାକୁ ଆପଣଙ୍କ ଆପ୍ କଲ୍ କରିପାରିବ।

server.mjs
// server.mjs · Node.js 22+
import { createServer } from 'node:http';

const apiKey = process.env.MANTRILO_API_KEY;
if (!apiKey) throw new Error('Set MANTRILO_API_KEY on your server.');
const base = process.env.MANTRILO_API_URL ?? "https://api.mantrilo.com";

async function mantrilo(path, input) {
  const response = await fetch(base + path, {
    method: input ? 'POST' : 'GET',
    headers: {
      Authorization: 'Bearer ' + apiKey,
      ...(input ? { 'Content-Type': 'application/json' } : {}),
    },
    ...(input ? { body: JSON.stringify(input) } : {}),
    signal: AbortSignal.timeout(20000),
    redirect: 'error',
  });
  const result = await response.json();
  if (!response.ok) throw Object.assign(new Error('Mantrilo request failed'), {
    status: response.status, requestId: result.requestId,
  });
  return result;
}

async function load(incoming, input) {
  return mantrilo("/v1/astrology/calculate", { ...input, operation: "daily-panchang" });
}

createServer(async (req, res) => {
  const incoming = new URL(req.url, 'http://localhost');
  res.setHeader('Content-Type', 'application/json');
  if (req.method !== 'POST' || incoming.pathname !== '/api/mantrilo-guide') {
    res.writeHead(404).end(JSON.stringify({ error: 'Not found' }));
    return;
  }
  try {
    let text = '';
    for await (const chunk of req) {
      text += chunk;
      if (Buffer.byteLength(text) > 16384) {
        res.writeHead(413).end(JSON.stringify({ error: 'Input is too large' }));
        return;
      }
    }
    let input;
    try { input = JSON.parse(text); } catch { input = null; }
    if (!input || typeof input !== 'object' || Array.isArray(input)) {
      res.writeHead(400).end(JSON.stringify({ error: 'Send a JSON object' }));
      return;
    }
    const result = await load(incoming, input);
    res.end(JSON.stringify(result));
  } catch (error) {
    res.writeHead(error.status ?? 502).end(JSON.stringify({
      error: 'Could not load this content',
      requestId: error.requestId,
    }));
  }
}).listen(3000, '127.0.0.1');
ଆପଣଙ୍କ ଭ୍ୟୁରେ
const { sunrise, sunset, tithi } = data;

3 ଇନପୁଟ୍ ଓ ପେଜିନେସନ୍

ଏକ ସ୍ଥାନୀୟ date (YYYY-MM-DD), ଦଶମିକ ଡିଗ୍ରୀରେ latitude ଓ longitude, ଏବଂ ଏକ IANA timezone ଦିଅନ୍ତୁ।

data.date, sunrise, sunset, tithi, nakshatra, yoga, karanas ଓ rahuKalam ଦେଖାନ୍ତୁ।

4 କୋଟା

ଗୋଟିଏ ସଫଳ କଲ୍‌ରେ ଗୋଟିଏ କଣ୍ଟେଣ୍ଟ ଅନୁରୋଧ ଖର୍ଚ୍ଚ ହୁଏ। ସ୍ୟାଣ୍ଡବକ୍ସ ଓ ଲାଇଭ୍ ଅନୁରୋଧର ବ୍ୟବହାର ଅଲଗା ଅଲଗା ଗଣାଯାଏ। ବିଫଳ ଗଣନାର ଅନୁରୋଧ ଫେରସ୍ତ କରାଯାଏ।

ଅନୁରୋଧଗୁଡ଼ିକ MANTRILO_API_URL ରୁ ବେସ୍ URL ପଢ଼େ। ସର୍ଭର ଉଦାହରଣଟି ଡିଫଲ୍ଟ ଭାବେ https://api.mantrilo.com ବ୍ୟବହାର କରେ।