TheShia
بازگشت به همهٔ APIها

اوقات شرعی

محاسبات جعفری (شیعی) برای هر نقطهٔ زمین — روش‌های آماده، چند روش هم‌زمان، یا زوایای کاملاً سفارشی؛ یک روز، یک ماه یا یک سال کامل در هر درخواست. عرض‌های جغرافیایی بالا با قاعدهٔ TwilightAngle مدیریت می‌شود و نیمه‌شب شرعی میانهٔ غروب تا اذان صبح است.

GET https://theshia.org/api/v1/prayer-times

پارامترها

  • lat required* latitude, -90 to 90 (decimal degrees, rounded to 2 dp for caching). *Not needed when city is given.
  • lng required* longitude, -180 to 180 (2 dp). *Not needed when city is given.
  • city optional city id from /cities (e.g. london, tehran, karbala) — sets lat, lng and tz automatically and overrides them.
  • method default: Tehran preset id (full value table under Calculation methods) · comma list "Tehran,Jafari" · "all" (all 16) · "custom" (with the angle parameters below).
  • fajrAngle custom only Fajr sun-depression angle, 4 to 24 degrees. Required when method=custom.
  • ishaAngle custom only Isha angle, 4 to 24 degrees. Give this OR ishaInterval.
  • ishaInterval custom only Isha as minutes after maghrib, 0 to 180. Alternative to ishaAngle.
  • maghribAngle custom only Maghrib sun-depression angle, 0.5 to 12 degrees (Shia methods typically 4–4.5).
  • maghribInterval custom only Maghrib as minutes after sunset, 0 to 120. Alternative to maghribAngle.
  • date optional a single day, YYYY-MM-DD.
  • month default: current 1 to 12, combined with year. Ignored when date is given.
  • year default: current 1900 to 2100. Given ALONE (no month/date) = the full year, single method only.
  • tz optional IANA timezone (e.g. Europe/London) — adds local HH:mm strings next to the UTC instants. Auto-filled from city.
بازکردن مثال زنده ↗

نمونه کد

curl

curl "https://theshia.org/api/v1/prayer-times?city=london&method=Tehran&year=2026&month=7"

JavaScript

const res = await fetch("https://theshia.org/api/v1/prayer-times?city=london&method=Tehran&year=2026&month=7");
const data = await res.json();

Python

import requests

data = requests.get("https://theshia.org/api/v1/prayer-times?city=london&method=Tehran&year=2026&month=7").json()

محدودیت‌ها و استفادهٔ منصفانه

پاسخ‌ها به‌شدت در لبه کش می‌شوند — لطفاً شما هم کش کنید. درخواست‌های بدون کش به ۱۰۰ در دقیقه به‌ازای هر IP محدودند؛ درخواست‌های بیش از ۴۹۶ محاسبهٔ روز×روش رد می‌شوند. برای استفادهٔ اجتماعی رایگان است، بدون تضمین دسترس‌پذیری.