Search the Quran
shamela_search_quranبحث في القرآن
Search the Qur'an (6,236 verses, Hafs from Asim, Egyptian إملائي orthography) via the pre-built aya/ Lucene index. Ships zero-config — works on a fresh Shamela install. Returns aya_id (1..6236), surah, surah_name, aya, body (full verse text), and a snippet with ... around matches. A single-word query is also searched as its ال-stripped stem and that stem's prefixed forms, which widens it: «الملك» returns 60 verses where the word as typed accounts for 28. The widening is reported — stem_expanded_to names the forms searched, query_form_hits counts the verses matching your word or its prefixed forms, and each hit's matched_form says which form it came in on, so a verse that only rode the stem (مَٰلِكِ in 1:4) is identifiable rather than presented as your word. Pair with shamela_get_aya to fetch a single verse with the Othmani Amiri rendering, or with shamela_get_tafseer_of_aya to find tafsir books that comment on a matching verse.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of results to return (1-100, default 20). | |
| query | Yes | Arabic text of a verse or part of one. Matched against all 6,236 verses in BOTH orthographies — the Egyptian إملائي spelling a user types from memory AND the Uthmani rasm that mushaf apps, quran.com and PDFs copy (ٱ, dagger alef, ﴿﴾, full tashkeel are all handled), so paste the verse exactly as you received it. Every word is ANDed. Single-word queries also match prefixed forms (e.g. «الصبر» matches «بالصبر») AND the same word with «ال» stripped («الملك» is also searched as «ملك»/«للملك»), which widens the answer past the word you typed — the response names those forms in `stem_expanded_to`, tags each hit with the `matched_form` it came in on, and reports in `query_form_hits` how many verses match your word itself. Results come back in mushaf order (aya_id), not by relevance. | |
| offset | No | Number of results to skip for pagination. Use with `limit` to page through large result sets. The response includes `has_more` and `next_offset` to drive paging. | |
| options | No | Currently only the `wildcards` flag is honored. The Quranic index ships pre-built and zero-config. | |
| response_format | No | Output format for the human-readable text. 'markdown' (default) is best for direct display; 'json' returns the same data as a single JSON code block; 'none' skips the rendered text entirely and returns a one-line pointer, leaving `structuredContent` as the whole answer. The structured data is returned in `structuredContent` regardless of this setting, so a caller that parses it should pass 'none' — the character budget is measured over BOTH channels, and the unread copy is otherwise spending most of it. Requires the 'response_format.none' capability (see shamela_brief). | markdown |