|
Get chapter's audio file of a reciter. Supports `segments` (boolean query param; default `false`). When `segments=true`, verse-level timestamp entries include `segments` ([word_index, start_ms, end_ms]). All time values are milliseconds. |
chapter-reciter-audio-file |
| name |
in |
description |
required |
schema |
reciter_id |
path |
Chapter-reciter ID from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters). Do not use ayah-by-ayah recitation IDs from [/resources/recitations](/docs/content_apis_versioned/recitations) here. |
true |
|
|
| name |
in |
description |
required |
schema |
chapter_number |
path |
The number of the chapter |
true |
| maximum |
minimum |
type |
114 |
1 |
number |
|
|
| name |
in |
required |
schema |
description |
segments |
query |
false |
| type |
default |
boolean |
false |
|
If true, each verse timestamp includes a `segments` array of [word_index, start_ms, end_ms] triplets. Time values are in milliseconds. |
|
|
| 200 |
400 |
401 |
403 |
404 |
422 |
429 |
500 |
502 |
503 |
504 |
| description |
content |
Successful response |
| application/json |
| schema |
examples |
| type |
properties |
required |
title |
object |
| audio_file |
| type |
required |
properties |
title |
object |
id |
chapter_id |
file_size |
format |
audio_url |
|
| id |
chapter_id |
file_size |
format |
audio_url |
timestamps |
|
|
| type |
format |
description |
example |
number |
float |
File size in bytes. |
710784 |
|
|
| type |
format |
example |
string |
uri |
|
|
| type |
description |
items |
array |
Present when timing data is available. If `segments=true`, each item may include a `segments` array. |
| type |
required |
properties |
title |
object |
verse_key |
timestamp_from |
timestamp_to |
duration |
|
| verse_key |
timestamp_from |
timestamp_to |
duration |
segments |
|
| type |
format |
description |
example |
integer |
int32 |
Start offset in milliseconds from the beginning of the file. |
0 |
|
| type |
format |
description |
example |
integer |
int32 |
End offset in milliseconds from the beginning of the file. |
6493 |
|
| type |
format |
description |
example |
integer |
int32 |
Duration in milliseconds (mirrors source data; may be negative in legacy data). |
-6493 |
|
| type |
items |
description |
nullable |
array |
| type |
minItems |
maxItems |
items |
description |
title |
array |
3 |
3 |
| type |
format |
integer |
int32 |
|
[word_index, start_ms, end_ms] triplet. word_index is 1-based. |
SegmentTriplet |
|
Present only when `segments=true`. Word-level timing triplets for the verse. |
true |
|
|
VerseTimestamp |
|
|
|
AudioFile |
|
|
|
ChapterReciterAudioFileResponse |
|
| default_no_segments |
with_segments_true |
| summary |
value |
segments=false (default) |
| audio_file |
| id |
chapter_id |
file_size |
format |
audio_url |
457 |
1 |
710784 |
mp3 |
|
|
|
|
| summary |
value |
segments=true (includes timestamps + segments) |
| audio_file |
| id |
chapter_id |
file_size |
format |
audio_url |
timestamps |
457 |
1 |
710784 |
mp3 |
|
| verse_key |
timestamp_from |
timestamp_to |
duration |
segments |
1:1 |
0 |
6493 |
-6493 |
|
|
| verse_key |
timestamp_from |
timestamp_to |
duration |
segments |
1:2 |
6493 |
11546 |
-5053 |
|
|
| verse_key |
timestamp_from |
timestamp_to |
duration |
segments |
1:3 |
11546 |
15985 |
-4439 |
|
|
| verse_key |
timestamp_from |
timestamp_to |
duration |
segments |
1:4 |
15985 |
21521 |
-5536 |
|
|
| verse_key |
timestamp_from |
timestamp_to |
duration |
segments |
1:5 |
21521 |
27835 |
-6314 |
|
|
| verse_key |
timestamp_from |
timestamp_to |
duration |
segments |
1:6 |
27835 |
33388 |
-5553 |
|
|
| verse_key |
timestamp_from |
timestamp_to |
duration |
segments |
1:7 |
33388 |
53092 |
-19704 |
|
|
|
|
|
|
|
|
|
|
| description |
content |
Will be returned when the request is invalid e.g. request is missing required headers or with invalid query parameters. |
| application/json |
| schema |
example |
| title |
type |
properties |
invalidRequestResponse |
object |
| message |
type |
success |
|
| type |
enum |
string |
gateway_timeout |
service_unavailable |
bad_gateway |
internal_server_error |
unprocessable_entity |
not_found |
forbidden |
unauthorized |
invalid_request |
invalid_token |
insufficient_scope |
service_error |
invalid_path |
rate_limit_exceeded |
|
|
|
|
|
| message |
type |
success |
The request is missing required headers or is invalid |
invalid_request |
false |
|
|
|
|
| description |
content |
Will be returned when the request is unauthorized. |
| application/json |
| schema |
example |
| title |
type |
properties |
unauthorizedResponse |
object |
| message |
type |
success |
|
| type |
enum |
string |
gateway_timeout |
service_unavailable |
bad_gateway |
internal_server_error |
unprocessable_entity |
not_found |
forbidden |
unauthorized |
invalid_request |
invalid_token |
insufficient_scope |
service_error |
invalid_path |
rate_limit_exceeded |
|
|
|
|
|
| message |
type |
success |
The request requires user authentication |
unauthorized |
false |
|
|
|
|
| description |
content |
Forbidden error. Can either be due to access token not being passed, having been expired or the caller trying to access a resource without enough permissions. |
| application/json |
| schema |
example |
| title |
type |
properties |
forbiddenResponse |
object |
| message |
type |
success |
|
| type |
enum |
string |
gateway_timeout |
service_unavailable |
bad_gateway |
internal_server_error |
unprocessable_entity |
not_found |
forbidden |
unauthorized |
invalid_request |
invalid_token |
insufficient_scope |
service_error |
invalid_path |
rate_limit_exceeded |
|
|
|
|
|
| message |
type |
success |
The server understood the request, but refuses to authorize it |
forbidden |
false |
|
|
|
|
| description |
content |
Not Found. The resource being accessed does not exist. |
| application/json |
| schema |
example |
| title |
type |
properties |
notFoundResponse |
object |
| message |
type |
success |
|
| type |
enum |
string |
gateway_timeout |
service_unavailable |
bad_gateway |
internal_server_error |
unprocessable_entity |
not_found |
forbidden |
unauthorized |
invalid_request |
invalid_token |
insufficient_scope |
service_error |
invalid_path |
rate_limit_exceeded |
|
|
|
|
|
| message |
type |
success |
The requested resource could not be found |
not_found |
false |
|
|
|
|
| description |
content |
Validation Error. The request includes one or more invalid params. Please check the request params and try again. |
| application/json |
| schema |
example |
| title |
type |
properties |
unprocessableEntityResponse |
object |
| message |
type |
success |
|
| type |
enum |
string |
gateway_timeout |
service_unavailable |
bad_gateway |
internal_server_error |
unprocessable_entity |
not_found |
forbidden |
unauthorized |
invalid_request |
invalid_token |
insufficient_scope |
service_error |
invalid_path |
rate_limit_exceeded |
|
|
|
|
|
| message |
type |
success |
The request was well-formed but was unable to be followed due to semantic errors |
unprocessable_entity |
false |
|
|
|
|
| description |
content |
Rate-limit exceeded |
| application/json |
| schema |
example |
| title |
type |
properties |
rateLimitExceededResponse |
object |
| message |
type |
success |
|
| type |
enum |
string |
gateway_timeout |
service_unavailable |
bad_gateway |
internal_server_error |
unprocessable_entity |
not_found |
forbidden |
unauthorized |
invalid_request |
invalid_token |
insufficient_scope |
service_error |
invalid_path |
rate_limit_exceeded |
|
|
|
|
|
| message |
type |
success |
Too many requests, please try again later |
rate_limit_exceeded |
false |
|
|
|
|
| description |
content |
Server Error. Something went wrong, try again later. |
| application/json |
| schema |
example |
| title |
type |
properties |
internalServerErrorResponse |
object |
| message |
type |
success |
|
| type |
enum |
string |
gateway_timeout |
service_unavailable |
bad_gateway |
internal_server_error |
unprocessable_entity |
not_found |
forbidden |
unauthorized |
invalid_request |
invalid_token |
insufficient_scope |
service_error |
invalid_path |
rate_limit_exceeded |
|
|
|
|
|
| message |
type |
success |
The server encountered an internal error and was unable to complete your request |
internal_server_error |
false |
|
|
|
|
| description |
content |
Bad Gateway |
| application/json |
| schema |
example |
| title |
type |
properties |
badGatewayResponse |
object |
| message |
type |
success |
|
| type |
enum |
string |
gateway_timeout |
service_unavailable |
bad_gateway |
internal_server_error |
unprocessable_entity |
not_found |
forbidden |
unauthorized |
invalid_request |
invalid_token |
insufficient_scope |
service_error |
invalid_path |
rate_limit_exceeded |
|
|
|
|
|
| message |
type |
success |
The server was acting as a gateway or proxy and received an invalid response from the upstream server |
bad_gateway |
false |
|
|
|
|
| description |
content |
Service Unavailable |
| application/json |
| schema |
example |
| title |
type |
properties |
serviceUnavailableResponse |
object |
| message |
type |
success |
|
| type |
enum |
string |
gateway_timeout |
service_unavailable |
bad_gateway |
internal_server_error |
unprocessable_entity |
not_found |
forbidden |
unauthorized |
invalid_request |
invalid_token |
insufficient_scope |
service_error |
invalid_path |
rate_limit_exceeded |
|
|
|
|
|
| message |
type |
success |
The server is currently unable to handle the request due to a temporary overload or scheduled maintenance |
service_unavailable |
false |
|
|
|
|
| description |
content |
Gateway Timeout |
| application/json |
| schema |
example |
| title |
type |
properties |
gatewayTimeoutResponse |
object |
| message |
type |
success |
|
| type |
enum |
string |
gateway_timeout |
service_unavailable |
bad_gateway |
internal_server_error |
unprocessable_entity |
not_found |
forbidden |
unauthorized |
invalid_request |
invalid_token |
insufficient_scope |
service_error |
invalid_path |
rate_limit_exceeded |
|
|
|
|
|
| message |
type |
success |
The server was acting as a gateway or proxy and did not receive a timely response from the upstream server |
gateway_timeout |
false |
|
|
|
|
|
get |
/chapter_recitations/{reciter_id}/{chapter_number} |
| url |
description |
|
Pre-production Server |
|
| url |
description |
|
Production Server |
|
|
|
| x-auth-token |
x-client-id |
| type |
description |
name |
in |
apiKey |
The access token required for accessing the endpoints. |
x-auth-token |
header |
|
| type |
description |
name |
in |
apiKey |
Your client Id |
x-client-id |
header |
|
|
| title |
description |
version |
Content APIs |
Quran.Foundation Content APIs offer programmatic access to the Quran's core content like chapters, verses, recitations, translations, and more, distinct from user-specific data like notes and bookmarks provided by [User-related APIs](/docs/category/user-related-apis).
:::important Integrity of Translations
Please **disable any automatic browser-translation features** (e.g. Google-Translate-in-Chrome) when displaying text returned by the *Translations* endpoints.
Re-translating an already vetted Quranic translation can introduce serious semantic errors.
:::
## How to get access
We are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Since the APIs are not user-related, you will need to use the `client_credentials` grant type and [`content` scope](/docs/user_related_apis_versioned/scopes#content) when sending a request to [The OAuth 2.0 Token Endpoint](/docs/oauth2_apis_versioned/oauth-2-token-exchange) to get the access token.
```mermaid
sequenceDiagram
participant App as Your App
participant Auth as Quran.Foundation<br/>Authorization Server
participant API as Quran.Foundation<br/>Resources Server
App->>Auth: Request Token with Client Credentials
Auth-->>App: Token Response (access_token)
App->>API: Use token to call API
API-->>App: Requested resource
Note over App,Auth: Access token expires (1 hour)
App->>Auth: Re-issue access_token using client_credentials
Auth-->>App: New access_token
```
After getting a valid access token, each request to get resources will have to include 2 headers mentioned below: `x-auth-token` and `x-client-id`. This spec also includes a small subset of Quran Reflect post-read endpoints that are compatible with the `client_credentials` grant. These operations still require `x-auth-token` and `x-client-id`, but they do not use the `content` scope. Use `post.read` for `/quran-reflect/v1/posts/feed`, `/quran-reflect/v1/posts/{id}`, and `/quran-reflect/v1/posts/user-posts/{id}`. Use `comment.read` for `/quran-reflect/v1/posts/{id}/comments` and `/quran-reflect/v1/posts/{id}/all-comments`. These are Quran Reflect gateway endpoints, not `/content/api/v4/...` endpoints. |
v4 |
|
| name |
description |
url |
header |
method |
Get chapter's audio file of a reciter |
| content |
type |
Get chapter's audio file of a reciter. Supports `segments` (boolean query param; default `false`). When `segments=true`, verse-level timestamp entries include `segments` ([word_index, start_ms, end_ms]). All time values are milliseconds. |
text/plain |
|
| path |
host |
query |
variable |
chapter_recitations |
:reciter_id |
:chapter_number |
|
|
| disabled |
description |
key |
value |
false |
| content |
type |
If true, each verse timestamp includes a `segments` array of [word_index, start_ms, end_ms] triplets. Time values are in milliseconds. |
text/plain |
|
segments |
|
|
|
| disabled |
description |
type |
value |
key |
false |
| content |
type |
(Required) Chapter-reciter ID from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters). Do not use ayah-by-ayah recitation IDs from [/resources/recitations](/docs/content_apis_versioned/recitations) here. |
text/plain |
|
any |
|
reciter_id |
|
| disabled |
description |
type |
value |
key |
false |
| content |
type |
(Required) The number of the chapter |
text/plain |
|
any |
|
chapter_number |
|
|
|
| key |
value |
Accept |
application/json |
|
|
GET |
|