May the peace, blessings, and mercy of God be upon you
A while ago I tried to use the dental pearls API
But I faced some difficulties, including that the API
only deals with JSONP, and you will not be able to deal with it in normal ways because of CORS.
If you succeed in avoiding CORS
by using JSONP
you will get the output in HTML
format. Also, there is no documentation
or document explaining the details of this API
and how to deal with it.
I decided to create an intermediary API
that avoids the CORS
problem and gives you the data in JSON
format along with a detailed explanation of the API
and how to use it
In addition to containing some additional features that are not found in the official API
cache
for 5
seconds100
searches per day per IP
You can edit them from the config.js file
fork
or clone
this projectdependencies
npm install
API
npm start
API
will be available at the following link http://localhost:5000
localhost
as you want, or upload it to your own hosting or server Link: Postman
Postman
to learn how to work with the API
and see examplesfork
the collection
to use it as you wishenvironment
to dev
and you can change the link for the variable {{url}}
if you have changed it or changed the port
To view interactive API documentation:
Run the server:
npm run dev
Open your browser and go to:
http://localhost:5000/api-docs
Here you will find the Swagger UI that allows you to explore all available endpoints and test the API directly from the browser.
The API
contains a set of endpoint
endpoint
starts with /api
, it searches through the official Durar Al-Suniya API
endpoint
begins with /site
, this is how it is searched through the Durar Al-Sunniyya search page Searching for hadiths gives 15
results
Format the response as JSON
{
"metadata" : {
"length" : " عدد نتائج البحث " ,
"page" : " رقم الصفحة " ,
"removeHTML" : " هل عناصر الـ HTML ممسوحة أم لا " ,
"isCached" : " هل هذه النتائج من الـ cache أم لا "
},
"data" : [
{
"hadith" : " الحديث " ,
"rawi" : " الراوي " ,
"mohdith" : " المحدث " ,
"book" : " الكتاب " ,
"numberOrPage" : " رقم الحديث او الصفحة " ,
"grade" : " درجة الصحة "
}
]
}
Searching for hadiths gives 30
results
Format the response as JSON
{
"metadata" : {
"length" : " عدد نتائج البحث " ,
"page" : " رقم الصفحة " ,
"removeHTML" : " هل عناصر الـ HTML ممسوحة أم لا " ,
"specialist" : " نوع الاحاديث هل هي للمتخصصين أم لا " ,
"numberOfNonSpecialist" : " عدد الأحاديث لغير المتخصصين " ,
"numberOfSpecialist" : " عدد الأحاديث للمتخصصين " ,
"isCached" : " هل هذه النتائج من الـ cache أم لا "
},
"data" : [
{
"hadith" : " الحديث " ,
"rawi" : " الراوي " ,
"mohdith" : " المحدث " ,
"mohdithId" : " رقم المحدث " ,
"book" : " الكتاب " ,
"bookId" : " رقم الكتاب " ,
"numberOrPage" : " رقم الحديث او الصفحة " ,
"grade" : " درجة الصحة " ,
"explainGrade" : " توضيح درجة الصحة " ,
"takhrij" : " تخريج الحديث في كتب أخرى " ,
"hadithId" : " رقم الحديث لاستخدامه في البحث عن الأحاديث البديلة أو الحديث البديل الصحيح " ,
"hasSimilarHadith" : " هل الحديث له أحاديث مشابهة أم لا " ,
"hasAlternateHadithSahih" : " هل الحديث له حديث صحيح بديل أم لا " ,
"similarHadithDorar" : " رابط الأحاديث المشابهة في موقع الدرر " ,
"alternateHadithSahihDorar" : " رابط الحديث الصحيح في موقع الدرر " ,
"urlToGetSimilarHadith" : " رابط لكي تبحث عن الأحاديث المشابهة " ,
"urlToGetAlternateHadithSahih" : " رابط لكي تبحث عن الحديث الصحيح " ,
"hasSharhMetadata" : " هل الحديث له شرح أم لا " ,
"sharhMetadata" : {
"id" : " رقم الشرح " ,
"isContainSharh" : " هل يحتوى هذا الرد على شرح الحديث أم لا؟ " ,
"urlToGetSharh" : " رابط لكي تبحث عن شرح الحديث "
}
}
]
}
It brings you similar conversations corresponding to the id
Format the response as JSON
{
"metadata" : {
"length" : " عدد نتائج البحث " ,
"isCached" : " هل هذه النتائج من الـ cache أم لا "
},
"data" : [
{
"hadith" : " الحديث " ,
"rawi" : " الراوي " ,
"mohdith" : " المحدث " ,
"mohdithId" : " رقم المحدث " ,
"book" : " الكتاب " ,
"bookId" : " رقم الكتاب " ,
"numberOrPage" : " رقم الحديث او الصفحة " ,
"grade" : " درجة الصحة " ,
"explainGrade" : " توضيح درجة الصحة " ,
"hadithId" : " رقم الحديث لاستخدامه في البحث عن الأحاديث البديلة أو الحديث البديل الصحيح " ,
"hasSimilarHadith" : " هل الحديث له أحاديث مشابهة أم لا " ,
"hasAlternateHadithSahih" : " هل الحديث له حديث صحيح بديل أم لا " ,
"similarHadithDorar" : " رابط الأحاديث المشابهة في موقع الدرر " ,
"alternateHadithSahihDorar" : " رابط الحديث الصحيح في موقع الدرر " ,
"urlToGetSimilarHadith" : " رابط لكي تبحث عن الأحاديث المشابهة " ,
"urlToGetAlternateHadithSahih" : " رابط لكي تبحث عن الحديث الصحيح " ,
"hasSharhMetadata" : " هل الحديث له شرح أم لا " ,
"sharhMetadata" : {
"id" : " رقم الشرح " ,
"isContainSharh" : " هل يحتوى هذا الرد على شرح الحديث أم لا؟ " ,
"urlToGetSharh" : " رابط لكي تبحث عن شرح الحديث "
}
}
]
}
It brings you the conversation corresponding to the id
Format the response as JSON
{
"metadata" : {
"isCached" : " هل هذه النتائج من الـ cache أم لا "
},
"data" : {
"hadith" : " الحديث " ,
"rawi" : " الراوي " ,
"mohdith" : " المحدث " ,
"mohdithId" : " رقم المحدث " ,
"book" : " الكتاب " ,
"bookId" : " رقم الكتاب " ,
"numberOrPage" : " رقم الحديث او الصفحة " ,
"grade" : " درجة الصحة " ,
"explainGrade" : " توضيح درجة الصحة " ,
"hadithId" : " رقم الحديث لاستخدامه في البحث عن الأحاديث البديلة أو الحديث البديل الصحيح " ,
"hasSimilarHadith" : " هل الحديث له أحاديث مشابهة أم لا " ,
"hasAlternateHadithSahih" : " هل الحديث له حديث صحيح بديل أم لا " ,
"similarHadithDorar" : " رابط الأحاديث المشابهة في موقع الدرر " ,
"alternateHadithSahihDorar" : " رابط الحديث الصحيح في موقع الدرر " ,
"urlToGetSimilarHadith" : " رابط لكي تبحث عن الأحاديث المشابهة " ,
"urlToGetAlternateHadithSahih" : " رابط لكي تبحث عن الحديث الصحيح " ,
"hasSharhMetadata" : " هل الحديث له شرح أم لا " ,
"sharhMetadata" : {
"id" : " رقم الشرح " ,
"isContainSharh" : " هل يحتوى هذا الرد على شرح الحديث أم لا؟ " ,
"urlToGetSharh" : " رابط لكي تبحث عن شرح الحديث "
}
}
}
It brings you the correct hadith corresponding to the id
Format the response as JSON
{
"metadata" : {
"isCached" : " هل هذه النتائج من الـ cache أم لا "
},
"data" : {
"hadith" : " الحديث " ,
"rawi" : " الراوي " ,
"mohdith" : " المحدث " ,
"mohdithId" : " رقم المحدث " ,
"book" : " الكتاب " ,
"bookId" : " رقم الكتاب " ,
"numberOrPage" : " رقم الحديث او الصفحة " ,
"grade" : " درجة الصحة " ,
"hadithId" : " رقم الحديث لاستخدامه في البحث عن الأحاديث البديلة أو الحديث البديل الصحيح " ,
"hasSimilarHadith" : " هل الحديث له أحاديث مشابهة أم لا " ,
"hasAlternateHadithSahih" : " هل الحديث له حديث صحيح بديل أم لا " ,
"similarHadithDorar" : " رابط الأحاديث المشابهة في موقع الدرر " ,
"urlToGetSimilarHadith" : " رابط لكي تبحث عن الأحاديث المشابهة " ,
"hasSharhMetadata" : " هل الحديث له شرح أم لا " ,
"sharhMetadata" : {
"id" : " رقم الشرح " ,
"isContainSharh" : " هل يحتوى هذا الرد على شرح الحديث أم لا؟ " ,
"urlToGetSharh" : " رابط لكي تبحث عن شرح الحديث "
}
}
}
To search for an explanation of a single hadith using id
Format the response as JSON
{
"metadata" : {
"isCached" : " هل هذه النتائج من الـ cache أم لا "
},
"data" : {
"hadith" : " الحديث " ,
"rawi" : " الراوي " ,
"mohdith" : " المحدث " ,
"book" : " الكتاب " ,
"numberOrPage" : " رقم الحديث او الصفحة " ,
"grade" : " درجة الصحة " ,
"takhrij" : " تخريج الحديث في كتب أخرى " ,
"hasSharhMetadata" : " هل الحديث له شرح أم لا " ,
"sharhMetadata" : {
"id" : " رقم الشرح " ,
"isContainSharh" : " هل يحتوى هذا الرد على شرح الحديث أم لا؟ " ,
"urlToGetSharh" : " رابط لكي تبحث عن شرح الحديث " ,
"sharh" : " شرح الحديث "
}
}
}
To search for an explanation of one hadith based on the method of the given text
Format the response as JSON
{
"metadata" : {
"specialist" : " نوع الاحاديث هل هي للمتخصصين أم لا " ,
"isCached" : " هل هذه النتائج من الـ cache أم لا "
},
"data" : {
"hadith" : " الحديث " ,
"rawi" : " الراوي " ,
"mohdith" : " المحدث " ,
"book" : " الكتاب " ,
"numberOrPage" : " رقم الحديث او الصفحة " ,
"grade" : " درجة الصحة " ,
"takhrij" : " تخريج الحديث في كتب أخرى " ,
"hasSharhMetadata" : " هل الحديث له شرح أم لا " ,
"sharhMetadata" : {
"id" : " رقم الشرح " ,
"isContainSharh" : " هل يحتوى هذا الرد على شرح الحديث أم لا؟ " ,
"urlToGetSharh" : " رابط لكي تبحث عن شرح الحديث " ,
"sharh" : " شرح الحديث "
}
}
}
Searching for an explanation of the hadiths gives 30
results
Format the response as JSON
{
"metadata" : {
"length" : " عدد نتائج البحث " ,
"page" : " رقم الصفحة " ,
"removeHTML" : " هل عناصر الـ HTML ممسوحة أم لا " ,
"specialist" : " نوع الاحاديث هل هي للمتخصصين أم لا " ,
"isCached" : " هل هذه النتائج من الـ cache أم لا "
},
"data" : [
{
"hadith" : " الحديث " ,
"rawi" : " الراوي " ,
"mohdith" : " المحدث " ,
"book" : " الكتاب " ,
"numberOrPage" : " رقم الحديث او الصفحة " ,
"grade" : " درجة الصحة " ,
"takhrij" : " تخريج الحديث في كتب أخرى " ,
"hasSharhMetadata" : " هل الحديث له شرح أم لا " ,
"sharhMetadata" : {
"id" : " رقم الشرح " ,
"isContainSharh" : " هل يحتوى هذا الرد على شرح الحديث أم لا؟ " ,
"urlToGetSharh" : " رابط لكي تبحث عن شرح الحديث " ,
"sharh" : " شرح الحديث "
}
}
]
}
To search for information about the speaker using the id
Format the response as JSON
{
"metadata" : {
"isCached" : " هل هذه النتائج من الـ cache أم لا "
},
"data" : {
"name" : " المحدث " ,
"mohdithId" : " رقم المحدث " ,
"info" : " معلومات عن المحدث "
}
}
To search for information about the book using the id
Format the response as JSON
{
"metadata" : {
"isCached" : " هل هذه النتائج من الـ cache أم لا "
},
"data" : {
"name" : " الكتاب " ,
"bookId" : " رقم الكتاب " ,
"author" : " المؤلف " ,
"reviewer" : " المراجع " ,
"publisher" : " دار النشر " ,
"edition" : " رقم الطبعة " ,
"editionYear" : " سنة الطبعة "
}
}
query
elements you can use
With a detailed explanation below the table
key. key | Description |
---|---|
value | It is the content of the text of the hadith that you want to search for |
page | To select the page you want |
removehtml | Delete HTML elements in speech |
specialist | It is used to determine the type of hadiths, whether they are for specialists or not |
xclude | A word or phrase that you want to exclude from the search |
st | Determine the search method |
t | Define the search scope |
d[] | Determine the degree of the hadith, whether it is authentic or weak |
m[] | Specify the names of the updates you want |
s[] | Select the books you want to search |
rawi[] | Specify the names of the narrators you want |
[]
indicate that this element accepts more than one option /v1/api/hadith/search?value=جملة البحث
/v1/api/hadith/search?value=جملة البحث&page=1
page=1
HTML
elements in speech<span class="search-keys">...</span>
/v1/api/hadith/search?value=جملة البحث&removehtml=true
HTML
elements from the search resultstrue
true
for specialists and false
for non-specialists/v1/api/hadith/search?value=جملة البحث&specialist=true
false
/v1/api/hadith/search?value=جملة البحث&xclude=اليهود
اليهود
will be excluded from the search جميع الكلمات
, أي كلمة
, بحث مطابق
w
, a
, p
جميع الكلمات
st=w
أي كلمة
it will be st=a
بحث مطابق
st=p
/v1/api/hadith/search?value=جملة البحث&st=p
All the values and research methods they represent
Or you can get it as a JSON
file from here
جميع الأحاديث
, الأحاديث المرفوعة
, الأحاديث القدسية
, آثار الصحابة
, شروح الأحاديث
*
, 0
, 1
, 2
, 3
جميع الأحاديث
it will be t=*
الأحاديث المرفوعة
, t=0
الأحاديث القدسية
t=1
آثار الصحابة
t=2
شروح الأحاديث
, t=3
/v1/api/hadith/search?value=جملة البحث&t=1
All values and the search ranges they represent
Or you can get it as a JSON
file from here
0
, 1
, 2
, 3
, 4
جميع الدرجات
d[]=0
أحاديث حكم المحدثون عليها بالصحة
it will be d[]=1
أحاديث حكم المحدثون على أسانيدها بالصحة
it will be d[]=2
أحاديث حكم المحدثون عليها بالضعف
it will be d[]=3
أحاديث حكم المحدثون على أسانيدها بالضعف
it will be d[]=4
/v1/api/hadith/search?value=جملة البحث&d[]=3
/v1/api/hadith/search?value=جملة البحث&d[]=1&d[]=2
All the values and degrees they represent
Or you can get it as a JSON
file from here
0
, 179
, 204
, 256
, 261
...etc.0
represents جميع المحدثين
179
represents الإمام المالك
204
represents الإمام الشافعي
256
represents البخاري
261
represents مسلم
/v1/api/hadith/search?value=جملة البحث&m[]=179
/v1/api/hadith/search?value=جملة البحث&m[]=256&m[]=261
All the values and the names of the speakers they represent
Or you can get it as a JSON
file from here
0
, 13457
, 6216
, 3088
, 96
...etc.0
represents جميع المحدثين
and 13457
represents الأربعون النووية
6216
represents صحيح البخاري
3088
represents صحيح مسلم
96
represents الصحيح المسند
/v1/api/hadith/search?value=جملة البحث&s[]=96
/v1/api/hadith/search?value=جملة البحث&s[]=6216&s[]=13457
All the values and the names of the books they represent
Or you can get it as a JSON
file from here
0
, 1819
, 8918
, 2664
...etc.0
represents جميع الرواة
1819
represents أسماء بنت أبي بكر
8918
represents عمر بن الخطاب
2664
represents ابن عباس
/v1/api/hadith/search?value=جملة البحث&rawi[]=1819
/v1/api/hadith/search?value=جملة البحث&rawi[]=8918&rawi[]=2664
2665
symbolizes ابن عباس أو أبو هريرة
8924
symbolizes عمر بن الخطاب وأبو هريرة
264
symbolizes أبو الدرداء وأبو أمامة وعبدالله بن عمر وابن عباس وجابر بن عبدالله
All the values and the names of the narrators that represent them
Or you can get it as a JSON
file from here
All available data and the values it represents can be obtained from these endpoints
[
{
"endpoint" : " /v1/data/book " ,
"description" : " احضار كل الكتب المتاحة " ,
"abstractResponse" : [
{
"key" : " الكلمة المفتاحية " ,
"value" : " القيمة "
}
]
},
{
"endpoint" : " /v1/data/degree " ,
"description" : " احضار كل درجات الحديث المتاحة " ,
"abstractResponse" : [
{
"key" : " الكلمة المفتاحية " ,
"value" : " القيمة "
}
]
},
{
"endpoint" : " /v1/data/methodSearch " ,
"description" : " احضار كل طرق البحث المتاحة " ,
"abstractResponse" : [
{
"key" : " الكلمة المفتاحية " ,
"value" : " القيمة "
}
]
},
{
"endpoint" : " /v1/data/mohdith " ,
"description" : " احضار كل المحدثين المتاحين " ,
"abstractResponse" : [
{
"key" : " الكلمة المفتاحية " ,
"value" : " القيمة "
}
]
},
{
"endpoint" : " /v1/data/rawi " ,
"description" : " احضار كل الرواة المتاحين " ,
"abstractResponse" : [
{
"key" : " الكلمة المفتاحية " ,
"value" : " القيمة "
}
]
},
{
"endpoint" : " /v1/data/zoneSearch " ,
"description" : " احضار كل نطاقات البحث المتاحة " ,
"abstractResponse" : [
{
"key" : " الكلمة المفتاحية " ,
"value" : " القيمة "
}
]
}
]
Open an issue if you encounter a problem or have a suggestion
Of course we welcome any of our contributions ❤