Sunnah.com Hadith Scraper avatar

Sunnah.com Hadith Scraper

Pricing

from $1.79 / 1,000 results

Go to Apify Store
Sunnah.com Hadith Scraper

Sunnah.com Hadith Scraper

Search Sunnah.com or scrape hadith from supplied URLs, including exact references, books, and collections. Get references, English and Arabic text, chapter details, grades, and Arabic isnad with linked narrator IDs. It reads public site pages without requiring an API key.

Pricing

from $1.79 / 1,000 results

Rating

0.0

(0)

Developer

Axiom Works

Axiom Works

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

12 days ago

Last modified

Categories

Share

Returns: one row per hadith with reference, collectionName, bookName, chapterTitle, textEnglish, textArabic, grade, narrators. Input: {"searchQueries": ["intention"], "maxItems": 20} Best for: hadith research and evidence lookup, building study datasets per topic, exporting a whole book or collection with its isnad.

{
"reference": "Sahih Muslim 1653 b",
"collectionName": "Sahih Muslim",
"bookName": "The Book of Oaths - كتاب الأيمان",
"inBookReference": "Book 27, Hadith 31",
"textEnglish": "An oath is to be interpreted according to the intention of the one who takes it.",
"url": "https://sunnah.com/muslim:1653b"
}

What does Sunnah.com Hadith Scraper do?

Sunnah.com Hadith Scraper exports hadith from Sunnah.com as structured data. You give it search words (in English or Arabic), Sunnah.com URLs, or both, and it returns one clean row per hadith: the canonical reference, the collection and book, the chapter, the English translation, the full Arabic text, the Arabic chain of narration (isnad) with Sunnah.com's narrator IDs, and the grade with the scholar who gave it, when the collection has one.

It works as a Sunnah.com scraper and a lightweight Sunnah.com API in one: search the whole site for a word like "patience", pull every hadith in a book such as Sunan Abi Dawud Book 2, walk a whole collection such as Riyad as-Salihin book by book, or fetch a short list of exact references like bukhari:1 and muslim:8a. Everything comes from public Sunnah.com pages. No login and no API key are needed.

Typical uses are Islamic research and evidence lookup (find every narration on a topic with its grade), building datasets for study apps, quizzes or search tools, and comparing the English and Arabic text or the isnad of narrations across collections.

What data can you get from Sunnah.com?

Each hadith row has these fields. Fields that a page or collection doesn't show are null.

FieldDescriptionExample
idStable ID, {collection}:{hadithNumber}bukhari:1302
referenceCanonical reference as shown on Sunnah.comSahih al-Bukhari 1302
collectionCollection slug from the permalinkbukhari
collectionNameCollection nameSahih al-Bukhari
hadithNumberHadith number, as a string (can be 8a)1302
urlHadith permalinkhttps://sunnah.com/bukhari:1302
bookNumberBook number in the collection (introduction possible)23
bookNameEnglish book nameFunerals (Al-Janaa'iz)
chapterNumberChapter number (book and hadith pages)42
chapterTitleEnglish chapter title (book and hadith pages)Patience is to be observed at the first stroke of a calamity
chapterTitleArabicArabic chapter title (book and hadith pages)باب الصَّبْرِ عِنْدَ الصَّدْمَةِ الأُولَى
inBookReferencePosition inside the bookBook 23, Hadith 60
narratorEnglishEnglish narrator lineNarrated Anas
textEnglishEnglish translationThe Prophet (ﷺ) said, "The real patience is at the first stroke of a calamity."
textArabicFull Arabic text (isnad and matn)حَدَّثَنَا مُحَمَّدُ بْنُ بَشَّارٍ ...
sanadArabicArabic chain of narration (isnad)حَدَّثَنَا مُحَمَّدُ بْنُ بَشَّارٍ، حَدَّثَنَا غُنْدَرٌ ...
narratorsIsnad narrators in order: id, name, nameAsCited[{"id": "6879", "name": "محمد بن بشار العبدي", ...}]
gradeEnglish gradeSahih
gradedByWho gave the gradeAl-Albani
gradeArabicArabic grade textصحيح (الألباني)
searchQuerySearch words that found the hadith (null for URL inputs)patience
scrapedAtISO time of scraping2026-10-06T06:33:57.854Z
sourceUrlSunnah.com page the row was parsed fromhttps://sunnah.com/search?q=patience

A few notes on coverage, so you know what to expect:

  • grade, gradedBy and gradeArabic are filled for collections that Sunnah.com grades, such as Sunan Abi Dawud and Jamiat-Tirmidhi; they arenull` for Sahih al-Bukhari and Sahih Muslim.
  • chapterNumber, chapterTitle and chapterTitleArabic come from book and single-hadith pages; search results leave them null.
  • narrators holds the narrator links Sunnah.com shows inside the Arabic isnad; collections without those links, such as Riyad as-Salihin, return null there.
  • bookName on search results keeps the Arabic suffix exactly as the search page shows it, for example Funerals (Al-Janaa'iz) - كتاب الجنائز.

How to use Sunnah.com Hadith Scraper

  1. Open Sunnah.com Hadith Scraper in Apify Console and go to the Input tab.
  2. Type one or more search words under English or Arabic search queries (for example patience or الصبر), or paste Sunnah.com links under Sunnah.com URLs or hadith references. You can use both at once.
  3. Set Total unique hadith limit to the number of rows you want. The run stops as soon as it has that many.
  4. Click Start. Small runs finish in well under a minute.
  5. Open the Output tab to see the table, then export as JSON, CSV, Excel, XML or HTML, or read the dataset through the API.

Accepted URL types:

You giveWhat you get
https://sunnah.com/search?q=charityEvery search hit, page after page (50 per page)
https://sunnah.com/riyadussalihinThe collection's books in order, every hadith in each book
https://sunnah.com/abudawud/2Every hadith in that book, with chapter titles
https://sunnah.com/muslim:8aThat single hadith
bukhari:1 or bukhari 1That single hadith (bare reference)

Tips:

The maxItems limit counts across all inputs together, so with three search words and maxItems set to 60, the first word can use all 60 rows if it has enough hits. A hadith found by two inputs is returned once. Book pages can hold hundreds of hadith (Sunan Abi Dawud Book 2 has 771), and the Actor stops reading a page as soon as maxItems is reached.

Sunnah.com search is fuzzy, so the Actor keeps only hadith whose text contains at least half of the words of your search. A search with no such hits, or a URL that doesn't exist on Sunnah.com, ends the run successfully with 0 rows and a status message that names the input to fix.

Input

The startUrls editor accepts a JSON array of URL objects or strings, including bare references such as "muslim:10". Existing arrays of { "url": "https://sunnah.com/bukhari:1" } continue to work.

FieldTypeRequiredDescription
searchQueriesarray of stringsOne of the twoWords to search on Sunnah.com, in English or Arabic. Each search returns its hits across all collections.
startUrlsarray of URLsOne of the twoSunnah.com search, collection, book or hadith URLs, or bare references like bukhari:1.
maxItemsintegerNoMaximum number of hadith across all inputs, 1-100000, default 50.
proxyConfigurationobjectNoProxy for the browser, default none. Blocked sessions move to Apify Proxy datacenter, then residential, automatically.

Give at least one search word or one URL. Example input:

{
"searchQueries": ["patience"],
"startUrls": [
{ "url": "https://sunnah.com/bukhari:1" },
{ "url": "https://sunnah.com/abudawud/2" }
],
"maxItems": 60,
"proxyConfiguration": { "useApifyProxy": false }
}

Output

Each row is one hadith. These two rows come from a real run with startUrls set to abudawud:391 and bukhari:1302 (long Arabic strings shortened here for reading; the dataset has the full text, and narrators lists every narrator of the chain):

[
{
"id": "abudawud:391",
"reference": "Sunan Abi Dawud 391",
"collection": "abudawud",
"collectionName": "Sunan Abi Dawud",
"hadithNumber": "391",
"url": "https://sunnah.com/abudawud:391",
"bookNumber": "2",
"bookName": "Prayer (Kitab Al-Salat)",
"chapterNumber": "146",
"chapterTitle": "The Obligation To Perform The Salat (Prayers)",
"chapterTitleArabic": "باب الصَّلاَةِ مِنَ الإِسْلاَمِ",
"inBookReference": "Book 2, Hadith 1",
"narratorEnglish": "Talhah b. 'Ubaid Allah said",
"textEnglish": "A man from among the people of Najd with disheveled hair came to the Messenger of Allah (ﷺ). ...",
"textArabic": "حَدَّثَنَا عَبْدُ اللَّهِ بْنُ مَسْلَمَةَ، عَنْ مَالِكٍ، ...",
"sanadArabic": "حَدَّثَنَا عَبْدُ اللَّهِ بْنُ مَسْلَمَةَ، عَنْ مَالِكٍ، ...",
"narrators": [
{ "id": "5085", "name": "عبد الله بن مسلمة الحارثي", "nameAsCited": "عَبْدُ اللَّهِ بْنُ مَسْلَمَةَ" },
{ "id": "6659", "name": "مالك بن أنس الأصبحي", "nameAsCited": "مَالِكٍ" }
],
"grade": "Sahih",
"gradedBy": "Al-Albani",
"gradeArabic": "صحيح (الألباني)",
"searchQuery": null,
"scrapedAt": "2026-10-06T06:33:55.681Z",
"sourceUrl": "https://sunnah.com/abudawud:391"
},
{
"id": "bukhari:1302",
"reference": "Sahih al-Bukhari 1302",
"collection": "bukhari",
"collectionName": "Sahih al-Bukhari",
"hadithNumber": "1302",
"url": "https://sunnah.com/bukhari:1302",
"bookNumber": "23",
"bookName": "Funerals (Al-Janaa'iz)",
"chapterNumber": "42",
"chapterTitle": "Patience is to be observed at the first stroke of a calamity",
"chapterTitleArabic": "باب الصَّبْرِ عِنْدَ الصَّدْمَةِ الأُولَى",
"inBookReference": "Book 23, Hadith 60",
"narratorEnglish": "Narrated Anas",
"textEnglish": "The Prophet (ﷺ) said, \"The real patience is at the first stroke of a calamity.\"",
"textArabic": "حَدَّثَنَا مُحَمَّدُ بْنُ بَشَّارٍ، حَدَّثَنَا غُنْدَرٌ، حَدَّثَنَا شُعْبَةُ، عَنْ ثَابِتٍ، ...",
"sanadArabic": "حَدَّثَنَا مُحَمَّدُ بْنُ بَشَّارٍ، حَدَّثَنَا غُنْدَرٌ، حَدَّثَنَا شُعْبَةُ، عَنْ ثَابِتٍ، ...",
"narrators": [
{ "id": "6879", "name": "محمد بن بشار العبدي", "nameAsCited": "مُحَمَّدُ بْنُ بَشَّارٍ" },
{ "id": "6904", "name": "محمد بن جعفر الهذلي", "nameAsCited": "غُنْدَرٌ" }
],
"grade": null,
"gradedBy": null,
"gradeArabic": null,
"searchQuery": null,
"scrapedAt": "2026-10-06T06:33:57.854Z",
"sourceUrl": "https://sunnah.com/bukhari:1302"
}
]

The run also stores a RUN_SUMMARY record in the key-value store with the number of rows, the inputs, and any input that returned nothing or failed.

How much does it cost to scrape Sunnah.com?

Sunnah.com Hadith Scraper is charged per result: you pay for each hadith row returned, and nothing for searches that find nothing. maxItems caps how many rows a run can return, so it also caps the charge. See the Pricing tab for the current price.

The Actor runs a headless browser, so it uses more memory than a plain HTTP scraper; the default run memory is set for that. It reads a whole book page in one request, then extracts hadith in order only until the requested result limit is reached. Search results are also extracted as needed, so a small limit avoids processing unused records.

Use with AI agents (MCP)

Connect Sunnah.com Hadith Scraper to Claude, Cursor or any MCP client through the Apify MCP server:

{
"mcpServers": {
"apify": {
"url": "https://mcp.apify.com/?tools=axiomworks/sunnah-hadith-scraper"
}
}
}

Example prompts:

  1. "Find 20 hadith about patience on Sunnah.com and list each reference with its grade and who graded it."
  2. "Get Sahih al-Bukhari 1, Sahih Muslim 8a and Jami` at-Tirmidhi 2516 with their English text and the narrators in the isnad."
  3. "Export the first 100 hadith of Sunan Abi Dawud Book 2 with chapter titles and grades as a table."

The agent sees the input fields (searchQueries, startUrls, maxItems) and gets back the rows described above.

Integrations and API

Run Sunnah.com Hadith Scraper from your own code with the Apify API. Set APIFY_TOKEN to your Apify API token (send it in the Authorization header, never in the URL).

Python

from apify_client import ApifyClient
client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("axiomworks/sunnah-hadith-scraper").call(
run_input={"searchQueries": ["patience"], "maxItems": 50}
)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
print(item["reference"], item["grade"], item["textEnglish"][:80])

JavaScript

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: '<YOUR_API_TOKEN>' });
const run = await client.actor('axiomworks/sunnah-hadith-scraper').call({
startUrls: [{ url: 'https://sunnah.com/abudawud/2' }],
maxItems: 40,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();

cURL

curl -X POST "https://api.apify.com/v2/acts/axiomworks~sunnah-hadith-scraper/run-sync-get-dataset-items" \
-H "Authorization: Bearer $APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"searchQueries": ["charity"], "maxItems": 20}'

You can also connect the Actor to Make, Zapier, n8n, Google Sheets, Slack or your own webhooks from the Integrations tab, and schedule runs from the Schedules page, for example to refresh a topic dataset every week.

FAQ

Which collections does it cover? Everything Sunnah.com publishes: Sahih al-Bukhari, Sahih Muslim, Sunan Abi Dawud, Jamiat-Tirmidhi, Sunan an-Nasa'i, Sunan Ibn Majah, Muwatta Malik, Riyad as-Salihin, the 40 Hadith collections and the rest. Use the collection slug from the Sunnah.com address bar, such asbukhari, nasaiorriyadussalihin`.

Can I search in Arabic? Yes. Put Arabic words in searchQueries, for example الصبر. Sunnah.com's own search handles both languages, and the Actor returns exactly what the search page shows.

Why is grade empty for some rows? Sunnah.com shows grades only for some collections. Sahih al-Bukhari and Sahih Muslim carry no grade line, so grade, gradedBy and gradeArabic are null for them.

Why are the chapter fields empty on search results? Sunnah.com search pages don't show chapters. Give the book URL (for example https://sunnah.com/bukhari/23) or the hadith URL instead, and the chapter number and titles are filled. Some Bukhari chapters have no English title at the source.

Why did my run return 0 rows? A search may find nothing, a URL may not exist, or the site may remain blocked after retries. These targets return no rows and the run succeeds. For an unmatched search, try another spelling or an English or Arabic term. For a missing page, replace the URL with an existing hadith, book or collection URL. For persistent blocks, retry later or configure an available proxy. The status message and the RUN_SUMMARY key-value store record explain what happened; neither adds error rows to the dataset. At least one usable target is required: an empty input or only malformed targets fails input validation.

Do I need a proxy? Usually not. Sunnah.com is protected by Cloudflare, and the Actor uses a real browser that loads the site normally. If a session is blocked anyway, the Actor retries on Apify Proxy datacenter IPs and then residential IPs by itself. It never solves CAPTCHAs.

How fast is it? After the browser starts, each Sunnah.com page takes about a second. A search page gives 50 hadith and a book page gives the whole book, so a few hundred rows take a minute or two.

Can I get the narrator biographies? The narrators array gives the Sunnah.com narrator ID, the full name and the name as cited in the chain. Biographies are not part of the output.

This Actor reads only public Sunnah.com pages that anyone can open without an account, at a modest rate of about one page per second. The hadith translations on Sunnah.com may be under copyright, so check the site's terms before you republish large amounts of text, and give credit to the source. You are responsible for how you use the data. This is not legal advice. Sunnah.com Hadith Scraper is an independent tool and is not affiliated with or endorsed by Sunnah.com.

Feedback

Found a bug, a page type that doesn't parse, or need a field that isn't here? Open an issue on the Issues tab and we'll look at it.