Quran has 30 Juz, each Juz is further divided into 2 Hizb, making a total of 60 Hizb in the Quran
Total Ayahs: 81 | Pages: 11
From: Al-Fatihah, Ayah 1
To: Al-Baqarah, Ayah 74
Hizb data is exported in both JSON and SQLite formats.
Here is an example of the JSON structure for the first hizb:
{
"1": {
"hizb_number": 1,
"verses_count": 81,
"first_verse_key": "1:1",
"last_verse_key": "2:74",
"verse_mapping": {
"1": "1-7",
"2": "1-74"
}
}
}
| Field | Type | Description |
|---|---|---|
juz_number |
INTEGER | The hizb number (1 to 60). |
verses_count |
INTEGER | Total number of verses in the hizb. |
first_verse_key |
TEXT | The key of the first verse in the hizb (e.g. 1:1). |
last_verse_key |
TEXT | The key of the last verse in the hizb (e.g. 2:74). |
verse_mapping |
OBJECT | A mapping of surah numbers to ayah ranges within this hizb. For example, "2": "1-74" indicates that Surah 2 (Al-Baqarah) has verses 1 to 74 in this hizb. |
Download the JSON or SQLite file from the download links on this page. The JSON file is one object:
each key is the hizb_number as a string ("1" to "60").
The SQLite file has the same fields in the hizbs table, but verse_mapping is
JSON text there. Parse it before you use it.
first_verse_key and last_verse_key (surah:ayah) are the first and last
ayah of each hizb. Use them as verse_key values in the other QUL resources.
verse_mapping lists the ayahs of this hizb in each surah. Each key is a surah number, and
each value is a string like "1-141", meaning ayahs 1 to 141, both included. Split it on
- and convert both numbers to integers.
// Setup: unzip the download and serve quran-metadata-hizb.json from your app (here at /data/)
const items = await fetch('/data/quran-metadata-hizb.json').then((res) => res.json());
// Get the first hizb
const first = items['1']; // { hizb_number: 1, first_verse_key: "1:1", verse_mapping: { ... }, ... }
// Expand verse_mapping into a list of verse keys
const verseKeys = Object.entries(first.verse_mapping).flatMap(([surah, range]) => {
const [from, to] = range.split('-').map(Number);
return Array.from({ length: to - from + 1 }, (_, i) => `${surah}:${from + i}`);
});
verseKeys.length === first.verses_count; // true
-- SQLite: verse_mapping is JSON text. Parse it in your app.
SELECT hizb_number, first_verse_key, last_verse_key, verse_mapping
FROM hizbs
ORDER BY hizb_number;
For a longer walkthrough, see Tutorial 7: Quran Metadata End-to-End.
Loading…