Skip to content

About

Quran text and translations in JSON format.

Topics

Resources

Stars

616 stars

Watchers

9 watching

Forks

Repository files navigation

Quran JSON

The Quran as static JSON files: Arabic text in 15 scripts, 130 translations in 81 languages, 3 transliterations, and links to per-ayah recitations. No API key and no server code. You fetch a file.

Quick start

curl -s https://quran-json.risanb.com/text/uthmani/chapters/1.json
const base = "https://quran-json.risanb.com";
const [arabic, english] = await Promise.all([
  fetch(`${base}/text/uthmani/chapters/2.json`).then((r) => r.json()),
  fetch(`${base}/translations/en-saheeh/chapters/2.json`).then((r) => r.json()),
]);
// Join on the verse id: arabic.verses[254] and english.verses[254] are both 2:255.

Every file is served with Access-Control-Allow-Origin: *.

Endpoints

Path Contents
/manifest.json Scripts, counts, licences, attribution
/chapters.json The 114 chapters: names, meaning, type, verse count
/text/{script}/quran.json One script, all chapters
/text/{script}/chapters/{1-114}.json One script, one chapter: { id, verses: [{ id, text }] }
/translations/index.json Every translation: language, translator, version, licence
/translations/{code}-{slug}/chapters/{1-114}.json One translation, one chapter (also quran.json)
/transliteration/index.json Every transliteration
/transliteration/{key}/chapters/{1-114}.json One transliteration, one chapter (also quran.json)
/audio/reciters.json Recitations as URL templates, with host and reading
/meta/sources.json Source, licence and checksum of every snapshot
/meta/qa.json Corrections applied to upstream text, with evidence

Which script should I use?

  • Most apps (Madinah mushaf, Hafs): uthmani. For KFGQPC fonts, qpc-hafs.
  • Search and matching: simple-clean (no vowel marks).
  • South Asia (Indo-Pak script): hafs-nastaliq (KFGQPC Nastaleeq) or indopak (DigitalKhatt).
  • Indonesia: kemenag (Mushaf Standar Indonesia).
  • North and West Africa: warsh (Morocco, Algeria, West Africa) or qalun (Libya, Tunisia).
  • Sudan: duri (al-Duri ʿan Abi ʿAmr).

Also published: uthmani-min, simple, simple-min, simple-plain (Tanzil variants), and two readings mostly used by specialists, shubah and susi.

A script is a text, not a page layout. 13-, 15- and 16-line mushafs differ in line breaks, which a verse array does not carry.

Verse numbering. Hafs scripts have 6,236 verses. Warsh, Qalun, al-Duri and al-Susi number their verses differently, so each of their verses carries number_in_hafs, the Hafs verse number(s) it covers. Translations, transliterations and per-ayah audio use Hafs numbers. The manifest's verse_ids, reading and bismillah fields say how each script behaves.

Translations

130 editions in 81 languages:

  • 118 from QuranEnc, which permits republishing verbatim with credit and version (both are in /translations/index.json).
  • ClearQuran by Talal Itani, in two editions ("God" and "Allah"), CC BY-ND 4.0.
  • Public domain: Sale, Rodwell, Palmer, Pickthall and Yusuf Ali (English), Sablukov and Krachkovsky (Russian), Ahmed Raza Khan and Mahmud ul Hasan (Urdu), Keyzer (Dutch).

Editions that are incomplete upstream are listed under withheld, with the reason.

Transliteration

Three transliterations are generated by this project from the Kemenag Arabic text: id-skb (Indonesian, SKB 1987 style), en (English with diacritics) and en-simple (plain English). They follow Hafs connected-reading rules: sun letters, joining at hamzat al-wasl, idgham, iqlab and pause forms. The Indonesian output matches Kemenag's own romanisation in 87% of verses, compared after removing spaces, punctuation and case (romanize_validation.py); most other differences are style or typos in that reference. They are machine-generated and not yet reviewed by a qualified reader.

Audio

Audio is linked, not hosted. /audio/reciters.json lists 597 recordings from EveryAyah, Islamic Network and MP3Quran as URL templates, for example:

https://everyayah.com/data/Alafasy_128kbps/{surah:03d}{ayah:03d}.mp3

Each recording states its reading. Per-ayah files use Hafs numbering, so only use them with a Hafs script.

Licences

The dataset is CC BY-SA 4.0. Each source keeps its own terms:

Source Used for Terms
Tanzil 6 Tanzil scripts, chapter metadata CC BY 3.0, verbatim only; its notice is in every chapter file
Quranpedia.net KFGQPC editions: qpc-hafs, hafs-nastaliq, warsh, qalun, duri, shubah, susi Republish with credit and dump version
Qur'an Kemenag kemenag No copyright on the mushaf text (PMA 44/2016, Pasal 8)
DigitalKhatt indopak MIT
QuranEnc, ClearQuran, public domain Translations See /translations/index.json
This project Transliterations CC BY-SA 4.0
EveryAyah, Islamic Network, MP3Quran Audio links Linked only; EveryAyah and MP3Quran state no licence

/meta/sources.json has the full record for every file. In Indonesia, any medium that holds the Quran text needs an LPMQ tashih (PMA 44/2016); that is a separate duty from copyright.

Changes policy

  • A published path is never renamed or removed.
  • Content can be corrected when an upstream source corrects it. Corrections are logged in /meta/qa.json, and source versions are in /meta/sources.json.
  • Data files are cached for one day.

The old npm package (quran-json ≤ 3.1.2) is deprecated but still served by npm and jsDelivr, and the files remain at git tag v3.1.2.

Development

Requires uv and Node.js 22.12+.

uv sync                        # Python dependencies
npm ci --prefix site           # site dependencies
uv run pytest                  # data tests
npm run site -- --no-cdn       # build data + site into .build/assembled
npm run dev --prefix site      # site dev server (after one build)
Command Does
uv run quran-json fetch Download upstream snapshots into data/ (--force to refresh)
uv run quran-json fetch --check Compare upstream with data/; exit 1 on any change
uv run quran-json verify Check snapshot hashes and licences
uv run quran-json cdn --out DIR Generate the JSON tree
uv run quran-json crosscheck Compare our texts with independent copies (network)
uv run quran-json probe Check a sample of audio URLs

Builds read only the committed snapshots in data/, so they work offline. The site is in site/ (Astro, React, Tailwind, shadcn/ui). Cloudflare Workers serves cdn/, which npm run site writes.

Every push to main deploys through Cloudflare Workers Builds. cdn/ is gitignored, so the build command must generate it (the build image has no uv):

curl -LsSf https://astral.sh/uv/install.sh | sh && export PATH="$HOME/.local/bin:$PATH" && uv sync --locked && npm ci --prefix site && npm run site

The deploy command is npx wrangler deploy.

About

Quran text and translations in JSON format.

Topics

Resources

Stars

616 stars

Watchers

9 watching

Forks

Releases

Packages

Used by

Contributors

Languages