Dar al-Hadith
Loading page…
Dar al-Hadith
Loading page…
Developer platform · v1
Structured access to the collections. Scoped keys, transparent quotas, and privacy-conscious analytics.
Tell us what you are building. Every application is reviewed.
An administrator verifies your request and delivers a key for 90, 180 or 360 days securely.
Send authenticated requests and monitor your own usage.
Set HADITH_API_KEY to your approved key on your server, then list the published collections. Use their IDs to explore books, chapters, and narrations.
Base URL https://daralhadith.net/api/v1
cURL request
curl --request GET 'https://daralhadith.net/api/v1/collections' \
--header "Authorization: Bearer $HADITH_API_KEY" \
--header 'Accept: application/json'Keep keys on your server and send them in the Authorization header. Cross-origin browser API requests are not enabled. Examples below use illustrative IDs and text; replace them with values returned by the API.
Expand an endpoint to see its parameters, copy a request, and choose a success or error response. All paths below are relative to /api/v1.
/access/renewactive keyExtend your API accessAdds 90 days to the authenticated key’s expiry during its final 30 days. No request body is needed. Any active key can renew, regardless of scopes. Expired, revoked and deleted keys are denied. Repeated calls cannot stack extensions outside the renewal window.
No path or query parameters required.
cURL request
curl --request POST 'https://daralhadith.net/api/v1/access/renew' \
--header "Authorization: Bearer $HADITH_API_KEY" \
--header 'Accept: application/json'200 · application/json
{
"data": {
"message": "API access extended by 90 days.",
"expiresAt": "2027-04-01T00:00:00.000Z",
"renewableFrom": "2027-03-02T00:00:00.000Z"
}
}Illustrative JSON showing the response structure. Records, counts, text, dates, and limits are example values.
/collectionscorpus:readList collectionsPublished collections with their book and narration counts. Use the returned IDs in subsequent requests.
No path or query parameters required.
cURL request
curl --request GET 'https://daralhadith.net/api/v1/collections' \
--header "Authorization: Bearer $HADITH_API_KEY" \
--header 'Accept: application/json'200 · application/json
{
"data": [
{
"id": "sample",
"title_en": "Example collection",
"title_ar": "مجموعة نموذجية",
"description": "Example description",
"book_count": 1,
"hadith_count": 1,
"english_hadith_count": 1
}
]
}Illustrative JSON showing the response structure. Records, counts, text, dates, and limits are example values.
/collections/{collectionId}/bookscorpus:readBooks in a collectionCollection details and its ordered topic books. IDs are opaque: use the returned book IDs without reconstructing them.
collectionIdpath · requiredcURL request
curl --request GET 'https://daralhadith.net/api/v1/collections/sample/books' \
--header "Authorization: Bearer $HADITH_API_KEY" \
--header 'Accept: application/json'200 · application/json
{
"data": {
"collection": {
"id": "sample",
"title_en": "Example collection",
"title_ar": "مجموعة نموذجية",
"description": "Example description",
"book_count": 1,
"hadith_count": 1,
"english_hadith_count": 1
},
"books": [
{
"id": "sample-book",
"collection_id": "sample",
"collection_title": "Example collection",
"sequence": 1,
"source_number": 1,
"title_en": "Example book",
"volume_number": 1,
"volume_end_number": 1,
"chapter_count": 1,
"hadith_count": 1
}
]
}
}Illustrative JSON showing the response structure. Records, counts, text, dates, and limits are example values.
/collections/{collectionId}/introductionscorpus:readList introductionsIntroduction and reading-guide summaries, ordered by volume and sequence. A collection without introductions returns an empty array.
collectionIdpath · requiredcURL request
curl --request GET 'https://daralhadith.net/api/v1/collections/sample/introductions' \
--header "Authorization: Bearer $HADITH_API_KEY" \
--header 'Accept: application/json'200 · application/json
{
"data": [
{
"id": "sample-introduction",
"collection_id": "sample",
"collection_title": "Example collection",
"title_en": "Example introduction",
"introduction_kind": "reading_guide",
"author": "Example author",
"sequence": 1
}
]
}Illustrative JSON showing the response structure. Records, counts, text, dates, and limits are example values.
/introductions/{introductionId}corpus:readRead an introductionFull introduction text, attribution, language, and source provenance.
introductionIdpath · requiredcURL request
curl --request GET 'https://daralhadith.net/api/v1/introductions/sample-introduction' \
--header "Authorization: Bearer $HADITH_API_KEY" \
--header 'Accept: application/json'200 · application/json
{
"data": {
"id": "sample-introduction",
"collection_id": "sample",
"collection_title": "Example collection",
"title_en": "Example introduction",
"introduction_kind": "reading_guide",
"author": "Example author",
"sequence": 1,
"text": "[Introduction text]",
"language_code": "en",
"source_path": "sample/source.html",
"source_sha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"source_block_start": 1,
"source_block_end": 2,
"book_id": null
}
}Illustrative JSON showing the response structure. Records, counts, text, dates, and limits are example values.
/books/{bookId}corpus:readRead a book’s chaptersBook details and its ordered chapter summaries, including narration counts and whether an explanation exists.
bookIdpath · requiredcURL request
curl --request GET 'https://daralhadith.net/api/v1/books/sample-book' \
--header "Authorization: Bearer $HADITH_API_KEY" \
--header 'Accept: application/json'200 · application/json
{
"data": {
"book": {
"id": "sample-book",
"collection_id": "sample",
"collection_title": "Example collection",
"sequence": 1,
"source_number": 1,
"title_en": "Example book",
"volume_number": 1,
"volume_end_number": 1,
"chapter_count": 1,
"hadith_count": 1
},
"chapters": [
{
"id": "sample-chapter",
"book_id": "sample-book",
"sequence": 1,
"source_number": 1,
"title_en": "Example chapter",
"hadith_count": 1,
"has_explanation": false
}
]
}
}Illustrative JSON showing the response structure. Records, counts, text, dates, and limits are example values.
/chapters/{chapterId}corpus:readRead a chapter’s narrationsChapter details and a paginated hadith list. Read pagination under data.hadiths. Missing translations or canonical numbers may be null; grading arrays may be empty.
chapterIdpath · requiredpagequery · optionalpageSizequery · optionalcURL request
curl --request GET 'https://daralhadith.net/api/v1/chapters/sample-chapter?page=1&pageSize=25' \
--header "Authorization: Bearer $HADITH_API_KEY" \
--header 'Accept: application/json'200 · application/json
{
"data": {
"chapter": {
"id": "sample-chapter",
"book_id": "sample-book",
"sequence": 1,
"source_number": 1,
"title_en": "Example chapter",
"hadith_count": 1,
"has_explanation": false,
"book_title": "Example book",
"collection_id": "sample",
"collection_title": "Example collection",
"explanation_en": null
},
"hadiths": {
"items": [
{
"id": "sample:1",
"edition_number": 1,
"edition_suffix": "",
"canonical_number": null,
"grade": "",
"grade_attribution": "",
"gradings": [],
"text_en": "[English narration text]",
"text_ar": null,
"text_en_id": "sample:1:en",
"text_ar_id": null
}
],
"page": 1,
"pageSize": 25,
"total": 1,
"pageCount": 1
}
}
}Illustrative JSON showing the response structure. Records, counts, text, dates, and limits are example values.
/hadiths/{hadithId}corpus:readRead a hadithOne narration with language-specific texts, source references, gradings, footnotes, and commentary. Empty arrays mean no entries are recorded for that field.
hadithIdpath · requiredcURL request
curl --request GET 'https://daralhadith.net/api/v1/hadiths/sample%3A1' \
--header "Authorization: Bearer $HADITH_API_KEY" \
--header 'Accept: application/json'200 · application/json
{
"data": {
"id": "sample:1",
"edition_number": 1,
"edition_suffix": "",
"canonical_number": null,
"local_number": 1,
"grade": "",
"grade_attribution": "",
"gradings": [],
"volume_number": 1,
"edition_title": "Example edition",
"edition_publisher": "Example publisher",
"collection_id": "sample",
"collection_title": "Example collection",
"book_id": "sample-book",
"book_title": "Example book",
"chapter_id": "sample-chapter",
"chapter_title": "Example chapter",
"texts": [
{
"id": "sample:1:en",
"language_code": "en",
"script_code": "Latn",
"text": "[English narration text]",
"source_name": "Example source",
"source_url": "https://example.org/source",
"source_id": "sample-source",
"source_page": "1",
"source_record_id": "1"
}
],
"footnotes": [],
"commentaries": []
}
}Illustrative JSON showing the response structure. Records, counts, text, dates, and limits are example values.
/searchsearch:readSearch the librarySearch English or Arabic text, a hadith number, or a reference such as riyad:1. Filter by collection, book, language and hadith number range. Choose word matching and result order. Results are limited to a 10,000-item search window; use the returned page and pageCount.
qquery · optionalcollectionquery · optionalbookquery · optionallanguagequery · optionalmodequery · optionalfromquery · optionaltoquery · optionalsortquery · optionalpagequery · optionalpageSizequery · optionalcURL request
curl --request GET 'https://daralhadith.net/api/v1/search?q=mercy&page=1&pageSize=25' \
--header "Authorization: Bearer $HADITH_API_KEY" \
--header 'Accept: application/json'200 · application/json
{
"data": {
"items": [
{
"id": "sample:1",
"edition_number": 1,
"edition_suffix": "",
"collection_id": "sample",
"collection_title": "Example collection",
"book_title": "Example book",
"chapter_title": "Example chapter",
"language_code": "en",
"excerpt": "[Matching passage]",
"rank": 0.25
}
],
"page": 1,
"pageSize": 25,
"total": 1,
"pageCount": 1
}
}Illustrative JSON showing the response structure. Records, counts, text, dates, and limits are example values.
/analyticsanalytics:readInspect your API usageYour key’s limits and aggregated usage for the last 30 days. Usage is restricted to the authenticated key, and only its prefix is returned.
No path or query parameters required.
cURL request
curl --request GET 'https://daralhadith.net/api/v1/analytics' \
--header "Authorization: Bearer $HADITH_API_KEY" \
--header 'Accept: application/json'200 · application/json
{
"data": {
"key": {
"prefix": "hdk_example",
"scopes": [
"corpus:read",
"search:read",
"analytics:read"
],
"minuteLimit": 60,
"dailyLimit": 1000,
"expiresAt": "2027-01-01T00:00:00.000Z"
},
"usage": [
{
"day": "2026-11-01",
"route": "/api/v1/collections",
"status": 200,
"requests": 12,
"average_ms": 18.5
}
]
}
}Illustrative JSON showing the response structure. Records, counts, text, dates, and limits are example values.
Successful responses wrap their payload in data. Errors contain error.message and error.status. Responses are not cached.
X-RateLimit-Limit is your per-minute limit, not the remaining balance. It is returned after key authorization, along with X-Request-Id. Rate-limited responses include Retry-After; use that delay before retrying.
Chapter and search results include items, page, pageSize, total, and pageCount. Chapter pagination is nested under data.hadiths; search pagination is directly under data. Other list endpoints return unpaginated arrays.
Unpublished or unknown records return 404. An empty list is a valid success response. Treat IDs as opaque strings and retain source attribution when displaying narration text.
Choose 90, 180 or 360 days when applying. During the final 30 days before expiry, an active key can call POST /api/v1/access/renew to add 90 days to its expiry date. The same key remains valid, and another renewal becomes available in its next final 30-day window.
For an expired key or an extension of 180 or 360 days, request an extension. An administrator will review it. Revoked or deleted keys cannot be renewed.
Access is granted after review, not automatically on submission.
Look up aggregate usage for your key. Keys cannot view another developer’s analytics.