Hadith is the second source of Islamic law after the Quran. It is the sayings and actions of Prophet Muhammed (PBUH).
An extensive JSON-formatted database is available, containing the Hadiths - Prophet Muhammed's (PBUH) sayings and actions - in both Arabic and English. The database encompasses 17 books of Hadiths.
قاعدة بيانات شاملة بصيغة JSON، تحتوي على الأحاديث النبوية الشريفة باللغتين العربية والإنجليزية. تشمل القاعدة 17 كتاباً من كتب السنة النبوية.
The data was scrapped from Sunnah.com, and was converted to JSON format using a custom script. All scripts are available in the src
folder.
The data is available in two formats:
db/by_book
folder.db/by_chapter
folder.See all Types in the types/index.d.ts
file.
Every Hadih is an object with the following format:
interface Hadith {
id: number;
chapterId: number;
bookId: number;
arabic: string;
english: {
narrator: string;
text: string;
};
}
npm install
- Installs the dependencies.npm run build
- Compiles the TypeScript files to JavaScript.npm run start
- Starts the script that scrapes the data from Sunnah.com.npm run dev:build
- Compiles the TypeScript files to JavaScript in watch mode.npm run dev:start
- Starts the script that scrapes the data from Sunnah.com in watch mode..
├── db
│ ├── by_book
│ │ │ ├── the_9_books
│ │ │ │ ├── bukhari.json
│ │ │ │ ├── muslim.json
│ │ │ │ ├── ...
│ │ │ ├── forties
│ │ │ │ ├── nawawi40.json
│ │ │ │ ├── ...
│ │ │ ├── ...
│ ├── by_chapter
│ │ ├── the_9_books
│ │ │ ├── bukhari
│ │ │ │ ├── 1.json
│ │ │ │ ├── 2.json
│ │ │ │ ├── ...
│ │ │ ├── muslim
│ │ │ │ ├── ...
│ │ │ ├── ...
│ │ ├── forties
│ │ │ ├── nawawi40
│ │ │ │ ├── 1.json
│ │ │ │ ...
│ │ │ other_books
│ │ │ │ RyadSalihin
│ │ │ │ │ ├── 1.json
│ │ ...
│ ├── by_book
│ src
│ │ ├── index.ts
│ │ ├── types
│ │ ├── helpers
│ ...
src
directory is not perfect. I wrote it when I was a beginner to practice scraping. It needs refactoring. (BTW, it works fine 😅)Contributions are welcome. Please open an issue or a pull request.
May Allah accept this work and make it beneficial for all Muslims. Ameen.