Karana API with Express

Integrate Karana API in Express. Complete code examples and SDK documentation.

Operation

POST /v2/astrology/karana

Karana (half-tithi) for a given datetime and location, with its nature and recommended/avoided activities.

Parameters

NameInTypeDescription
datetimebodystring—
latitudebodynumber—
longitudebodynumber—
timezonebodystring—

Request example for Express

Authenticate with Authorization: Bearer YOUR_API_KEY. Keep the key in the VEDIKA_API_KEY environment variable on your server and never in source control.

import express from 'express';

const app = express();

async function callVedika() {
  const upstream = await fetch('https://api.vedika.io/v2/astrology/karana', {
    method: 'POST',
    headers: {
      Authorization: `Bearer ${process.env.VEDIKA_API_KEY}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      "datetime": "2026-03-23T12:00:00",
      "latitude": 28.6139,
      "longitude": 77.209,
      "timezone": "+05:30"
    }),
  });
  return { status: upstream.status, data: await upstream.json() };
}

app.get('/vedika/karana', async (_req, res) => {
  const { status, data } = await callVedika();
  res.status(status).json(data);
});

app.listen(3000);

Try it in the keyless sandbox

The sandbox mirrors the production route and needs no API key:

curl -X POST https://api.vedika.io/sandbox/astrology/karana \
  -H "Content-Type: application/json" \
  -d '{"datetime":"2026-03-23T12:00:00","latitude":28.6139,"longitude":77.209,"timezone":"+05:30"}'

Sandbox response from POST /sandbox/astrology/karana, abridged (billing block, long text fields and long lists trimmed). The sandbox answers with a fixed demo result and ignores your inputs; a production call computes the result for the details you send.

{
  "data": {
    "ayanamsa": {
      "id": 1,
      "name": "Lahiri",
      "value": 23.79065
    },
    "coordinates": {
      "latitude": 28.6139,
      "longitude": 77.209
    },
    "datetime": "1995-01-01T12:00:00+05:30",
    "disha_shool": {
      "description": "West direction is inauspicious on Sunday.",
      "direction": "West",
      "directionHindi": "पश्चिम",
      "remedies": [
        "Eat jaggery before traveling west"
      ],
      "safeDirections": [
        "East"
      ]
    },
    "guidance": {
      "activitiesToAvoid": [
        "Starting new ventures"
      ],
      "bestActivities": [
        "Pitru worship"
      ],
      "overallAuspiciousness": "Excellent",
      "tips": [
        "Amavasya is sacred for honoring ancestors - offer prayers and reflect on family lineage."
      ]
    },
    "hinduYear": {
      "masa": {
        "amanta": {
          "adhika": false,
          "label": "Margashirsha",
          "name": "Margashirsha"
        },
        "purnimanta": {
          "adhika": false,
          "label": "Pausha",
          "name": "Pausha"
        }
      },
      "reckoning": "chaitradi",
      "samvatsara": {
        "label": "Bhava",
        "name": "Bhava",
        "number": 8,
        "shaka": {
          "label": "Bhava",
          "name": "Bhava",
          "number": 8,
          "year": 1916
        },
        "vikram": {
          "label": "Sarvajit",
          "name": "Sarvajit",
          "number": 21,
          "year": 2051
        }
      },
      "shakaSamvat": 1916,
      "vikramSamvat": 2051,
      "yearStartedAt": "1994-04-11T05:47:06+05:30"
    }
  },
  "meta": {
    "contentMode": "fixture",
    "engine": "vedika-intelligence",
    "fixtureId": "demo-birth-1995-new-delhi",
    "inputUsage": "ignored",
    "mode": "sandbox",
    "sample": true
  },
  "success": true
}

Related

The same endpoint in other stacks:

Last updated: 22 November 2026

Start 14-day trial