Skip to content

Hariprajwal/Ekadashi-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ•‰οΈ Ekadashi Reminder & Calendar

A complete Ekadashi calculation system consisting of:

  • 🌐 Public Ekadashi API
  • πŸ“… Interactive Web Calendar
  • πŸ€– Telegram Reminder Bot
  • πŸ”­ Astronomically accurate calculations

This project calculates Ekadashi dates using astronomical moon–sun positions, rather than relying on static tables.


🌍 Live Demo

🌐 Website

https://hariprajwal.github.io/Ekadashi-reminder/

Interactive interface to:

  • Check if today is Ekadashi
  • Find next Ekadashi
  • View Ekadashi calendar for any year
  • Check specific dates

πŸ”Œ Public API

Base API endpoint:

https://ekadashi-api.onrender.com/

This API can be integrated into:

  • Mobile apps
  • Telegram bots
  • Calendar apps
  • Websites
  • Spiritual reminder systems

πŸ“Œ Features

Accurate Ekadashi Calculation

The system calculates Ekadashi using:

  • Sun–Moon angular distance
  • Tithi calculations
  • Arunodaya rule (96 minutes before sunrise)
  • Vaishnava / ISKCON fasting rules

Each Ekadashi is classified as:

  • πŸŒ• Shukla Paksha (Waxing Moon)
  • πŸŒ‘ Krishna Paksha (Waning Moon)

Telegram Reminder Bot

The bot automatically sends reminders:

  • πŸŒ™ 1 day before Ekadashi
  • πŸŒ… 6 AM on Ekadashi day

Users can also query:

/today
/tomorrow
/next
/year 2026
/check 2026-03-15

Interactive Website

The website allows users to:

βœ” Check today's Ekadashi βœ” Check tomorrow's Ekadashi βœ” Find next Ekadashi βœ” View full yearly calendar βœ” Verify any specific date


🧠 How Ekadashi is Calculated

Ekadashi is determined by tithi (lunar day).

A tithi is calculated using:

Tithi = (Moon Longitude βˆ’ Sun Longitude) / 12Β°

Each tithi spans 12 degrees of separation between the Moon and Sun.

Ekadashi corresponds to:

11th Tithi

Astronomical Calculation Steps

1️⃣ Calculate Julian day

2️⃣ Get Sun longitude

3️⃣ Get Moon longitude

4️⃣ Compute angular difference

elongation = (moon_longitude - sun_longitude) % 360

5️⃣ Determine tithi

tithi = int(elongation / 12) + 1

Arunodaya Rule

Vaishnava Ekadashi fasting follows an additional rule:

Ekadashi must be present at:

Arunodaya = Sunrise - 96 minutes

If Dashami overlaps Arunodaya, the fasting day shifts.

This rule ensures the correct observance day.


πŸ“‘ API Endpoints

Base URL

https://ekadashi-api.onrender.com

Check Today

/today

Example response:

{
 "date": "2026-03-15",
 "is_ekadashi": true
}

Check Tomorrow

/tomorrow

Next Ekadashi

/next

Example response:

{
 "date": "2026-03-29",
 "paksha": "Shukla",
 "days_until": 14
}

Ekadashis in a Year

/year/{year}

Example:

/year/2028

Response:

{
 "year": 2028,
 "total": 25,
 "dates": [
   {"date":"2028-01-08","paksha":"Shukla"},
   {"date":"2028-01-22","paksha":"Krishna"}
 ]
}

Check Specific Date

/check/YYYY-MM-DD

Example:

/check/2026-03-15

πŸ—οΈ Project Architecture

                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                β”‚     GitHub Pages        β”‚
                β”‚   Ekadashi Website      β”‚
                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚
                           β–Ό
                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                β”‚        Render API       β”‚
                β”‚     FastAPI Server      β”‚
                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚
                           β–Ό
                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                β”‚   Ekadashi Calculator   β”‚
                β”‚  Swiss Ephemeris Logic  β”‚
                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

🧰 Technologies Used

Backend

  • Python
  • FastAPI
  • Swiss Ephemeris
  • pytz

Frontend

  • HTML
  • CSS
  • JavaScript
  • GitHub Pages

Infrastructure

  • Render (API hosting)
  • GitHub Pages (website hosting)
  • Telegram Bot API

πŸš€ Deployment

API Deployment

Hosted on:

Render

Start command:

uvicorn main:app --host 0.0.0.0 --port $PORT

Website Deployment

Hosted using:

GitHub Pages

πŸ“· Screenshots

(Add images here)

Example:

/images/website.png
/images/calendar.png
/images/api.png

πŸ”— Integration Example

Example JavaScript request:

fetch("https://ekadashi-api.onrender.com/next")
.then(res => res.json())
.then(data => console.log(data))

πŸ“… Example Output

Next Ekadashi:

Date: 29 March 2026
Paksha: Shukla
Days remaining: 14

πŸ“– Why This Project Exists

Many Ekadashi calendars online:

  • rely on static tables
  • do not expose developer APIs
  • cannot be integrated with applications

This project provides:

βœ” Dynamic calculations βœ” Open API βœ” Developer integration βœ” Reminder automation


🀝 Contributions

Pull requests and improvements are welcome.

Possible future improvements:

  • Panchang API
  • Moon phase display
  • Festival calendar
  • Mobile app

πŸ“œ License

MIT License


πŸ™ Acknowledgements

Inspired by traditional Vaishnava Panchang calculations and astronomical ephemeris data.


πŸ•‰οΈ

May this project help devotees observe Ekadashi with devotion and awareness.

About

Ekadashi API to calculate the days of fasting (can be integrated anywhere)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors