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

تبدیل تاریخ قمری

تبدیل تاریخ در هر دو جهت میان تقویم هجری قمری و میلادی — یک روز، یک ماه کامل یا یک سال در هر درخواست، بر اساس رؤیت جهانی هلال یا تقویم رسمی ایران. ماه‌های اعلام‌شده از جدول‌های معتبر پاسخ داده می‌شوند و فراتر از آن، رؤیت‌پذیری واقعی هلال به‌صورت نجومی محاسبه می‌شود و هر پاسخ منبع خود را اعلام می‌کند.

GET https://theshia.org/api/v1/hijri

پارامترها

  • date default: today Gregorian day to convert, YYYY-MM-DD (years 1900 to 2100).
  • year optional with month: that Gregorian month as a day-by-day map; alone: the full year (366-day budget).
  • month optional 1 to 12, combined with year.
  • hy reverse Hijri year, 1317 to 1523 (≈ Gregorian 1900–2100) — switches the direction to Hijri → Gregorian.
  • hm reverse Hijri month, 1 (Muharram) to 12 (Dhul Hijjah).
  • hd reverse Hijri day, 1 to that month's real length (checked); omit it for the whole month as a day-by-day map.
  • calendar default: moonsighting values: "moonsighting" (global crescent sighting) · "iran" (official reckoning; outside its table — after 19 March 2028 — it answers as moonsighting and says so in calendarUsed).
  • offset default: 0 -2 to 2 whole days — the conventional local-sighting adjustment, applied before Gregorian → Hijri conversion only.
بازکردن مثال زنده ↗

نمونه کد

curl

curl "https://theshia.org/api/v1/hijri?hy=1448&hm=1"

JavaScript

const res = await fetch("https://theshia.org/api/v1/hijri?hy=1448&hm=1");
const data = await res.json();

Python

import requests

data = requests.get("https://theshia.org/api/v1/hijri?hy=1448&hm=1").json()

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

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