Embed Service

Display the Quranpedia content linked to an ayah inside your site — tafsir, word meanings, reflective notes, i'rab, qira'at, and more — without copying the data or managing it yourself.

Try the embed code builder or keep reading the guide ↓ العربية

# Quick start (helper script)

The easiest way: add a div tag, then include the embed.js script; it creates the iframe and adjusts its height automatically whenever the content changes.

<div data-quranpedia-embed data-surah="2" data-ayah="255"></div>
<script src="https://quranpedia.net/embed.js" defer></script>

To open a specific section directly (reflective notes, for example) with the dark theme:

<div data-quranpedia-embed data-surah="2" data-ayah="255"
     data-type="notes" data-theme="dark"></div>
<script src="https://quranpedia.net/embed.js" defer></script>

# Direct iframe embedding

If you prefer full control, embed the URL directly; note that the iframe height will not adjust automatically unless you listen yourself for the postMessage events coming from the page.

<iframe src="https://quranpedia.net/embed?surah=2&ayah=255&type=tafsir"
        width="100%" height="600" style="border:0;border-radius:12px"
        loading="lazy"></iframe>

# Query Parameters

surah required
Surah number (1 to 114).
ayah required
Ayah number, or an ayah range like 1-7 (max 20 ayahs).
type optional
Section to open directly. Values: tafsir, meanings, notes, e3rab, qiraat, similar, topics, fatwa, asbab, nasekh, translations, attachments. If omitted, the grid of sections available for the ayah is shown.
theme optional
light (default), dark for dark mode, or sepia for a warm paper look.
primary optional
Primary color as hex without the # sign, e.g. primary=7c3aed; the full shade palette is derived from it to match your brand.
bg optional
Background color in the same format, or bg=transparent for a transparent background that blends with your page.
size optional
Font size percentage from 80 to 130, e.g. size=115.
radius optional
Corner rounding: none to disable it, or sm for a subtler radius; the default is rounded corners.
options optional
Comma-separated list of sections to limit the grid to, e.g. options=tafsir,meanings.
lock optional
lock=1 with type pins the embed to the chosen section and hides the back-to-grid button.
book optional
A book ID to open its content directly in book-based sections (such as tafsir and i'rab), or to pick the meanings or translation book.
books optional
In the translations section: comma-separated book IDs to display several translations side by side, e.g. books=1949,2005.
image optional
image=1 with a selected book shows the scanned page images of the book inside the frame.
category optional
Limit reflective notes (type=notes) to a specific category.
lang optional
Translation language ID for the translations section.
ayah_text optional
ayah_text=0 hides the verse-text card at the top of the embed and on all inner pages; the default shows it.
tab optional
The inner tab. For qira'at: word (default), compare, or learn; for similarities: similar, beginning, ending, identical, phrases, scholarly.

Note: the grid shows only the sections available for the requested ayah, and every section works inside the same frame. Try the embed code builder to generate the URL interactively.

# Live preview

Ayat al-Kursi (Surah al-Baqarah, ayah 255) — the sections grid:

# Technical notes

  • The page is fully stateless; no cookies and no sessions, and navigation between sections is plain links inside the frame.
  • The page can be embedded on any site or origin (Content-Security-Policy: frame-ancestors *).
  • The page posts its height to the parent page via postMessage with a message of this form:
    { "source": "quranpedia-embed", "type": "resize", "height": 1234 }
  • Avoid storing encyclopedia content on your side; the URL always serves the latest version of the content.
  • The same data is available as JSON via the API for anyone who wants to build their own interface.