API Documentation

Integrate reliable Nepali Tithi, Panchanga, Lagan, and Planetary details directly into your applications.

Overview & Base URL

The Nepali Date API provides standard HTTP REST endpoints returning clean JSON responses. All response payloads follow a unified data format.

Base URL:https://nepali-date-api.vercel.app(or local http://localhost:3000)

🔑 API Authentication & Mobile App Headers

All API requests require authentication via an API Key/Token. Mobile apps and external clients must pass the token in standard HTTP headers. Default Mobile App Token: np_live_mobile_app_default

Option A: Bearer Header (Recommended for Mobile)
Authorization: Bearer YOUR_API_TOKEN
Option B: Custom Header
x-api-key: YOUR_API_TOKEN

🌐 Public Endpoints

GET/api/panchanga/[year]/[month]

Fetch the complete Panchanga data array for a specific Nepali Year and Month.

Parameters:
  • year number: Nepali Bikram Sambat year (e.g. 2081, 2082, 2083)
  • month number: Nepali month (1 for Baisakh, 12 for Chaitra)
Example Request:
curl -X GET "http://localhost:3000/api/panchanga/2083/4"
GET/api/panchanga/by-english-date/[YYYY-MM-DD]

Fetch a specific day's Panchanga details using its Gregorian (English) date equivalent.

Parameters:
  • date string: Gregorian date formatted as YYYY-MM-DD (e.g. 2026-07-26)
Example Request:
curl -X GET "http://localhost:3000/api/panchanga/by-english-date/2026-07-26"
GET/api/panchanga/available-months

Retrieve all available Nepali years and months currently stored in the database.

Example Request:
curl -X GET "http://localhost:3000/api/panchanga/available-months"

🔒 Admin Endpoints (Authenticated)

Note: Mutation endpoints require an active admin session established via the Admin Panel.

POST/api/panchanga

Add or update single day Panchanga record in the database.

POST/api/panchanga/import

Import a bulk monthly Panchanga JSON file generated by OCR parser.

DELETE/api/panchanga/delete

Delete all Panchanga records for a specific year and month.

💻 Code Example & Response Payload

JavaScript / TypeScript (Fetch API):

async function getNepaliToday() {
  const today = '2026-07-26';
  const res = await fetch(
    `https://nepali-date-api.vercel.app/api/panchanga/by-english-date/${today}`
  );
  const json = await res.json();
  console.log('Today Panchanga:', json.data);
}

getNepaliToday();

Sample JSON Response:

{
  "success": true,
  "data": {
    "year": 2083,
    "month": 4,
    "gate": 10,
    "baar": "आइतबार",
    "englishDate": "2026-07-26",
    "tithi": "12",
    "tithiName": "द्वादशी",
    "tithiEnds": "18:45",
    "sunrise": "05:16",
    "sunset": "18:52",
    "festivals": "प्रदोष व्रत"
  }
}