@quranjs/api
v3.4.0
Published
Official library for fetching authentic, scholarly verified Quran data from Quran.com.
Readme
@quranjs/api
A JavaScript/TypeScript library for fetching authentic, scholarly verified Quran data from the Quran.com API.
Unlike other sources, this SDK connects you directly to the Quran Foundation—ensuring a trusted, highly scrutinized source of reliable content, including properly licensed translations, tafsir, and supplementary materials.
Works in both server and browser environments through separate runtime entrypoints:
@quranjs/api/server@quranjs/api/public
Built by the Quran Foundation — the team behind Quran.com
Installation
# npm
npm install @quranjs/api
# yarn
yarn add @quranjs/api
# pnpm
pnpm add @quranjs/apiQuick Start
import { SearchMode } from "@quranjs/api";
import { createServerClient } from "@quranjs/api/server";
const client = createServerClient({
clientId: process.env.CLIENT_ID!,
clientSecret: process.env.CLIENT_SECRET!,
});
const chapters = await client.content.v4.chapters.list();
const results = await client.search.v1.query({
query: "mercy",
mode: SearchMode.Quick,
});For browser or mobile apps, use @quranjs/api/public. Public usage docs live in the API docs portal.
Existing QuranClient imports from @quranjs/api remain supported for backwards compatibility:
import { QuranClient } from "@quranjs/api";
const client = new QuranClient({
clientId: process.env.CLIENT_ID!,
clientSecret: process.env.CLIENT_SECRET!,
});
const chapters = await client.chapters.findAll();For new apps, prefer the runtime-specific @quranjs/api/server and @quranjs/api/public entrypoints.
Documentation
For complete documentation, guides, and API reference, visit:
Features
- 🚀 Full TypeScript support
- 🌐 Works in Node.js and browsers
- ✅ Scholarly verified data
- 📖 Access chapters, verses, juzs, and more
- 🔍 Full-text search
- 🎧 Audio recitations
- 🌍 Multiple verified translations and languages
Links
- Quran Foundation — Our mission to make the Quran accessible to everyone
- API Documentation — Full API reference
- GitHub Repository — Source code and issues
License
MIT © Quran Foundation
