# Panchang (Vedic almanac)

Panchang (पञ्चाङ्ग, "five limbs") is the Vedic almanac for a specific date and location. Its five core components (tithi, vara, nakshatra, yoga, karana) determine the auspiciousness of a moment — from a wedding to a product launch. AstroWay covers all five plus extra time slots (choghadia, hora, rahu-kaal) through a single API.

## What we calculate

- **Tithi** (lunar day) — 30 tithis per synodic cycle, each is 12° of Moon–Sun separation. The primary marker for most muhurta calculations.
- **Karana** (half-tithi) — 11 karanas, each 6° of longitude. Classifies the activity profile of the day.
- **Yoga** (conjunction) — 27 yogas, derived from `(Sun longitude + Moon longitude) / 13°20'`. Energetic flavour of the day.
- **Nakshatra-of-day** — the principal lunar mansion for the date (with the transition timestamp if there's more than one).
- **Choghadia** — 8 daytime + 8 nighttime slots of ~1.5 h each, labelled "Amrit / Shubh / Labh / Char" (auspicious) and "Kaal / Rog / Udveg" (inauspicious).
- **Hora** — planetary hours (Vedic variant, starting at sunrise, 24 horas of ~1 h).
- **Rahu Kaal** — inauspicious interval (1/8 of the daylight, slot depends on weekday).
- **Full panchang** — all of the above in one request (handy for a daily widget).

## Endpoints

| Endpoint | Credits | Returns |
|---|---|---|
| `/v1/vedic/panchang/tithi` | 10 | Current tithi + transition timestamp to next |
| `/v1/vedic/panchang/karana` | 10 | Current karana + transition |
| `/v1/vedic/panchang/yoga` | 10 | Current yoga + transition |
| `/v1/vedic/panchang/nakshatra` | 10 | Day's nakshatra + pada + transition |
| `/v1/vedic/panchang/choghadia` | 20 | 16 slots (8 day + 8 night) with labels |
| `/v1/vedic/panchang/hora` | 20 | 24 planetary hours |
| `/v1/vedic/panchang/rahu-kaal` | 10 | Rahu/Yama/Gulika Kaal intervals |
| `/v1/vedic/panchang/full` | 50 | Everything above in one response |

## Example

<Tabs>
  <TabItem label="cURL">
    ```bash frame="terminal"
    curl -X POST https://api.astroway.info/v1/vedic/panchang/full \
      -H "X-Api-Key: aw_live_your_key_here" \
      -H "Content-Type: application/json" \
      -d '{
        "date": "2026-05-11",
        "timezoneOffset": 5.5,
        "latitude": 28.6139,
        "longitude": 77.2090,
        "ayanamsa": "lahiri"
      }'
    ```
  </TabItem>
  <TabItem label="Node.js">
    ```ts
    const r = await fetch('https://api.astroway.info/v1/vedic/panchang/full', {
      method: 'POST',
      headers: {
        'X-Api-Key': process.env.ASTROWAY_API_KEY!,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        date: '2026-05-11',
        timezoneOffset: 5.5,
        latitude: 28.6139,
        longitude: 77.2090,
        ayanamsa: 'lahiri',
      }),
    });
    const { data } = await r.json();
    console.log(`Tithi: ${data.tithi.name}, Nakshatra: ${data.nakshatra.name}`);
    console.log(`Rahu Kaal: ${data.rahuKaal.start} — ${data.rahuKaal.end}`);
    ```
  </TabItem>
  <TabItem label="Python">
    ```python

    r = requests.post(
        'https://api.astroway.info/v1/vedic/panchang/full',
        headers={'X-Api-Key': os.environ['ASTROWAY_API_KEY']},
        json={
            'date': '2026-05-11', 'timezoneOffset': 5.5,
            'latitude': 28.6139, 'longitude': 77.2090,
            'ayanamsa': 'lahiri',
        },
    )
    data = r.json()['data']
    print(f"Tithi: {data['tithi']['name']}, Nakshatra: {data['nakshatra']['name']}")
    ```
  </TabItem>
</Tabs>

### Sample response

```json
{
  "date": "2026-05-11",
  "sunrise": "05:32:18",
  "sunset": "19:04:42",
  "tithi": {
    "index": 9,
    "name": "Navami",
    "paksha": "Shukla",
    "endsAt": "2026-05-11T11:18:42+05:30"
  },
  "karana": { "index": 17, "name": "Vanija", "endsAt": "2026-05-11T11:18:42+05:30" },
  "yoga":   { "index": 14, "name": "Vajra",  "endsAt": "2026-05-11T16:42:08+05:30" },
  "nakshatra": { "index": 7, "name": "Punarvasu", "pada": 2, "endsAt": "2026-05-11T19:51:15+05:30" },
  "rahuKaal":   { "start": "07:11", "end": "08:51" },
  "yamaganda":  { "start": "10:31", "end": "12:11" },
  "gulika":     { "start": "13:51", "end": "15:31" }
}
```

## Accuracy & sources

- **Canonical texts:** *Surya Siddhanta* (for tithi/karana/yoga), *Brihat Samhita* (for choghadia/muhurta), *Phaladipika* (for hora). We use the true Moon from Swiss Ephemeris (DE441/440), not the mean — this matters for tithi transitions (the difference can be up to 3 hours).
- **Reference cross-check:** [drikpanchang.com](https://www.drikpanchang.com/) — the largest public panchang source. Our tithi/nakshatra transitions match drikpanchang within ±30 seconds for Lahiri ayanamsa.
- **Choghadia** — we use the classical sequence of 7 planetary rulers. The first daytime slot's ruler matches the weekday (Sunday — Sun, etc.).
- **Rahu Kaal** — fixed 1/8 intervals of sunrise→sunset, with the weekday→slot mapping from classical sources (Monday = slot 2, Tuesday = slot 7, etc.).
- **Observer location matters.** Nakshatra and tithi transition at the same UTC instant everywhere — but visible dates depend on the timezone. Pass the `timezoneOffset` of the location where the user wants to read the panchang.

<Aside type="tip">
**Daily widget pattern.** For a "panchang today" widget, call `/v1/vedic/panchang/full` once per day (at user's local midnight) with the same coordinates. Cache for 24h. 50 credits × 30 days = 1,500 credits/month per user — fits in the Indie tier.
</Aside>

## Related

- [Dashas](/en/vedic/dashas/) — long-range periods (years/decades); panchang covers the short range (day-of)
- [Shadbala](/en/vedic/shadbala/) — planetary strength at the moment of the panchang
- [Vargas](/en/vedic/vargas/) — divisional charts for deeper muhurta analysis
- [Accuracy](/en/accuracy/) — panchang snapshot tests vs drikpanchang
- [Credits](/en/credits/) — full pricing table
- [Authentication](/en/authentication/) — how to obtain an `aw_live_*` key
