widequran
Async Rust SDK for the WideQuran API. Access all 114 surahs, 6,236 ayahs across multiple translations, hadith collections (Bukhari, Muslim, and more), tafsir commentaries (Ibn Kathir, Jalalayn), Quranic people and prophets, topics, and Islamic glossary terms.
Built on widequran.com -- a comprehensive Quran encyclopedia with full-text search, Arabic text with transliteration, and scholarly commentary for students and developers.
Install
[]
= "0.1"
= { = "1", = ["full"] }
Or via the command line:
Quick Start
use Client;
async
What You Can Do
Surahs and Ayahs
The Quran contains 114 surahs (chapters) with 6,236 ayahs (verses). Surahs are classified as Meccan (revealed in Mecca) or Medinan (revealed in Medina). Each ayah is available in Arabic script with multiple English translations.
// List all surahs
let surahs = client.list_surahs.await?;
// Get a specific surah
let baqarah = client.get_surah.await?;
// Get a specific ayah by ID
let ayah = client.get_ayah.await?;
// Search ayahs
let results = client.search.await?;
Juz and Hizb Divisions
The Quran is divided into 30 juz (parts) for structured reading, each further divided into hizb (half-juz) markers. These divisions support the tradition of completing the Quran during Ramadan.
// List all 30 juz
let juz = client.list_juz.await?;
// Get a specific juz
let juz_1 = client.get_juz.await?;
// List hizb markers
let hizbs = client.list_hizbs.await?;
Tafsir (Commentary)
Classical and modern tafsir commentaries provide scholarly interpretation. Available collections include Ibn Kathir, Jalalayn, and others, offering verse-by-verse exegesis.
// List tafsir collections
let tafsirs = client.list_tafsirs.await?;
// Get a specific tafsir
let ibn_kathir = client.get_tafsir.await?;
// List tafsir entries
let entries = client.list_tafsir_entries.await?;
Hadith Collections
Hadith (prophetic traditions) from the six canonical collections -- Sahih al-Bukhari, Sahih Muslim, Sunan Abu Dawud, Sunan al-Tirmidhi, Sunan al-Nasa'i, and Sunan Ibn Majah -- with grading (sahih, hasan, da'if).
// List hadith collections
let collections = client.list_hadith_collections.await?;
// Get hadiths from Bukhari
let hadiths = client.list_hadiths.await?;
// Search hadiths
let results = client.search_hadith.await?;
People and Prophets
The Quran mentions 25 prophets by name, from Adam to Muhammad. WideQuran catalogues each prophet with their Arabic name, story references, and the surahs in which they appear.
| Prophet | Arabic | Role | Key Surahs |
|---|---|---|---|
| Adam | آدم | First human, first prophet | Al-Baqarah, Al-A'raf |
| Ibrahim (Abraham) | إبراهيم | Father of monotheism | Ibrahim, Al-Baqarah |
| Musa (Moses) | موسى | Liberator, Torah recipient | Ta-Ha, Al-Qasas |
| Isa (Jesus) | عيسى | Messiah, Word of God | Al-Imran, Maryam |
| Muhammad | محمد | Final prophet, Quran recipient | Muhammad, Al-Fath |
let people = client.list_people.await?;
let ibrahim = client.get_person.await?;
Topics and Glossary
Topics group ayahs thematically -- mercy, justice, prayer, charity, patience, and more. The glossary defines Arabic Islamic terms with transliterations, covering words like taqwa (God-consciousness), iman (faith), ihsan (excellence), salah (prayer), and zakat (charity).
let topics = client.list_topics.await?;
let glossary = client.list_glossary.await?;
let term = client.get_glossary_term.await?;
API Methods
| Method | Description |
|---|---|
list_surahs() |
List all 114 surahs |
get_surah(slug) |
Get surah details |
list_translations() |
List available translations |
get_translation(code) |
Get translation details |
list_ayahs(surah) |
List ayahs, optionally filtered by surah |
get_ayah(id) |
Get a specific ayah |
search(query) |
Search ayahs by keyword |
list_juz() |
List all 30 juz |
get_juz(number) |
Get juz details |
list_hizbs() |
List hizb markers |
get_hizb(number) |
Get hizb details |
list_tafsirs() |
List tafsir collections |
get_tafsir(slug) |
Get tafsir details |
list_tafsir_entries() |
List tafsir entries |
get_tafsir_entry(id) |
Get a specific tafsir entry |
list_hadith_collections() |
List hadith collections |
get_hadith_collection(slug) |
Get collection details |
list_hadiths(collection) |
List hadiths |
get_hadith(id) |
Get a specific hadith |
search_hadith(query) |
Search hadiths |
list_people() |
List Quranic people |
get_person(slug) |
Get person details |
list_topics() |
List Quranic topics |
get_topic(slug) |
Get topic details |
list_glossary() |
List Islamic glossary terms |
get_glossary_term(slug) |
Get glossary term |
All methods are async and return Result<T, WideQuranError>.
Custom Base URL
let client = with_base_url;
WideHoly Scripture Platform
Part of the WideHoly multi-religion scripture platform.
| Site | Domain | Focus |
|---|---|---|
| WideBible | widebible.com | 66 books, 4 translations, cross-references, study tools |
| WideQuran | widequran.com | 114 surahs, hadith, tafsir, Quranic people |
| WideTorah | widetorah.com | Tanakh, Talmud, Mishnah, Rashi, parashot |
| WideGita | widegita.com | Bhagavad Gita, Upanishads, Yoga Sutras, deities |
| WideSutra | widesutra.com | Tipitaka, Pali Canon, Buddhist concepts |
| WideHoly | wideholy.com | Cross-religion hub, comparison, calendar |
Also Available
| Platform | Package | Install |
|---|---|---|
| Rust | widequran | cargo add widequran |
| Python | widequran | pip install widequran |
| TypeScript | widequran | npm install widequran |
Learn More About the Quran
- Scripture: Surahs · Translations
- Reference: People · Topics · Glossary
- Study: Tafsir · Hadith Collections · Juz Divisions
- Tools: Search · Developer Docs
- API: Developer Docs · OpenAPI Spec
License
MIT