# Panchang API

> Hindu almanac for any date and place: tithi, nakshatra, Rahu kalam and more.

Computed, not looked up, from the positions of the Sun and the Moon (within seconds of NASA JPL Horizons), with the Lahiri ayanamsa. Gives the five elements with the moments they change, sunrise, sunset, moonrise and moonset, Rahu kalam, Yamagandam, Gulika kalam and Abhijit muhurta, the Tamil month and day, the lunar month both ways it is reckoned, and the Shaka and Vikram years. Names come in English transliteration and, where the Tamil calendar has its own, in Tamil. Festival dates are not given. Counts as 10 requests against the rate limit.

Base URL `https://api.dharun.dev`. No API key. Answers are JSON, `{ "data": ..., "meta": { ... } }`, and errors are `{ "error": { "code", "message" } }` with a matching HTTP status. Rate limit: 600 requests a minute per client.

## Panchang for a date

`GET /v1/panchang/{date}`

For a pincode, a latitude and longitude, or (by default) New Delhi. Times are in the time zone asked for.

Parameters:

- `date` (path, required): YYYY-MM-DD, 1900 to 2100, or today.
- `pincode` (query): Indian pincode of the place.
- `lat` (query): Latitude, if no pincode.
- `lng` (query): Longitude, if no pincode.
- `tz` (query): IANA time zone for the times. Default Asia/Kolkata.

Example: https://api.dharun.dev/v1/panchang/2026-01-14?pincode=600001

Response, with lists and long text shortened:

```json
{
  "data": {
    "place": {
      "latitude": 13.0949,
      "longitude": 80.287,
      "timeZone": "Asia/Kolkata",
      "pincode": "600001",
      "name": "Chennai"
    },
    "date": "2026-01-14",
    "weekday": {
      "name": "Budhavara",
      "tamil": "புதன்"
    },
    "sunrise": "2026-01-14T06:34:53+05:30",
    "sunset": "2026-01-14T18:00:50+05:30",
    "moonrise": "2026-01-14T02:42:07+05:30",
    "moonset": "2026-01-14T14:13:06+05:30",
    "tithi": [
      {
        "number": 26,
        "name": "Ekadashi",
        "tamil": "ஏகாதசி",
        "paksha": "krishna",
        "start": "2026-01-13T15:18:29+05:30",
        "end": "2026-01-14T17:53:18+05:30"
      },
      {
        "number": 27,
        "name": "Dvadashi",
        "tamil": "துவாதசி",
        "paksha": "krishna",
        "start": "2026-01-14T17:53:18+05:30",
        "end": "2026-01-15T20:17:01+05:30"
      }
    ],
    "nakshatra": [
      {
        "number": 17,
        "name": "Anuradha",
        "tamil": "அனுஷம்",
        "pada": 1,
        "start": "2026-01-14T00:06:48+05:30",
        "end": "2026-01-15T03:03:59+05:30"
      },
      {
        "number": 18,
        "name": "Jyeshtha",
        "tamil": "கேட்டை",
        "start": "2026-01-15T03:03:59+05:30",
        "end": "2026-01-16T05:47:53+05:30"
      }
    ],
    "yoga": [
      {
        "number": 10,
        "name": "Ganda",
        "start": "2026-01-13T19:04:54+05:30",
        "end": "2026-01-14T19:55:53+05:30"
      },
      {
        "number": 11,
        "name": "Vriddhi",
        "start": "2026-01-14T19:55:53+05:30",
        "end": "2026-01-15T20:38:09+05:30"
      }
    ],
    "karana": [
      {
        "number": 52,
        "name": "Balava",
        "start": "2026-01-14T04:36:41+05:30",
        "end": "2026-01-14T17:53:18+05:30"
      },
      {
        "number": 53,
        "name": "Kaulava",
        "start": "2026-01-14T17:53:18+05:30",
        "end": "2026-01-15T07:07:06+05:30"
      }
    ],
    "sunSign": {
      "name": "Dhanu",
      "tamil": "தனுசு"
    },
    "moonSign": {
      "name": "Vrishchika",
      "tamil": "விருச்சிகம்"
    },
    "tamilMonth": {
      "name": "Thai",
      "tamil": "தை",
      "day": 1
    },
    "tamilYear": {
      "name": "Vishvavasu",
      "tamil": "விசுவாவசு"
    },
    "lunarMonth": {
      "amanta": "Pausha",
      "purnimanta": "Magha",
      "adhika": false
    },
    "shakaYear": 1947,
    "vikramSamvat": 2082,
    "rahuKalam": {
      "start": "2026-01-14T12:17:51+05:30",
      "end": "2026-01-14T13:43:36+05:30"
    },
    "yamagandam": {
      "start": "2026-01-14T08:00:37+05:30",
      "end": "2026-01-14T09:26:22+05:30"
    },
    "gulikaKalam": {
      "start": "2026-01-14T10:52:06+05:30",
      "end": "2026-01-14T12:17:51+05:30"
    },
    "abhijitMuhurta": {
      "start": "2026-01-14T11:54:59+05:30",
      "end": "2026-01-14T12:40:43+05:30"
    },
    "ayanamsa": 24.222541
  },
  "meta": {
    "note": "Computed from the positions of the Sun and the Moon (NREL SPA and Meeus, within seconds of NASA JPL Horizons), sidereal with the Lahiri ayanamsa as defined by t…"
  }
}
```
