Chapters API
Access Quran chapter (surah) information and metadata.
The Chapters API provides access to information about the 114 chapters (surahs) of the Quran.
Get All Chapters
const chapters = await client.chapters.findAll();
chapters.forEach((chapter) => {
console.log(`${chapter.id}. ${chapter.nameSimple} (${chapter.nameArabic})`);
console.log(` Verses: ${chapter.versesCount}`);
console.log(` Revelation: ${chapter.revelationPlace}`);
});
Chapter Type
Prop
Type
With Language Options
import { Language } from "@quranjs/api";
const arabicChapters = await client.chapters.findAll({
language: Language.ARABIC,
});
const urduChapters = await client.chapters.findAll({
language: Language.URDU,
});
Get Chapter by ID
const alFatiha = await client.chapters.findById("1");
const alBaqarah = await client.chapters.findById("2");
const anNas = await client.chapters.findById("114");
Get Chapter Info
const info = await client.chapters.findInfoById("1");
console.log(info.shortText); // Brief description
console.log(info.text); // Full description
console.log(info.source); // Source attribution
ChapterInfo Type
Prop
Type
Last updated on