گرفتگیها
خورشیدگرفتگیها و ماهگرفتگیهای ۲۰۲۰ تا ۲۰۴۰ — نوع، زمان اوج، بزرگی، مدتها و نقطهٔ اوج زمینی، از همان موتور سنجیدهای که نقشههای گرفتگی را میسازد.
GET https://theshia.org/api/v1/eclipses
پارامترها
-
kindoptional values: "solar" · "lunar". -
typeoptional values: "total" · "annular" · "hybrid" · "partial" · "penumbral". -
fromoptional start of the window — YYYY or YYYY-MM-DD (dataset covers 2020 to 2040). -
tooptional end of the window — YYYY (through that year's end) or YYYY-MM-DD. -
upcomingoptional 1 to 24 — the next N eclipses from today, each with daysUntil. Not combinable with from/to. -
calendardefault: moonsighting reckoning for the returned Hijri dates — values: "moonsighting" · "iran".
- Response per eclipse: kind, type, utc (maximum, ISO 8601), gamma, magnitude (partial-solar / umbral-lunar; null otherwise), penumbralMag + durationsMin { penumbral, partial, total } for lunar, greatest { lat, lon, central } for solar, and hijri { hy, hm, hd }.
- Computed by this site's fresh Meeus ch. 49/54 engine, verified against the NASA GSFC catalog (times of maximum within ~1 minute; penumbral grazes under magnitude ~0.005 fall below the method's noise floor).
- Penumbral lunar eclipses are generally imperceptible and commonly not counted for Salat al-Ayat.
نمونه کد
curl
curl "https://theshia.org/api/v1/eclipses?upcoming=4" JavaScript
const res = await fetch("https://theshia.org/api/v1/eclipses?upcoming=4");
const data = await res.json(); Python
import requests
data = requests.get("https://theshia.org/api/v1/eclipses?upcoming=4").json() محدودیتها و استفادهٔ منصفانه
پاسخها بهشدت در لبه کش میشوند — لطفاً شما هم کش کنید. درخواستهای بدون کش به ۱۰۰ در دقیقه بهازای هر IP محدودند؛ درخواستهای بیش از ۴۹۶ محاسبهٔ روز×روش رد میشوند. برای استفادهٔ اجتماعی رایگان است، بدون تضمین دسترسپذیری.