A lightweight public API to calculate Amavasya (New Moon) dates according to the Hindu Panchang system using astronomical calculations.
This project computes Amavasya based on SunβMoon angular difference (Tithi calculation) and determines the observance day according to traditional Hindu calendar rules.
It provides endpoints to check:
- If today is Amavasya
- The next upcoming Amavasya
- All Amavasya dates for a specific year
- Whether a specific date is Amavasya
https://amavasya-api.onrender.com/
- π Accurate Amavasya calculation using astronomical math
- π Full year Amavasya calendar
- π Check Amavasya for any date
- β³ Find next upcoming Amavasya
- ποΈ Includes short spiritual descriptions
- β‘ Fast REST API
- π Public and free to use
In the Hindu calendar, Amavasya corresponds to the 30th Tithi.
A Tithi is determined by the angular difference between the Moon and Sun.
Angle = (Moon Longitude β Sun Longitude) % 360
Each Tithi spans 12 degrees.
| Tithi | Angle Range |
|---|---|
| 29 (Chaturdashi) | 336Β° β 348Β° |
| 30 (Amavasya) | 348Β° β 360Β° |
The Amavasya observance day is defined as:
The day when the Amavasya tithi is present at sunrise.
Astronomical calculations are performed using:
- Swiss Ephemeris
- Python
- FastAPI backend
GET /amavasya/today
Example:
https://amavasya-api.onrender.com/amavasya/today
Response:
{
"date": "2026-03-18",
"is_amavasya": false
}GET /amavasya/next
Example:
https://amavasya-api.onrender.com/amavasya/next
Response:
{
"date": "2026-04-17",
"days_until": 29,
"about": "Vaishakha Amavasya β important for prayers and charity."
}GET /amavasya/year/{year}
Example:
https://amavasya-api.onrender.com/amavasya/year/2026
Response:
{
"year": 2026,
"total": 12,
"dates": [
{
"date": "2026-01-18",
"about": "Magha Amavasya β auspicious for holy baths and charity."
},
{
"date": "2026-02-16",
"about": "Phalguna Amavasya β spiritual cleansing before Holi."
}
]
}GET /amavasya/check/{date}
Example:
https://amavasya-api.onrender.com/amavasya/check/2026-03-18
Response:
{
"date": "2026-03-18",
"is_amavasya": true
}FastAPI automatically provides a testing interface:
https://amavasya-api.onrender.com/docs
You can test every endpoint directly from the browser.
- Python
- FastAPI
- Swiss Ephemeris
- Pytz
- Render (Deployment)
- Vercel (Frontend)
amavasya-api
β
βββ main.py # API server
βββ amavasya.py # astronomical calculations
βββ requirements.txt
βββ README.md
This API can be integrated with:
- Telegram bots
- Calendar apps
- Panchang apps
- Reminder services
- Religious event trackers
- Spiritual mobile apps
Planned additions:
- Ekadashi API integration
- Purnima calculation
- Full Hindu Panchang API
- Festival calendar endpoints
- Multi-timezone calculations
Hari Prajwal
If you find this project useful:
β Star the repository
π Share it with others
π Build something using the API
ποΈ May this tool help people stay connected with sacred lunar traditions.