pngquran.ws

API

One URL is the whole API

Every image is a GET request you can paste into a browser, an <img> tag, or a build script. No key, no signup.

Quick start

$ curl -O "https://png.quran.ws/api/v1/image/2/255.png?layout=fit&aspect=post&width=3000"

surah 2 · ayah 255 · 4:5 portrait · 3000 px wide · transparent

Path

GET /api/v1/image/{surah}/{range}.{format}
/2/255.pngone ayah
/18/1-10.svga range, as vectors
/112/1-.pdfto the end of the surah, print-ready
?surah=2&from=255&to=255the same thing as a query string, on /api/v1/image

Parameters

NameValuesDefault
layoutmushaf · fitmushaf
aspectsquare · post · story · wide · banner · 4:5square
width64 – 8000 px (png only)2000
colorany hex#231f20
backgroundany hextransparent
aligncenter · right · left (fit layout)center
padding0 – 40024
lineSpacing0.6 – 31
wordSpacing0.3 – 4 (fit layout)1
justify0 to switch it off (fit layout)on
basmalah0 to omit it from a range opening at ayah 1on
vpin the renderer for permanent cachingunpinned

layout=mushaf reproduces the plate: every word keeps the x it has on the printed page and the baseline it sits on, so the image is the mushaf itself, cropped to your selection. There is nothing to align — the printed lines are justified to one shared text block, and that relationship is part of the artwork. layout=fit repacks the same word artwork into lines that fill the requested aspect, spreading each line but the last flush to both edges. Neither ever scales or stretches a letter — justification moves the gaps between words, never the words themselves, and a line that would have to stretch more than three times its natural spacing is left ragged rather than pulled apart.

Metadata

GET /api/v1/surahsall 114, with ayah counts, names and page spans
GET /api/v1/surahs/18one surah
GET /api/v1/optionsthe machine-readable list of everything above

Errors say what to fix

GET /api/v1/image/2/999.png   → 400
{ "error": "surah 2 has 286 ayahs, got 999-999" }

Limits

120 requests per minute per IP. Rendered images are cached server-side and carry an ETag, so a page that hotlinks the same ayah costs one render, ever — a site that embeds the same few ayahs will never come close to the limit. If you need more than that for something real, get in touch.

Plain URLs are cached for five minutes and then revalidated, so a fix to the layout reaches you. Add v=2 to pin the current renderer: that URL is then immutable and safe to cache for a year, and it will keep drawing exactly what it draws today.

Artwork: King Fahd Glorious Qur'an Printing Complex, Madani mushaf V4 (1441H). Licence and provenance.