Get content resource snapshot
Use this endpoint to fetch a full copy of one public content resource. The API calls this full copy a snapshot.
A snapshot returns all current rows for one resource in records. For example, a translation snapshot returns all current translation rows for that translation resource. A recitation snapshot returns ayah audio file rows and chapter audio file rows.
Typical client flow:
- Call GET /resources/sync.
- If a change has a non-null
snapshot_url, call this endpoint using that change'sresource_groupandresource_id. - Delete existing local rows for that one resource.
- Insert the returned
recordsas the new local copy. - Continue applying later sync changes normally.
Example:
curl "https://apis.quran.foundation/content/api/v4/resources/snapshots/translations/19" \
-H "x-auth-token: $ACCESS_TOKEN" \
-H "x-client-id: $CLIENT_ID"
Snapshots are current at fetch time and are not tied to a specific sync sequence. Snapshot responses are not cacheable and return Cache-Control: no-store.
Path Parameters
Possible values: [articles, recitations, tafsirs, translations]
Public content group. Supported values are articles, recitations, tafsirs, and translations.
Possible values: >= 1
Resource ID within the selected group, such as translation resource 19 or tafsir resource 151.
- 200
- 400
- 401
- 403
- 404
- 422
- 429
- 500
- 502
- 503
- 504
Successful snapshot response
Response Headers
Cache-Control string
Always
no-storefor snapshot responses.
Schema
Possible values: [articles, recitations, tafsirs, translations]
Public content group supported by Content Sync.
Resource ID within the selected group.
Underlying resource content ID when available. It is null for article resources.
Version of the snapshot payload shape.
Current sync sequence when the snapshot was fetched. Snapshots are current-at-fetch, not pinned to the sequence of the change that requested them.
Full current row list for this resource. Replace the client's existing local rows for this resource with this array. Shape depends on resource_group.
{
"resource_group": "translations",
"resource_id": 19,
"resource_content_id": 19,
"schema_version": 1,
"sync_sequence": 98234,
"records": [
{
"id": 85108,
"verse_key": "26:153",
"text": "They said: Thou art but one of the bewitched;"
}
]
}
Translation full copy
{
"resource_group": "translations",
"resource_id": 19,
"resource_content_id": 19,
"schema_version": 1,
"sync_sequence": 98234,
"records": [
{
"id": 85108,
"resource_content_id": 19,
"verse_key": "26:153",
"text": "They said: Thou art but one of the bewitched;",
"foot_notes": []
}
]
}
Tafsir full copy
{
"resource_group": "tafsirs",
"resource_id": 151,
"resource_content_id": 151,
"schema_version": 1,
"sync_sequence": 98234,
"records": [
{
"id": 7,
"resource_content_id": 151,
"verse_key": "1:7",
"text": "Example tafsir text"
}
]
}
Recitation full copy
{
"resource_group": "recitations",
"resource_id": 7,
"resource_content_id": 70,
"schema_version": 1,
"sync_sequence": 98234,
"records": [
{
"record_type": "audio_file",
"id": 1001,
"recitation_id": 7,
"verse_key": "1:1",
"url": "https://example.com/audio/001001.mp3",
"segments": []
},
{
"record_type": "chapter_audio_file",
"id": 2001,
"audio_recitation_id": 30,
"chapter_id": 1,
"audio_url": "https://example.com/audio/001.mp3"
}
]
}
Article full copy
{
"resource_group": "articles",
"resource_id": 123,
"resource_content_id": null,
"schema_version": 1,
"sync_sequence": 98234,
"records": [
{
"article_id": 123,
"language_id": 1,
"lang": "en",
"title": "Example article title",
"text": "Example article body"
}
]
}
Will be returned when the request is invalid e.g. request is missing required headers or with invalid query parameters.
Schema
Possible values: [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": "string",
"type": "gateway_timeout",
"success": true
}
{
"message": "The request is missing required headers or is invalid",
"type": "invalid_request",
"success": false
}
Will be returned when the request is unauthorized.
Schema
Possible values: [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": "string",
"type": "gateway_timeout",
"success": true
}
{
"message": "The request requires user authentication",
"type": "unauthorized",
"success": false
}
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.
Schema
Possible values: [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": "string",
"type": "gateway_timeout",
"success": true
}
{
"message": "The server understood the request, but refuses to authorize it",
"type": "forbidden",
"success": false
}
Resource snapshot is unavailable or not public.
Schema
error object required
Machine-readable Content Sync error code.
Human-readable error message.
{
"error": {
"code": "invalid_resources",
"message": "Invalid resources filter"
}
}
Snapshot is not available
{
"error": {
"code": "snapshot_not_found",
"message": "Resource snapshot not found"
}
}
Invalid snapshot request, such as an unsupported resource group.
Schema
error object required
Machine-readable Content Sync error code.
Human-readable error message.
{
"error": {
"code": "invalid_resources",
"message": "Invalid resources filter"
}
}
Unsupported resource group
{
"error": {
"code": "unknown_resource_group",
"message": "Unknown resource group: unknown"
}
}
Rate-limit exceeded
Schema
Possible values: [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": "string",
"type": "gateway_timeout",
"success": true
}
{
"message": "Too many requests, please try again later",
"type": "rate_limit_exceeded",
"success": false
}
Server Error. Something went wrong, try again later.
Schema
Possible values: [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": "string",
"type": "gateway_timeout",
"success": true
}
{
"message": "The server encountered an internal error and was unable to complete your request",
"type": "internal_server_error",
"success": false
}
Bad Gateway
Schema
Possible values: [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": "string",
"type": "gateway_timeout",
"success": true
}
{
"message": "The server was acting as a gateway or proxy and received an invalid response from the upstream server",
"type": "bad_gateway",
"success": false
}
Service Unavailable
Schema
Possible values: [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": "string",
"type": "gateway_timeout",
"success": true
}
{
"message": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance",
"type": "service_unavailable",
"success": false
}
Gateway Timeout
Schema
Possible values: [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": "string",
"type": "gateway_timeout",
"success": true
}
{
"message": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server",
"type": "gateway_timeout",
"success": false
}