Skip to content

Hariprajwal/sankashti-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

sankashti-api

πŸŒ™ Sankashti & Purnima API

A public API that calculates Sankashti Chaturthi and Purnima (Full Moon) dates using astronomical calculations based on the Hindu lunar calendar (Panchang).

This project uses Sun–Moon angular mathematics (Tithi calculation) to determine lunar events instead of hardcoding calendar dates.

The API provides endpoints to:

  • Check if today is Sankashti
  • Find the next Sankashti
  • Get the full Sankashti calendar for a year
  • Check if today is Purnima
  • Find the next Purnima
  • Generate the full Purnima calendar for a year

πŸ”— Live Links

🌐 Web Interface

https://sankashti-api.vercel.app/

βš™οΈ Public API

https://sankashti.onrender.com/


✨ Features

  • πŸŒ™ Accurate Sankashti calculation using moonrise rule
  • πŸŒ• Purnima calculation using sunrise tithi rule
  • πŸ“… Full year lunar event calendar
  • πŸ” Check specific dates
  • 🌍 Public REST API
  • ⚑ Fast responses
  • πŸ“‘ Ready for integration with apps, bots, and websites

🧠 How the Calculation Works

In the Hindu calendar, time is divided into 30 lunar days called Tithis.

Each Tithi corresponds to 12Β° difference between Moon and Sun.

Angle = (Moon Longitude βˆ’ Sun Longitude) % 360
# Sankashti Chaturthi API

A high-performance API providing accurate dates and timings for Sankashti Chaturthi.

## πŸš€ Features
- Accurate fasting dates for the current year.
- Easy-to-use JSON format.
- Lightweight and fast response times.

## πŸ›  Usage
Provide a simple example request:
```bash
curl [https://your-api-url.com/api/sankashti](https://your-api-url.com/api/sankashti)
Tithi = int(angle / 12) + 1

πŸŒ™ Sankashti Chaturthi

Sankashti occurs when:

Tithi = 19

Which corresponds to:

Krishna Paksha Chaturthi

Unlike most festivals, Sankashti is determined by Moonrise.

Rule:

If Chaturthi tithi is present at moonrise, that day is Sankashti.


πŸŒ• Purnima

Purnima occurs when:

Tithi = 15

Which corresponds to the Full Moon.

Rule:

If Purnima tithi is present at sunrise, that day is Purnima.


πŸ“‘ API Endpoints

Sankashti

Check Today

GET /sankashti/today

Example:

https://sankashti.onrender.com/sankashti/today

Response:

{
 "date": "2026-03-21",
 "is_sankashti": false
}

Next Sankashti

GET /sankashti/next

Example:

https://sankashti.onrender.com/sankashti/next

Response:

{
 "date": "2026-03-21",
 "days_until": 6
}

Sankashti Calendar

GET /sankashti/year/{year}

Example:

https://sankashti.onrender.com/sankashti/year/2026

Response:

{
 "year": 2026,
 "total": 12,
 "dates": [
  "2026-01-08",
  "2026-02-07",
  "2026-03-08"
 ]
}

Check Specific Date

GET /sankashti/check/{date}

Example:

https://sankashti.onrender.com/sankashti/check/2026-03-21

Response:

{
 "date": "2026-03-21",
 "is_sankashti": true
}

πŸŒ• Purnima Endpoints

Check Today

GET /purnima/today

Example:

https://sankashti.onrender.com/purnima/today

Next Purnima

GET /purnima/next

Example:

https://sankashti.onrender.com/purnima/next

Response:

{
 "date": "2026-04-02",
 "days_until": 18
}

Purnima Calendar

GET /purnima/year/{year}

Example:

https://sankashti.onrender.com/purnima/year/2026

Check Specific Date

GET /purnima/check/{date}

Example:

https://sankashti.onrender.com/purnima/check/2026-04-02

πŸ§ͺ Interactive API Docs

FastAPI automatically generates interactive documentation:

https://sankashti.onrender.com/docs

You can test all endpoints directly in the browser.


πŸ›  Tech Stack

  • Python
  • FastAPI
  • Swiss Ephemeris
  • Pytz
  • Render (API deployment)
  • Vercel (frontend)

πŸ“‚ Project Structure

moon-events-api
β”‚
β”œβ”€β”€ main.py
β”œβ”€β”€ astronomy.py
β”œβ”€β”€ sankashti.py
β”œβ”€β”€ purnima.py
β”œβ”€β”€ requirements.txt
└── README.md

πŸš€ Future Improvements

Possible upgrades:

  • Ekadashi API integration
  • Amavasya calculation
  • Full Panchang engine
  • Nakshatra calculations
  • Multi-location moonrise support
  • Hindu festival calendar API

πŸ‘¨β€πŸ’» Author

Hari Prajwal


⭐ Support

If you find this project useful:

⭐ Star the repository
πŸ”— Share it with others
πŸš€ Build something using the API


πŸŒ™ Bringing traditional lunar calendars into modern software.

About

A lightweight, free JSON API providing accurate Sankashti Chaturthi dates, moonrise timings, and fasting schedules for developers.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages