Referensi API
Konversi Hijriah
Konversi tanggal antara kalender Masehi dan Hijriah dalam dua arah, dengan metode tabular, Umm al-Qura, dan astronomis.
GET /api/v1/hijri/convertKonversi ke salah satu arah:
- Masehi → Hijriah: gunakan
date=YYYY-MM-DD - Hijriah → Masehi: gunakan
hy,hm,hd
Parameter kueri
| Param | Type | Default | Deskripsi |
|---|---|---|---|
date | string | — | Tanggal Masehi (G→H) |
hy | int | — | Tahun Hijriah 1…3000 (H→G) |
hm | int | 1 | Bulan Hijriah 1…12 |
hd | int | 1 | Hari Hijriah 1…30 |
method | string | tabular | tabular, umm_al_qura, astronomical |
locale | string | id | Bahasa label (11 locale) |
Gunakan method=umm_al_qura atau astronomical agar cocok dengan Umm al-Qura / mayoritas aplikasi global.
tabular bersifat aritmetika dan dapat berbeda ±1 hari.
GET
/hijri/convertLangsungGET /hijri/convert?date=2026-06-20&method=umm_al_qura&locale=idMasehi → Hijriah
curl "https://api.housemuslim.org/api/v1/hijri/convert?date=2026-06-20&method=umm_al_qura&locale=id"const res = await fetch('https://api.housemuslim.org/api/v1/hijri/convert?date=2026-06-20&method=umm_al_qura&locale=id');
const { data } = await res.json();
console.log(data.hijri_label); // 5 Muharram 1448 H{
"success": true,
"data": {
"gregorian": "2026-06-20",
"hijri": { "year": 1448, "month": 1, "day": 5 },
"hijri_label": "5 Muharram 1448 H",
"weekday": "Sabtu",
"method": "umm_al_qura"
}
}Hijriah → Masehi
curl "https://api.housemuslim.org/api/v1/hijri/convert?hy=1448&hm=9&hd=1&method=astronomical"const res = await fetch('https://api.housemuslim.org/api/v1/hijri/convert?hy=1448&hm=9&hd=1&method=astronomical');
const { data } = await res.json();
console.log(data.gregorian); // 2027-02-08{
"success": true,
"data": {
"hijri": { "year": 1448, "month": 9, "day": 1 },
"hijri_label": "1 Ramadan 1448 H",
"gregorian": "2027-02-08",
"weekday": "Monday",
"method": "astronomical"
}
}Nilai locale yang didukung: en, id, ms, tr, fr, ar, ur, fa, bn, hi, ta.