{
  "openapi": "3.0.1",
  "info": {
    "title": "Content APIs",
    "description": "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).\n\n:::important Integrity of Translations\nPlease **disable any automatic browser-translation features** (e.g. Google-Translate-in-Chrome) when displaying text returned by the *Translations* endpoints.  \nRe-translating an already vetted Quranic translation can introduce serious semantic errors.\n:::\n\n ## How to get access \n\n 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. \n\n```mermaid\nsequenceDiagram\n    participant App as Your App\n    participant Auth as Quran.Foundation<br/>Authorization Server\n    participant API as Quran.Foundation<br/>Resources Server\n\n    App->>Auth: Request Token with Client Credentials\n    Auth-->>App: Token Response (access_token)\n    App->>API: Use token to call API\n    API-->>App: Requested resource\n\n    Note over App,Auth: Access token expires (1 hour)\n\n    App->>Auth: Re-issue access_token using client_credentials\n    Auth-->>App: New access_token\n```\n\n 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.",
    "version": "v4"
  },
  "servers": [
    {
      "url": "https://apis-prelive.quran.foundation/content/api/v4",
      "description": "Pre-production Server"
    },
    {
      "url": "https://apis.quran.foundation/content/api/v4",
      "description": "Production Server"
    }
  ],
  "security": [
    {
      "x-auth-token": [],
      "x-client-id": []
    }
  ],
  "paths": {
    "/audio/reciters/{reciter_id}/timestamp": {
      "get": {
        "tags": ["Audio"],
        "summary": "Get timestamp range",
        "description": "Find the timestamp range for a reciter's audio. Provide a `chapter_number` to get the full chapter range, or a `verse_key`/`verse_id` to scope to a verse. Use `word` or (`word_from`,`word_to`) to narrow to word timings. All time values are milliseconds.",
        "operationId": "audio-reciter-timestamp",
        "parameters": [
          {
            "name": "reciter_id",
            "in": "path",
            "description": "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.",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "chapter_number",
            "in": "query",
            "description": "Chapter number (1 - 114). Required unless you provide `verse_key` or `verse_id`.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 114
            }
          },
          {
            "name": "verse_key",
            "in": "query",
            "description": "Verse key (e.g., 2:255). If provided, returns the verse timing range.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "verse_id",
            "in": "query",
            "description": "Verse id. If provided, returns the verse timing range.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "word",
            "in": "query",
            "description": "1-based word index within the verse. Only applies when a verse is selected.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "word_from",
            "in": "query",
            "description": "1-based start word index within the verse. Use with `word_to`.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "word_to",
            "in": "query",
            "description": "1-based end word index within the verse. Use with `word_from`.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {
                      "type": "object",
                      "properties": {
                        "timestamp_from": {
                          "type": "integer",
                          "format": "int32",
                          "description": "Start offset in milliseconds from the beginning of the file."
                        },
                        "timestamp_to": {
                          "type": "integer",
                          "format": "int32",
                          "description": "End offset in milliseconds from the beginning of the file."
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "result": {
                        "timestamp_from": 0,
                        "timestamp_to": 6493
                      }
                    }
                  },
                  "ayah_timestamp_range": {
                    "summary": "Timestamp range for one ayah",
                    "value": {
                      "result": {
                        "timestamp_from": 0,
                        "timestamp_to": 6493
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get timestamp range\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(reciter_id, options = {}) {\n  const response = await axios.get(\n    `${API_BASE_URL}/audio/reciters/${reciter_id}/timestamp`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      },\n      params: options\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(\"7\", {\"chapter_number\":\"1\",\"verse_key\":\"2:255\",\"verse_id\":\"262\"})\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get timestamp range\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(reciter_id, chapter_number=None, verse_key=None, verse_id=None):\n    params = {k: v for k, v in {'chapter_number': chapter_number, 'verse_key': verse_key, 'verse_id': verse_id}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/audio/reciters/{reciter_id}/timestamp',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(\"7\", chapter_number=\"1\", verse_key=\"2:255\", verse_id=\"262\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get timestamp range\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(reciter_id string, params map[string]string) (string, error) {\n  path := fmt.Sprintf(\"/audio/reciters/%s/timestamp\", reciter_id)\n  endpoint := API_BASE_URL + path\n  if params != nil && len(params) > 0 {\n    values := url.Values{}\n    for k, v := range params {\n      values.Set(k, v)\n    }\n    endpoint = endpoint + \"?\" + values.Encode()\n  }\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  params := map[string]string{\"chapter_number\": \"1\", \"verse_key\": \"2:255\", \"verse_id\": \"262\"}\n  data, err := callApi(\"7\", params)\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get timestamp range\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(reciter_id, params = {})\n  path = \"/audio/reciters/#{reciter_id}/timestamp\"\n  uri = URI(API_BASE_URL + path)\n  uri.query = URI.encode_www_form(params) if params && !params.empty?\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\nparams = { \"chapter_number\" => \"1\", \"verse_key\" => \"2:255\", \"verse_id\" => \"262\" }\ndata = call_api(\"7\", params)\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get timestamp range\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string reciter_id, Dictionary<string, string> query = null)\n{\n    var path = $@\"/audio/reciters/{reciter_id}/timestamp\";\n    var url = API_BASE_URL + path;\n    if (query != null && query.Count > 0)\n    {\n        var queryString = string.Join(\"&\", query.Select(kvp =>\n            $\"{Uri.EscapeDataString(kvp.Key)}={Uri.EscapeDataString(kvp.Value)}\"));\n        url = $\"{url}?{queryString}\";\n    }\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar query = new Dictionary<string, string> { {\"chapter_number\", \"1\"}, {\"verse_key\", \"2:255\"}, {\"verse_id\", \"262\"} };\nvar data = await CallApiAsync(\"7\", query);\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get timestamp range\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($reciter_id, $params = []) {\n  $path = sprintf(\"/audio/reciters/%s/timestamp\", $reciter_id);\n  $url = API_BASE_URL . $path;\n  if (!empty($params)) {\n    $url .= '?' . http_build_query($params);\n  }\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$params = ['chapter_number' => '1', 'verse_key' => '2:255', 'verse_id' => '262'];\n$data = callApi(\"7\", $params);\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get timestamp range\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String reciter_id, Map<String, String> params) throws IOException {\n    String path = String.format(\"/audio/reciters/%s/timestamp\", reciter_id);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    if (params != null) {\n      for (Map.Entry<String, String> entry : params.entrySet()) {\n        urlBuilder.addQueryParameter(entry.getKey(), entry.getValue());\n      }\n    }\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    Map<String, String> params = new HashMap<>();\n    params.put(\"chapter_number\", \"1\");\n    params.put(\"verse_key\", \"2:255\");\n    params.put(\"verse_id\", \"262\");\n    String data = callApi(\"7\", params);\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get timestamp range\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$reciter_id, [hashtable]$params = @{}) {\n  $path = \"/audio/reciters/$reciter_id/timestamp\"\n  $url = \"$API_BASE_URL$path\"\n  if ($params.Count -gt 0) {\n    $query = ($params.GetEnumerator() | ForEach-Object {\n      \"$($_.Key)=$([System.Uri]::EscapeDataString([string]$_.Value))\"\n    }) -join \"&\"\n    $url = \"$url?$query\"\n  }\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$params = @{ chapter_number = \"1\"; verse_key = \"2:255\"; verse_id = \"262\" }\n$data = Call-Api(\"7\", $params)\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get timestamp range\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/audio/reciters/7/timestamp?chapter_number=1&verse_key=2%3A255&verse_id=262' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get timestamp range using the Quran Foundation API.\n\nEndpoint: GET /audio/reciters/{reciter_id}/timestamp\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  reciter_id: 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. (e.g., \"7\")\nOptional Query Parameters:\n  chapter_number: Chapter number (1 - 114). Required unless you provide `verse_key` or `verse_id`.\n  verse_key: Verse key (e.g., 2:255). If provided, returns the verse timing range.\n  verse_id: Verse id. If provided, returns the verse timing range.\n  word: 1-based word index within the verse. Only applies when a verse is selected.\n  word_from: 1-based start word index within the verse. Use with `word_to`.\n  word_to: 1-based end word index within the verse. Use with `word_from`.\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/audio/reciters/{reciter_id}/timestamp?{queryParams}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts reciter_id and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/audio/reciters/{reciter_id}/lookup": {
      "get": {
        "tags": ["Audio"],
        "summary": "Lookup verse by timestamp",
        "description": "Find the closest verse timing segment for a reciter and chapter at the given timestamp. All time values are milliseconds.",
        "operationId": "audio-reciter-lookup",
        "parameters": [
          {
            "name": "reciter_id",
            "in": "path",
            "description": "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.",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "chapter_number",
            "in": "query",
            "description": "Chapter number (1 - 114). Required unless you provide `verse_key` or `verse_id`.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 114
            }
          },
          {
            "name": "verse_key",
            "in": "query",
            "description": "Verse key (e.g., 2:255). Used only to derive the chapter when `chapter_number` is omitted.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "verse_id",
            "in": "query",
            "description": "Verse id. Used only to derive the chapter when `chapter_number` is omitted.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "timestamp",
            "in": "query",
            "description": "Timestamp in milliseconds to look up.",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "segments",
            "in": "query",
            "description": "If true, include word-level timing segments for the verse.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {
                      "type": "object",
                      "properties": {
                        "verse_key": {
                          "type": "string"
                        },
                        "timestamp_from": {
                          "type": "integer",
                          "format": "int32",
                          "description": "Start offset in milliseconds from the beginning of the file."
                        },
                        "timestamp_to": {
                          "type": "integer",
                          "format": "int32",
                          "description": "End offset in milliseconds from the beginning of the file."
                        },
                        "duration": {
                          "type": "integer",
                          "format": "int32",
                          "description": "Duration in milliseconds (mirrors source data; may be negative in legacy data)."
                        },
                        "segments": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/SegmentTriplet"
                          },
                          "description": "Present only when `segments=true`. Word-level timing triplets for the verse.",
                          "nullable": true
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "result": {
                        "verse_key": "1:1",
                        "timestamp_from": 0,
                        "timestamp_to": 6493,
                        "duration": -6493,
                        "segments": [
                          [1, 0, 630],
                          [2, 650, 1570]
                        ]
                      }
                    }
                  },
                  "timestamp_lookup_with_segments": {
                    "summary": "Lookup timestamp with word segments",
                    "value": {
                      "result": {
                        "verse_key": "1:1",
                        "timestamp_from": 0,
                        "timestamp_to": 6493,
                        "duration": -6493,
                        "segments": [
                          [1, 0, 630],
                          [2, 650, 1570]
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Lookup verse by timestamp\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(reciter_id, options = {}) {\n  const response = await axios.get(\n    `${API_BASE_URL}/audio/reciters/${reciter_id}/lookup`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      },\n      params: options\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(\"7\", {\"chapter_number\":\"1\",\"verse_key\":\"2:255\",\"verse_id\":\"262\"})\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Lookup verse by timestamp\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(reciter_id, chapter_number=None, verse_key=None, verse_id=None):\n    params = {k: v for k, v in {'chapter_number': chapter_number, 'verse_key': verse_key, 'verse_id': verse_id}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/audio/reciters/{reciter_id}/lookup',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(\"7\", chapter_number=\"1\", verse_key=\"2:255\", verse_id=\"262\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Lookup verse by timestamp\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(reciter_id string, params map[string]string) (string, error) {\n  path := fmt.Sprintf(\"/audio/reciters/%s/lookup\", reciter_id)\n  endpoint := API_BASE_URL + path\n  if params != nil && len(params) > 0 {\n    values := url.Values{}\n    for k, v := range params {\n      values.Set(k, v)\n    }\n    endpoint = endpoint + \"?\" + values.Encode()\n  }\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  params := map[string]string{\"chapter_number\": \"1\", \"verse_key\": \"2:255\", \"verse_id\": \"262\"}\n  data, err := callApi(\"7\", params)\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Lookup verse by timestamp\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(reciter_id, params = {})\n  path = \"/audio/reciters/#{reciter_id}/lookup\"\n  uri = URI(API_BASE_URL + path)\n  uri.query = URI.encode_www_form(params) if params && !params.empty?\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\nparams = { \"chapter_number\" => \"1\", \"verse_key\" => \"2:255\", \"verse_id\" => \"262\" }\ndata = call_api(\"7\", params)\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Lookup verse by timestamp\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string reciter_id, Dictionary<string, string> query = null)\n{\n    var path = $@\"/audio/reciters/{reciter_id}/lookup\";\n    var url = API_BASE_URL + path;\n    if (query != null && query.Count > 0)\n    {\n        var queryString = string.Join(\"&\", query.Select(kvp =>\n            $\"{Uri.EscapeDataString(kvp.Key)}={Uri.EscapeDataString(kvp.Value)}\"));\n        url = $\"{url}?{queryString}\";\n    }\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar query = new Dictionary<string, string> { {\"chapter_number\", \"1\"}, {\"verse_key\", \"2:255\"}, {\"verse_id\", \"262\"} };\nvar data = await CallApiAsync(\"7\", query);\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Lookup verse by timestamp\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($reciter_id, $params = []) {\n  $path = sprintf(\"/audio/reciters/%s/lookup\", $reciter_id);\n  $url = API_BASE_URL . $path;\n  if (!empty($params)) {\n    $url .= '?' . http_build_query($params);\n  }\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$params = ['chapter_number' => '1', 'verse_key' => '2:255', 'verse_id' => '262'];\n$data = callApi(\"7\", $params);\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Lookup verse by timestamp\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String reciter_id, Map<String, String> params) throws IOException {\n    String path = String.format(\"/audio/reciters/%s/lookup\", reciter_id);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    if (params != null) {\n      for (Map.Entry<String, String> entry : params.entrySet()) {\n        urlBuilder.addQueryParameter(entry.getKey(), entry.getValue());\n      }\n    }\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    Map<String, String> params = new HashMap<>();\n    params.put(\"chapter_number\", \"1\");\n    params.put(\"verse_key\", \"2:255\");\n    params.put(\"verse_id\", \"262\");\n    String data = callApi(\"7\", params);\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Lookup verse by timestamp\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$reciter_id, [hashtable]$params = @{}) {\n  $path = \"/audio/reciters/$reciter_id/lookup\"\n  $url = \"$API_BASE_URL$path\"\n  if ($params.Count -gt 0) {\n    $query = ($params.GetEnumerator() | ForEach-Object {\n      \"$($_.Key)=$([System.Uri]::EscapeDataString([string]$_.Value))\"\n    }) -join \"&\"\n    $url = \"$url?$query\"\n  }\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$params = @{ chapter_number = \"1\"; verse_key = \"2:255\"; verse_id = \"262\" }\n$data = Call-Api(\"7\", $params)\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Lookup verse by timestamp\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/audio/reciters/7/lookup?chapter_number=1&verse_key=2%3A255&verse_id=262' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to lookup verse by timestamp using the Quran Foundation API.\n\nEndpoint: GET /audio/reciters/{reciter_id}/lookup\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  reciter_id: 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. (e.g., \"7\")\nOptional Query Parameters:\n  chapter_number: Chapter number (1 - 114). Required unless you provide `verse_key` or `verse_id`.\n  verse_key: Verse key (e.g., 2:255). Used only to derive the chapter when `chapter_number` is omitted.\n  verse_id: Verse id. Used only to derive the chapter when `chapter_number` is omitted.\n  timestamp: Timestamp in milliseconds to look up.\n  segments: If true, include word-level timing segments for the verse.\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/audio/reciters/{reciter_id}/lookup?{queryParams}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts reciter_id and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/chapters": {
      "get": {
        "tags": ["Chapters"],
        "summary": "List Chapters",
        "description": "Get list of Chapter. When a `language` query parameter is supplied the translated chapter names are looked up in that language, and if not available the lookup automatically falls back to the default English translations.",
        "operationId": "list-chapters",
        "parameters": [
          {
            "name": "language",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "en"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["chapters"],
                  "properties": {
                    "chapters": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/chapter"
                      }
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "chapters": [
                        {
                          "id": 1,
                          "revelation_place": "makkah",
                          "revelation_order": 5,
                          "bismillah_pre": false,
                          "name_simple": "Al-Fatihah",
                          "name_complex": "Al-Fātiĥah",
                          "name_arabic": "الفاتحة",
                          "verses_count": 7,
                          "pages": [1, 1],
                          "translated_name": {
                            "language_name": "english",
                            "name": "The Opener"
                          }
                        }
                      ]
                    }
                  },
                  "english_catalog": {
                    "summary": "English chapter catalog",
                    "value": {
                      "chapters": [
                        {
                          "id": 1,
                          "revelation_place": "makkah",
                          "revelation_order": 5,
                          "bismillah_pre": false,
                          "name_simple": "Al-Fatihah",
                          "name_complex": "Al-Fātiĥah",
                          "name_arabic": "الفاتحة",
                          "verses_count": 7,
                          "pages": [1, 1],
                          "translated_name": {
                            "language_name": "english",
                            "name": "The Opener"
                          }
                        },
                        {
                          "id": 2,
                          "revelation_place": "madinah",
                          "revelation_order": 87,
                          "bismillah_pre": true,
                          "name_simple": "Al-Baqarah",
                          "name_complex": "Al-Baqarah",
                          "name_arabic": "البقرة",
                          "verses_count": 286,
                          "pages": [2, 49],
                          "translated_name": {
                            "language_name": "english",
                            "name": "The Cow"
                          }
                        }
                      ]
                    }
                  },
                  "arabic_translated_names": {
                    "summary": "Arabic localized chapter names",
                    "value": {
                      "chapters": [
                        {
                          "id": 1,
                          "revelation_place": "makkah",
                          "revelation_order": 5,
                          "bismillah_pre": false,
                          "name_simple": "Al-Fatihah",
                          "name_complex": "Al-Fātiĥah",
                          "name_arabic": "الفاتحة",
                          "verses_count": 7,
                          "pages": [1, 1],
                          "translated_name": {
                            "language_name": "arabic",
                            "name": "الفاتحة"
                          }
                        },
                        {
                          "id": 2,
                          "revelation_place": "madinah",
                          "revelation_order": 87,
                          "bismillah_pre": true,
                          "name_simple": "Al-Baqarah",
                          "name_complex": "Al-Baqarah",
                          "name_arabic": "البقرة",
                          "verses_count": 286,
                          "pages": [2, 49],
                          "translated_name": {
                            "language_name": "arabic",
                            "name": "البقرة"
                          }
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// List Chapters\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(options = {}) {\n  const response = await axios.get(\n    `${API_BASE_URL}/chapters`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      },\n      params: options\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi({\"language\":\"en\"})\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# List Chapters\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(language=None):\n    params = {k: v for k, v in {'language': language}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/chapters',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(language=\"en\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// List Chapters\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(params map[string]string) (string, error) {\n  path := \"/chapters\"\n  endpoint := API_BASE_URL + path\n  if params != nil && len(params) > 0 {\n    values := url.Values{}\n    for k, v := range params {\n      values.Set(k, v)\n    }\n    endpoint = endpoint + \"?\" + values.Encode()\n  }\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  params := map[string]string{\"language\": \"en\"}\n  data, err := callApi(params)\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# List Chapters\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(params = {})\n  path = \"/chapters\"\n  uri = URI(API_BASE_URL + path)\n  uri.query = URI.encode_www_form(params) if params && !params.empty?\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\nparams = { \"language\" => \"en\" }\ndata = call_api(params)\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// List Chapters\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(Dictionary<string, string> query = null)\n{\n    var path = $@\"/chapters\";\n    var url = API_BASE_URL + path;\n    if (query != null && query.Count > 0)\n    {\n        var queryString = string.Join(\"&\", query.Select(kvp =>\n            $\"{Uri.EscapeDataString(kvp.Key)}={Uri.EscapeDataString(kvp.Value)}\"));\n        url = $\"{url}?{queryString}\";\n    }\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar query = new Dictionary<string, string> { {\"language\", \"en\"} };\nvar data = await CallApiAsync(query);\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# List Chapters\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($params = []) {\n  $path = \"/chapters\";\n  $url = API_BASE_URL . $path;\n  if (!empty($params)) {\n    $url .= '?' . http_build_query($params);\n  }\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$params = ['language' => 'en'];\n$data = callApi($params);\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// List Chapters\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(Map<String, String> params) throws IOException {\n    String path = \"/chapters\";\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    if (params != null) {\n      for (Map.Entry<String, String> entry : params.entrySet()) {\n        urlBuilder.addQueryParameter(entry.getKey(), entry.getValue());\n      }\n    }\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    Map<String, String> params = new HashMap<>();\n    params.put(\"language\", \"en\");\n    String data = callApi(params);\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# List Chapters\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([hashtable]$params = @{}) {\n  $path = \"/chapters\"\n  $url = \"$API_BASE_URL$path\"\n  if ($params.Count -gt 0) {\n    $query = ($params.GetEnumerator() | ForEach-Object {\n      \"$($_.Key)=$([System.Uri]::EscapeDataString([string]$_.Value))\"\n    }) -join \"&\"\n    $url = \"$url?$query\"\n  }\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$params = @{ language = \"en\" }\n$data = Call-Api($params)\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# List Chapters\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/chapters?language=en' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to list chapters using the Quran Foundation API.\n\nEndpoint: GET /chapters\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nOptional Query Parameters:\n  language: Optional parameter\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/chapters?{queryParams}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/chapters/{id}": {
      "get": {
        "tags": ["Chapters"],
        "summary": "Get Chapter",
        "description": "Get details of a single Chapter.",
        "operationId": "GET-chapter",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Chapter ID ( 1-114)",
            "required": true,
            "schema": {
              "maximum": 114,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "language",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "en"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "chapter": {
                      "$ref": "#/components/schemas/chapter"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "chapter": {
                        "id": 1,
                        "revelation_place": "makkah",
                        "revelation_order": 5,
                        "bismillah_pre": false,
                        "name_simple": "Al-Fatihah",
                        "name_complex": "Al-Fātiĥah",
                        "name_arabic": "الفاتحة",
                        "verses_count": 7,
                        "pages": [1, 1],
                        "translated_name": {
                          "language_name": "english",
                          "name": "The Opener"
                        }
                      }
                    }
                  },
                  "makkah_chapter": {
                    "summary": "Makkah chapter",
                    "value": {
                      "chapter": {
                        "id": 1,
                        "revelation_place": "makkah",
                        "revelation_order": 5,
                        "bismillah_pre": false,
                        "name_simple": "Al-Fatihah",
                        "name_complex": "Al-Fātiĥah",
                        "name_arabic": "الفاتحة",
                        "verses_count": 7,
                        "pages": [1, 1],
                        "translated_name": {
                          "language_name": "english",
                          "name": "The Opener"
                        }
                      }
                    }
                  },
                  "madinah_chapter": {
                    "summary": "Madinah chapter",
                    "value": {
                      "chapter": {
                        "id": 2,
                        "revelation_place": "madinah",
                        "revelation_order": 87,
                        "bismillah_pre": true,
                        "name_simple": "Al-Baqarah",
                        "name_complex": "Al-Baqarah",
                        "name_arabic": "البقرة",
                        "verses_count": 286,
                        "pages": [2, 49],
                        "translated_name": {
                          "language_name": "english",
                          "name": "The Cow"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get Chapter\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(id, options = {}) {\n  const response = await axios.get(\n    `${API_BASE_URL}/chapters/${id}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      },\n      params: options\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(\"1\", {\"language\":\"en\"})\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get Chapter\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(id, language=None):\n    params = {k: v for k, v in {'language': language}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/chapters/{id}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(\"1\", language=\"en\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get Chapter\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(id string, params map[string]string) (string, error) {\n  path := fmt.Sprintf(\"/chapters/%s\", id)\n  endpoint := API_BASE_URL + path\n  if params != nil && len(params) > 0 {\n    values := url.Values{}\n    for k, v := range params {\n      values.Set(k, v)\n    }\n    endpoint = endpoint + \"?\" + values.Encode()\n  }\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  params := map[string]string{\"language\": \"en\"}\n  data, err := callApi(\"1\", params)\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get Chapter\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(id, params = {})\n  path = \"/chapters/#{id}\"\n  uri = URI(API_BASE_URL + path)\n  uri.query = URI.encode_www_form(params) if params && !params.empty?\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\nparams = { \"language\" => \"en\" }\ndata = call_api(\"1\", params)\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get Chapter\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string id, Dictionary<string, string> query = null)\n{\n    var path = $@\"/chapters/{id}\";\n    var url = API_BASE_URL + path;\n    if (query != null && query.Count > 0)\n    {\n        var queryString = string.Join(\"&\", query.Select(kvp =>\n            $\"{Uri.EscapeDataString(kvp.Key)}={Uri.EscapeDataString(kvp.Value)}\"));\n        url = $\"{url}?{queryString}\";\n    }\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar query = new Dictionary<string, string> { {\"language\", \"en\"} };\nvar data = await CallApiAsync(\"1\", query);\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get Chapter\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($id, $params = []) {\n  $path = sprintf(\"/chapters/%s\", $id);\n  $url = API_BASE_URL . $path;\n  if (!empty($params)) {\n    $url .= '?' . http_build_query($params);\n  }\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$params = ['language' => 'en'];\n$data = callApi(\"1\", $params);\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get Chapter\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String id, Map<String, String> params) throws IOException {\n    String path = String.format(\"/chapters/%s\", id);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    if (params != null) {\n      for (Map.Entry<String, String> entry : params.entrySet()) {\n        urlBuilder.addQueryParameter(entry.getKey(), entry.getValue());\n      }\n    }\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    Map<String, String> params = new HashMap<>();\n    params.put(\"language\", \"en\");\n    String data = callApi(\"1\", params);\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get Chapter\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$id, [hashtable]$params = @{}) {\n  $path = \"/chapters/$id\"\n  $url = \"$API_BASE_URL$path\"\n  if ($params.Count -gt 0) {\n    $query = ($params.GetEnumerator() | ForEach-Object {\n      \"$($_.Key)=$([System.Uri]::EscapeDataString([string]$_.Value))\"\n    }) -join \"&\"\n    $url = \"$url?$query\"\n  }\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$params = @{ language = \"en\" }\n$data = Call-Api(\"1\", $params)\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get Chapter\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/chapters/1?language=en' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get chapter using the Quran Foundation API.\n\nEndpoint: GET /chapters/{id}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  id: Chapter ID ( 1-114) (e.g., \"1\")\nOptional Query Parameters:\n  language: Optional parameter\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/chapters/{id}?{queryParams}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts id and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/chapters/{id}/info": {
      "get": {
        "tags": ["Chapters"],
        "summary": "Get Chapter Info",
        "description": "Get Chapter Info in specific language. Default to `English`. Supports selecting a specific resource via `resource_id` and listing available resources via `include_resources=true`. Use `include_resources=true` to discover the resource ids or slugs that actually have chapter-info content for the resolved chapter and language. The [`/resources/chapter_infos`](/docs/content_apis_versioned/chapter-info) endpoint is a global catalog of chapter-info resources and may include resources that return `chapter_info: null` for a specific chapter.",
        "operationId": "get-chapter-info",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Chapter number (1-114)",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 114
            }
          },
          {
            "name": "language",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "en"
            },
            "description": "Language ISO code for translated metadata. Defaults to English."
          },
          {
            "name": "locale",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Locale fallback if a language code is not provided."
          },
          {
            "name": "resource_id",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Resource id or slug of the chapter info resource to fetch. Prefer identifiers returned by `include_resources=true` for the current chapter. The [`/resources/chapter_infos`](/docs/content_apis_versioned/chapter-info) endpoint is a global catalog and may include resources that do not have chapter-info content for this specific chapter, which would return `chapter_info: null`."
          },
          {
            "name": "include_resources",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "false",
              "enum": ["true", "false"]
            },
            "description": "Include the ordered list of available chapter info resources that actually have content for the resolved chapter and language. This is the safest discovery path for the id or slug to pass as `resource_id` for a specific author such as Ibn Ashur."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "chapter_info": {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/chapter-info"
                        }
                      ],
                      "nullable": true,
                      "description": "Resolved chapter info resource. Returns `null` when the requested `resource_id` does not match an approved chapter info resource for the resolved chapter and language, or when the selected resource has no chapter-info content for that chapter after language resolution."
                    },
                    "resources": {
                      "description": "Only returned when `include_resources=true`. Contains approved chapter info resources that have chapter-info content for the resolved chapter and language, ordered by the API's preferred resource order for selection.",
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/resource"
                      }
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "chapter_info": {
                        "id": 1,
                        "chapter_id": 1,
                        "language_name": "english",
                        "short_text": "This Surah is named Al-Fatihah because of its subject-matter. Fatihah is that which opens a subject or a book or any other thing. In other words, Al-Fatihah is a sort of preface.",
                        "source": "Sayyid Abul Ala Maududi - Tafhim al-Qur'an - The Meaning of the Quran",
                        "text": "<h2>Name</h2>\r\n<p>This Surah is named Al-Fatihah because of its subject-matter. Fatihah is that which opens a subject or a book or any other thing. In other words, Al-Fatihah is a sort of preface.</p>\r\n<h2>Period of Revelation</h2>...",
                        "resource_id": 58
                      },
                      "resources": [
                        {
                          "id": 58,
                          "name": "Chapter Info",
                          "author_name": "Sayyid Abul Ala Maududi",
                          "slug": "",
                          "language_name": "english",
                          "translated_name": {
                            "name": "Chapter Info",
                            "language_name": "english"
                          }
                        }
                      ]
                    }
                  },
                  "resolved_with_resources": {
                    "summary": "Resolved chapter info with resource list",
                    "value": {
                      "chapter_info": {
                        "id": 1,
                        "chapter_id": 1,
                        "language_name": "english",
                        "short_text": "This Surah is named Al-Fatihah because it opens the Book.",
                        "source": "Sayyid Abul Ala Maududi - Tafhim al-Qur'an - The Meaning of the Quran",
                        "text": "<h2>Name</h2><p>This Surah is named Al-Fatihah because it opens the Book.</p>",
                        "resource_id": 58
                      },
                      "resources": [
                        {
                          "id": 58,
                          "name": "Chapter Info",
                          "author_name": "Sayyid Abul Ala Maududi",
                          "slug": "chapter-info-maududi",
                          "language_name": "english",
                          "translated_name": {
                            "name": "Chapter Info",
                            "language_name": "english"
                          }
                        }
                      ]
                    }
                  },
                  "no_matching_resource": {
                    "summary": "No approved chapter info for selected resource",
                    "value": {
                      "chapter_info": null,
                      "resources": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get Chapter Info\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(id, options = {}) {\n  const response = await axios.get(\n    `${API_BASE_URL}/chapters/${id}/info`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      },\n      params: options\n    }\n  );\n  return response.data;\n}\n\n// Example usage\n// Replace resource_id with the id or slug for a specific author such as Ibn Ashur.\ncallApi(\"1\", {\"language\":\"en\",\"resource_id\":\"58\",\"include_resources\":\"true\"})\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get Chapter Info\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(id, language=None, locale=None, resource_id=None, include_resources=None):\n    params = {k: v for k, v in {\n        'language': language,\n        'locale': locale,\n        'resource_id': resource_id,\n        'include_resources': include_resources,\n    }.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/chapters/{id}/info',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\n# Replace resource_id with the id or slug for a specific author such as Ibn Ashur.\ntry:\n    data = call_api(\"1\", language=\"en\", resource_id=\"58\", include_resources=\"true\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get Chapter Info\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(id string, params map[string]string) (string, error) {\n  path := fmt.Sprintf(\"/chapters/%s/info\", id)\n  endpoint := API_BASE_URL + path\n  if params != nil && len(params) > 0 {\n    values := url.Values{}\n    for k, v := range params {\n      values.Set(k, v)\n    }\n    endpoint = endpoint + \"?\" + values.Encode()\n  }\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\n// Replace resource_id with the id or slug for a specific author such as Ibn Ashur.\nfunc main() {\n  params := map[string]string{\"language\": \"en\", \"resource_id\": \"58\", \"include_resources\": \"true\"}\n  data, err := callApi(\"1\", params)\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n   }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get Chapter Info\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(id, params = {})\n  path = \"/chapters/#{id}/info\"\n  uri = URI(API_BASE_URL + path)\n  uri.query = URI.encode_www_form(params) if params && !params.empty?\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\n# Replace resource_id with the id or slug for a specific author such as Ibn Ashur.\nparams = { \"language\" => \"en\", \"resource_id\" => \"58\", \"include_resources\" => \"true\" }\ndata = call_api(\"1\", params)\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get Chapter Info\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string id, Dictionary<string, string> query = null)\n{\n    var path = $@\"/chapters/{id}/info\";\n    var url = API_BASE_URL + path;\n    if (query != null && query.Count > 0)\n    {\n        var queryString = string.Join(\"&\", query.Select(kvp =>\n            $\"{Uri.EscapeDataString(kvp.Key)}={Uri.EscapeDataString(kvp.Value)}\"));\n        url = $\"{url}?{queryString}\";\n    }\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\n// Replace resource_id with the id or slug for a specific author such as Ibn Ashur.\nvar query = new Dictionary<string, string> { {\"language\", \"en\"}, {\"resource_id\", \"58\"}, {\"include_resources\", \"true\"} };\nvar data = await CallApiAsync(\"1\", query);\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get Chapter Info\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($id, $params = []) {\n  $path = sprintf(\"/chapters/%s/info\", $id);\n  $url = API_BASE_URL . $path;\n  if (!empty($params)) {\n    $url .= '?' . http_build_query($params);\n  }\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n// Replace resource_id with the id or slug for a specific author such as Ibn Ashur.\n$params = ['language' => 'en', 'resource_id' => '58', 'include_resources' => 'true'];\n$data = callApi(\"1\", $params);\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get Chapter Info\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String id, Map<String, String> params) throws IOException {\n    String path = String.format(\"/chapters/%s/info\", id);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    if (params != null) {\n      for (Map.Entry<String, String> entry : params.entrySet()) {\n        urlBuilder.addQueryParameter(entry.getKey(), entry.getValue());\n      }\n    }\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    // Replace resource_id with the id or slug for a specific author such as Ibn Ashur.\n    Map<String, String> params = new HashMap<>();\n    params.put(\"language\", \"en\");\n    params.put(\"resource_id\", \"58\");\n    params.put(\"include_resources\", \"true\");\n    String data = callApi(\"1\", params);\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get Chapter Info\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$id, [hashtable]$params = @{}) {\n  $path = \"/chapters/$id/info\"\n  $url = \"$API_BASE_URL$path\"\n  if ($params.Count -gt 0) {\n    $query = ($params.GetEnumerator() | ForEach-Object {\n      \"$($_.Key)=$([System.Uri]::EscapeDataString([string]$_.Value))\"\n    }) -join \"&\"\n    $url = \"$url?$query\"\n  }\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n# Replace resource_id with the id or slug for a specific author such as Ibn Ashur.\n$params = @{ language = \"en\"; resource_id = \"58\"; include_resources = \"true\" }\n$data = Call-Api(\"1\", $params)\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get Chapter Info\n# Replace resource_id with the id or slug for a specific author such as Ibn Ashur.\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/chapters/1/info?language=en&resource_id=58&include_resources=true' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get chapter info using the Quran Foundation API.\n\nEndpoint: GET /chapters/{id}/info\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  id: Chapter number (1-114) (e.g., \"1\")\nOptional Query Parameters:\n  language: Language ISO code for translated metadata. Defaults to English.\n  locale: Locale fallback if a language code is not provided.\n  resource_id: Resource id or slug of the chapter info resource to fetch. Use this to request a specific author such as Ibn Ashur after discovering the identifier via /resources/chapter_infos or include_resources=true.\n  include_resources: When true, include the ordered list of available chapter info resources for the resolved language.\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/chapters/{id}/info?{queryParams}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts id and optional parameters including resource_id and include_resources\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/hadith_references/by_ayah/{ayah_key}": {
      "get": {
        "tags": ["Hadith"],
        "summary": "Get hadith references for a specific Ayah",
        "description": "Get the ordered hadith reference records linked to a specific ayah.",
        "operationId": "hadith-references-by-ayah",
        "parameters": [
          {
            "name": "ayah_key",
            "in": "path",
            "description": "Ayah key in `chapter:verse` format, for example `12:12`.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "language",
            "in": "query",
            "description": "Language ISO code used for the `language` and `direction` metadata fields in the response. Defaults to `en`.",
            "schema": {
              "type": "string",
              "default": "en"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/hadith-references-by-ayah-response"
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "verse_key": "12:12",
                      "verse_number": 12,
                      "chapter_number": 12,
                      "language": "en",
                      "direction": "ltr",
                      "hadith_references": [
                        {
                          "id": 10,
                          "collection": "bukhari",
                          "hadith_number": "1",
                          "our_hadith_number": 1,
                          "arabic_urn": 111,
                          "english_urn": 211,
                          "surah_number": 12,
                          "ayah_start_number": 11,
                          "ayah_end_number": 12
                        },
                        {
                          "id": 11,
                          "collection": "muslim",
                          "hadith_number": "3",
                          "our_hadith_number": 1,
                          "arabic_urn": 113,
                          "english_urn": 213,
                          "surah_number": 12,
                          "ayah_start_number": 12,
                          "ayah_end_number": 14
                        }
                      ]
                    }
                  },
                  "references_found": {
                    "summary": "Ayah with hadith references",
                    "value": {
                      "verse_key": "12:12",
                      "verse_number": 12,
                      "chapter_number": 12,
                      "language": "en",
                      "direction": "ltr",
                      "hadith_references": [
                        {
                          "id": 10,
                          "collection": "bukhari",
                          "hadith_number": "1",
                          "our_hadith_number": 1,
                          "arabic_urn": 111,
                          "english_urn": 211,
                          "surah_number": 12,
                          "ayah_start_number": 11,
                          "ayah_end_number": 12
                        },
                        {
                          "id": 11,
                          "collection": "muslim",
                          "hadith_number": "3",
                          "our_hadith_number": 1,
                          "arabic_urn": 113,
                          "english_urn": 213,
                          "surah_number": 12,
                          "ayah_start_number": 12,
                          "ayah_end_number": 14
                        }
                      ]
                    }
                  },
                  "no_references": {
                    "summary": "Ayah with no hadith references",
                    "value": {
                      "verse_key": "1:1",
                      "verse_number": 1,
                      "chapter_number": 1,
                      "language": "en",
                      "direction": "ltr",
                      "hadith_references": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Returned when `ayah_key` is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/hadith-error-response"
                },
                "examples": {
                  "invalid_request": {
                    "summary": "Invalid request",
                    "value": {
                      "status": 400,
                      "error": {
                        "code": "INVALID_PARAMETER",
                        "message": "Invalid ayah_key format. Expected format: chapter:verse (e.g., 12:12)",
                        "details": {
                          "parameter": "ayah_key",
                          "provided": "12-12",
                          "expected": "12:12"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "description": "Returned when the ayah does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/hadith-error-response"
                },
                "examples": {
                  "not_found": {
                    "summary": "Resource not found",
                    "value": {
                      "status": 404,
                      "error": {
                        "code": "NOT_FOUND",
                        "message": "Verse 999:999 not found",
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        }
      }
    },
    "/hadith_references/by_ayah/{ayah_key}/hadiths": {
      "get": {
        "tags": ["Hadith"],
        "summary": "Get hadiths for a specific Ayah",
        "description": "Get paginated hadith payloads for a specific ayah.",
        "operationId": "hadiths-by-ayah",
        "parameters": [
          {
            "name": "ayah_key",
            "in": "path",
            "description": "Ayah key in `chapter:verse` format, for example `12:12`.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "language",
            "in": "query",
            "description": "Hadith language. Use `ar` for Arabic. Any non-`ar` value behaves like English and returns English hadith content.",
            "schema": {
              "type": "string",
              "default": "en",
              "example": "en"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Page number for the hadith result set. Defaults to `1`.",
            "schema": {
              "type": "integer",
              "default": 1,
              "minimum": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Number of hadith records per page. Defaults to `4` and is capped at `5`.",
            "schema": {
              "type": "integer",
              "default": 4,
              "minimum": 1,
              "maximum": 5
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/hadith-by-ayah-response"
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "hadiths": [
                        {
                          "urn": 201,
                          "collection": "bukhari",
                          "bookNumber": "1",
                          "chapterId": "1",
                          "hadithNumber": "1",
                          "name": "Sahih al-Bukhari",
                          "hadith": [
                            {
                              "lang": "en",
                              "chapterNumber": "1",
                              "chapterTitle": "Revelation",
                              "body": "Narrated Umar bin Al-Khattab:...",
                              "urn": 31,
                              "grades": [
                                {
                                  "graded_by": "Ahmad Muhammad Shakir",
                                  "grade": "Sahih"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "urn": 202,
                          "collection": "muslim",
                          "bookNumber": "1",
                          "chapterId": "2",
                          "hadithNumber": "1",
                          "name": "Sahih Muslim",
                          "hadith": [
                            {
                              "lang": "en",
                              "chapterNumber": "2",
                              "chapterTitle": "Faith",
                              "body": "Narrated Abu Huraira:...",
                              "urn": 33,
                              "grades": []
                            }
                          ]
                        }
                      ],
                      "page": 1,
                      "limit": 4,
                      "has_more": true,
                      "language": "en",
                      "direction": "ltr"
                    }
                  },
                  "hadiths_found": {
                    "summary": "Hadith references expanded into hadith text",
                    "value": {
                      "hadiths": [
                        {
                          "urn": 201,
                          "collection": "bukhari",
                          "bookNumber": "1",
                          "chapterId": "1",
                          "hadithNumber": "1",
                          "name": "Sahih al-Bukhari",
                          "hadith": [
                            {
                              "lang": "en",
                              "chapterNumber": "1",
                              "chapterTitle": "Revelation",
                              "body": "Narrated Umar bin Al-Khattab:...",
                              "urn": 31,
                              "grades": [
                                {
                                  "graded_by": "Ahmad Muhammad Shakir",
                                  "grade": "Sahih"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "urn": 202,
                          "collection": "muslim",
                          "bookNumber": "1",
                          "chapterId": "2",
                          "hadithNumber": "1",
                          "name": "Sahih Muslim",
                          "hadith": [
                            {
                              "lang": "en",
                              "chapterNumber": "2",
                              "chapterTitle": "Faith",
                              "body": "Narrated Abu Huraira:...",
                              "urn": 33,
                              "grades": []
                            }
                          ]
                        }
                      ],
                      "page": 1,
                      "limit": 4,
                      "has_more": true,
                      "language": "en",
                      "direction": "ltr"
                    }
                  },
                  "no_hadiths": {
                    "summary": "No hadiths for the selected ayah",
                    "value": {
                      "hadiths": [],
                      "page": 1,
                      "limit": 4,
                      "has_more": false,
                      "language": "en",
                      "direction": "ltr"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Returned when `ayah_key` is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/hadith-error-response"
                },
                "examples": {
                  "invalid_request": {
                    "summary": "Invalid request",
                    "value": {
                      "status": 400,
                      "error": {
                        "code": "INVALID_PARAMETER",
                        "message": "Invalid ayah_key format. Expected format: chapter:verse (e.g., 12:12)",
                        "details": {
                          "parameter": "ayah_key",
                          "provided": "12-12",
                          "expected": "12:12"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "description": "Returned when the ayah does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/hadith-error-response"
                },
                "examples": {
                  "not_found": {
                    "summary": "Resource not found",
                    "value": {
                      "status": 404,
                      "error": {
                        "code": "NOT_FOUND",
                        "message": "Verse 999:999 not found",
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "description": "Returned when Sunnah API configuration is missing on the server.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/hadith-error-response"
                },
                "examples": {
                  "internal_server_error": {
                    "summary": "Internal server error",
                    "value": {
                      "status": 500,
                      "error": {
                        "code": "CONFIGURATION_ERROR",
                        "message": "SUNNAH_API_KEY is required",
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "Returned when the upstream Sunnah service fails.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/hadith-error-response"
                },
                "examples": {
                  "bad_gateway": {
                    "summary": "Bad gateway",
                    "value": {
                      "status": 502,
                      "error": {
                        "code": "UPSTREAM_ERROR",
                        "message": "Too Many Requests.",
                        "details": {
                          "status": 429
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        }
      }
    },
    "/hadith_references/count_within_range": {
      "get": {
        "tags": ["Hadith"],
        "summary": "Get hadith counts within a verse range",
        "description": "Get a map of verse keys to hadith counts within an inclusive ayah range. The optional `language` query parameter is accepted for parity with internal consumers, but the count response itself is language-independent.",
        "operationId": "hadith-count-within-range",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "description": "Starting ayah key in `chapter:verse` format.",
            "required": true,
            "schema": {
              "type": "string",
              "example": "12:12"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "Ending ayah key in `chapter:verse` format.",
            "required": true,
            "schema": {
              "type": "string",
              "example": "12:13"
            }
          },
          {
            "name": "language",
            "in": "query",
            "description": "Optional language code. The response data is not language-dependent.",
            "schema": {
              "type": "string",
              "default": "en"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/hadith-count-within-range-response"
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "12:12": 2,
                      "12:13": 2
                    }
                  },
                  "range_with_counts": {
                    "summary": "Hadith counts by ayah key",
                    "value": {
                      "12:12": 2,
                      "12:13": 2
                    }
                  },
                  "range_with_no_matches": {
                    "summary": "Verse range with no hadith references",
                    "value": {
                      "1:1": 0,
                      "1:2": 0
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Returned when the range parameters are missing, malformed, invalid, or reversed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/hadith-error-response"
                },
                "examples": {
                  "invalid_request": {
                    "summary": "Invalid request",
                    "value": {
                      "status": 400,
                      "error": {
                        "code": "INVALID_PARAMETER",
                        "message": "Missing required parameters: from and to",
                        "details": {
                          "required": ["from", "to"]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        }
      }
    },
    "/pages": {
      "get": {
        "tags": ["Pages"],
        "summary": "List Pages",
        "description": "Get all pages for the selected mushaf.",
        "operationId": "list-pages",
        "parameters": [
          {
            "name": "mushaf",
            "in": "query",
            "description": "Optional mushaf id. Defaults to the system default mushaf.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["pages"],
                  "properties": {
                    "pages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "description": "Internal Mushaf page record id. Use `page_number` for Mushaf page navigation."
                          },
                          "page_number": {
                            "type": "integer",
                            "description": "Page number in the selected mushaf."
                          },
                          "verse_mapping": {
                            "type": "object",
                            "additionalProperties": {
                              "type": "string"
                            }
                          },
                          "first_verse_id": {
                            "type": "integer"
                          },
                          "last_verse_id": {
                            "type": "integer"
                          },
                          "verses_count": {
                            "type": "integer"
                          }
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "pages": [
                        {
                          "id": 1,
                          "page_number": 507,
                          "verse_mapping": {
                            "47:1": "47:3"
                          },
                          "first_verse_id": 4787,
                          "last_verse_id": 4789,
                          "verses_count": 3
                        }
                      ]
                    }
                  },
                  "first_mushaf_pages": {
                    "summary": "First pages in the default mushaf",
                    "value": {
                      "pages": [
                        {
                          "id": 1,
                          "page_number": 1,
                          "verse_mapping": {
                            "1": "1-7"
                          },
                          "first_verse_id": 1,
                          "last_verse_id": 7,
                          "verses_count": 7
                        },
                        {
                          "id": 2,
                          "page_number": 2,
                          "verse_mapping": {
                            "2": "1-5"
                          },
                          "first_verse_id": 8,
                          "last_verse_id": 12,
                          "verses_count": 5
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// List Pages\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(options = {}) {\n  const response = await axios.get(\n    `${API_BASE_URL}/pages`,\n    {\n    headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      },\n      params: options\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi({\"mushaf\":\"2\"})\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# List Pages\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/pages?mushaf=2' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to list pages using the Quran Foundation API.\n\nEndpoint: GET /pages\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/pages\n2. Inject both required headers on every request\n3. Handle 401, 403, and 429 responses gracefully"
          }
        ]
      }
    },
    "/pages/lookup": {
      "get": {
        "tags": ["Pages"],
        "summary": "Lookup Pages",
        "description": "Get page boundaries for a chapter, juz, page, manzil, hizb, rub el hizb, ruku, or verse range in the selected mushaf.",
        "operationId": "get-pages-lookup",
        "parameters": [
          {
            "name": "mushaf",
            "in": "query",
            "description": "Optional mushaf id. Defaults to the system default mushaf.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "chapter_number",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "juz_number",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page_number",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "manzil_number",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "rub_el_hizb_number",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "hizb_number",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "ruku_number",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "Starting verse key or verse id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "Ending verse key or verse id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total_page": {
                      "type": "integer"
                    },
                    "lookup_range": {
                      "type": "object",
                      "properties": {
                        "from": {
                          "type": "string"
                        },
                        "to": {
                          "type": "string"
                        }
                      }
                    },
                    "pages": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "properties": {
                          "first_verse_key": {
                            "type": "string"
                          },
                          "last_verse_key": {
                            "type": "string"
                          },
                          "from": {
                            "type": "string"
                          },
                          "to": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "total_page": 2,
                      "lookup_range": {
                        "from": "47:1",
                        "to": "47:5"
                      },
                      "pages": {
                        "507": {
                          "first_verse_key": "47:1",
                          "last_verse_key": "47:3",
                          "from": "47:1",
                          "to": "47:3"
                        },
                        "508": {
                          "first_verse_key": "47:4",
                          "last_verse_key": "47:5",
                          "from": "47:4",
                          "to": "47:5"
                        }
                      }
                    }
                  },
                  "ayah_range_spans_pages": {
                    "summary": "Ayah range split across multiple pages",
                    "value": {
                      "total_page": 2,
                      "lookup_range": {
                        "from": "47:1",
                        "to": "47:5"
                      },
                      "pages": {
                        "507": {
                          "first_verse_key": "47:1",
                          "last_verse_key": "47:3",
                          "from": "47:1",
                          "to": "47:3"
                        },
                        "508": {
                          "first_verse_key": "47:4",
                          "last_verse_key": "47:5",
                          "from": "47:4",
                          "to": "47:5"
                        }
                      }
                    }
                  },
                  "single_ayah_lookup": {
                    "summary": "Single ayah page lookup",
                    "value": {
                      "total_page": 1,
                      "lookup_range": {
                        "from": "2:255",
                        "to": "2:255"
                      },
                      "pages": {
                        "42": {
                          "first_verse_key": "2:253",
                          "last_verse_key": "2:256",
                          "from": "2:255",
                          "to": "2:255"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Lookup Pages\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(options = {}) {\n  const response = await axios.get(\n    `${API_BASE_URL}/pages/lookup`,\n    {\n    headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      },\n      params: options\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi({\"mushaf\":\"2\",\"from\":\"47:1\",\"to\":\"47:5\"})\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Lookup Pages\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/pages/lookup?mushaf=2&from=47%3A1&to=47%3A5' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to lookup pages using the Quran Foundation API.\n\nEndpoint: GET /pages/lookup\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/pages/lookup\n2. Inject both required headers on every request\n3. Handle 401, 403, and 429 responses gracefully"
          }
        ]
      }
    },
    "/pages/{page_number}": {
      "get": {
        "tags": ["Pages"],
        "summary": "Get Page",
        "description": "Get metadata for a single page in the selected mushaf.",
        "operationId": "get-pages-page-number",
        "parameters": [
          {
            "name": "page_number",
            "in": "path",
            "description": "Page number in the selected mushaf.",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "mushaf",
            "in": "query",
            "description": "Optional mushaf id. Defaults to the system default mushaf.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["page"],
                  "properties": {
                    "page": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "description": "Internal Mushaf page record id. Use `page_number` for Mushaf page navigation."
                        },
                        "page_number": {
                          "type": "integer",
                          "description": "Page number in the selected mushaf."
                        },
                        "verse_mapping": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "string"
                          }
                        },
                        "first_verse_id": {
                          "type": "integer"
                        },
                        "last_verse_id": {
                          "type": "integer"
                        },
                        "verses_count": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "page": {
                        "id": 1,
                        "page_number": 507,
                        "verse_mapping": {
                          "47:1": "47:3"
                        },
                        "first_verse_id": 4787,
                        "last_verse_id": 4789,
                        "verses_count": 3
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get Page\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(page_number, options = {}) {\n  const response = await axios.get(\n    `${API_BASE_URL}/pages/${page_number}`,\n    {\n    headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      },\n      params: options\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(\"507\", {\"mushaf\":\"2\"})\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get Page\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/pages/507?mushaf=2' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get page using the Quran Foundation API.\n\nEndpoint: GET /pages/{page_number}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/pages/{page_number}\n2. Inject both required headers on every request\n3. Handle 401, 403, and 429 responses gracefully"
          }
        ]
      }
    },
    "/verses/by_chapter/{chapter_number}": {
      "get": {
        "tags": ["Verses"],
        "summary": "By Chapter",
        "description": "Get list of Verse(s) by Chapter / Surah number.",
        "operationId": "verses-by_chapter_number",
        "parameters": [
          {
            "name": "chapter_number",
            "in": "path",
            "description": "Chapter number ( 1  - 114 )",
            "required": true,
            "schema": {
              "maximum": 114,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "language",
            "in": "query",
            "description": "Language to fetch word-by-word translation in a specific language.",
            "schema": {
              "type": "string",
              "default": "en"
            }
          },
          {
            "name": "words",
            "in": "query",
            "description": "Include words of each ayah? Use this to fetch word-by-word translation and transliteration.\n\n0 or false will not include words.\n\n1 or true will include the words.\n\nDefault is false.",
            "schema": {
              "type": "string",
              "default": "false",
              "enum": ["true", "false"]
            }
          },
          {
            "name": "translations",
            "in": "query",
            "description": "comma separated ids of translations to load for each ayah. See [/resources/translations](/docs/content_apis_versioned/translations) for available ids. Use translations=57 to include full-ayah transliteration.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "audio",
            "in": "query",
            "description": "Ayah-by-ayah recitation ID from [/resources/recitations](/docs/content_apis_versioned/recitations). Chapter-reciter IDs from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters) are not supported.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "tafsirs",
            "in": "query",
            "description": "Comma separated ids of tafsirs to load for each ayah if you want to load tafsirs. See [/resources/tafsirs](/docs/content_apis_versioned/tafsirs) for available ids.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "word_fields",
            "in": "query",
            "description": "Comma-separated list of word-level fields to include in response. [See full field reference](/docs/api/field-reference#word-level-fields).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "translation_fields",
            "in": "query",
            "description": "Comma separated list of translation fields if you want to add more fields for each translation. [See full field reference](/docs/api/field-reference#translation-fields).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tafsir_fields",
            "in": "query",
            "description": "Comma separated list of tafsir fields if you want to add more fields for each tafsir. [See full field reference](/docs/api/field-reference#tafsir-fields).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated list of verse-level fields to include in response. Use `fields=text_uthmani,text_indopak` to include Arabic text. [See full field reference](/docs/api/field-reference#verse-level-fields).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "For paginating within the result",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "records per api call, you can get maximum 50 records. ",
            "schema": {
              "maximum": 50,
              "minimum": 1,
              "type": "integer",
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "verses": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/verse"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/pagination"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "verses": [
                        {
                          "id": 1,
                          "verse_number": 1,
                          "page_number": 1,
                          "verse_key": "1:1",
                          "juz_number": 1,
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "sajdah_type": null,
                          "sajdah_number": null,
                          "words": [
                            {
                              "id": 1,
                              "position": 1,
                              "audio_url": "wbw/001_001_001.mp3",
                              "char_type_name": "word",
                              "line_number": 2,
                              "page_number": 1,
                              "code_v1": "&#xfb51;",
                              "translation": {
                                "text": "In (the) name",
                                "language_name": "english"
                              },
                              "transliteration": {
                                "text": "bis'mi",
                                "language_name": "english"
                              }
                            }
                          ],
                          "translations": [
                            {
                              "resource_id": 131,
                              "text": "In the Name of Allah—the Most Compassionate, Most Merciful."
                            }
                          ],
                          "tafsirs": [
                            {
                              "id": 82641,
                              "language_name": "english",
                              "name": "Tafsir Ibn Kathir",
                              "text": "<h2 class=\"title\">Which was revealed in Makkah</h2><h2 class=\"title\">The Meaning of Al-Fatihah and its Various Names</h2>"
                            }
                          ]
                        }
                      ],
                      "pagination": {
                        "per_page": 1,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 7,
                        "total_records": 7
                      }
                    }
                  },
                  "compact_fields": {
                    "summary": "Compact verse fields for navigation views",
                    "value": {
                      "verses": [
                        {
                          "id": 255,
                          "chapter_id": 2,
                          "verse_number": 255,
                          "verse_key": "2:255",
                          "verse_index": 262,
                          "juz_number": 3,
                          "hizb_number": 5,
                          "rub_el_hizb_number": 19,
                          "page_number": 42
                        }
                      ],
                      "pagination": {
                        "per_page": 1,
                        "current_page": 1,
                        "next_page": null,
                        "total_pages": 1,
                        "total_records": 1
                      }
                    }
                  },
                  "with_words_translation_tafsir_audio": {
                    "summary": "Verse payload with words, translation, tafsir, and audio",
                    "value": {
                      "verses": [
                        {
                          "id": 1,
                          "chapter_id": 1,
                          "verse_number": 1,
                          "page_number": 1,
                          "verse_key": "1:1",
                          "juz_number": 1,
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "sajdah_type": null,
                          "sajdah_number": null,
                          "audio": {
                            "verse_key": "1:1",
                            "url": "https://verses.quran.foundation/Alafasy/mp3/001001.mp3"
                          },
                          "words": [
                            {
                              "id": 1,
                              "position": 1,
                              "audio_url": "wbw/001_001_001.mp3",
                              "char_type_name": "word",
                              "line_number": 2,
                              "page_number": 1,
                              "code_v1": "&#xfb51;",
                              "translation": {
                                "text": "In (the) name",
                                "language_name": "english"
                              },
                              "transliteration": {
                                "text": "bis'mi",
                                "language_name": "english"
                              }
                            }
                          ],
                          "translations": [
                            {
                              "resource_id": 131,
                              "resource_name": "Dr. Mustafa Khattab, the Clear Quran",
                              "text": "In the Name of Allah?the Most Compassionate, Most Merciful."
                            }
                          ],
                          "tafsirs": [
                            {
                              "id": 82641,
                              "resource_id": 169,
                              "language_name": "english",
                              "name": "Tafsir Ibn Kathir",
                              "text": "<h2 class=\"title\">The Meaning of Al-Fatihah and its Various Names</h2>"
                            }
                          ]
                        }
                      ],
                      "pagination": {
                        "per_page": 1,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 7,
                        "total_records": 7
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// By Chapter\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(chapter_number, options = {}) {\n  const response = await axios.get(\n    `${API_BASE_URL}/verses/by_chapter/${chapter_number}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      },\n      params: options\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(\"1\", {\"language\":\"en\",\"words\":\"true\",\"translations\":\"131\"})\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# By Chapter\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(chapter_number, language=None, words=None, translations=None):\n    params = {k: v for k, v in {'language': language, 'words': words, 'translations': translations}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/verses/by_chapter/{chapter_number}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(\"1\", language=\"en\", words=\"true\", translations=\"131\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// By Chapter\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(chapter_number string, params map[string]string) (string, error) {\n  path := fmt.Sprintf(\"/verses/by_chapter/%s\", chapter_number)\n  endpoint := API_BASE_URL + path\n  if params != nil && len(params) > 0 {\n    values := url.Values{}\n    for k, v := range params {\n      values.Set(k, v)\n    }\n    endpoint = endpoint + \"?\" + values.Encode()\n  }\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  params := map[string]string{\"language\": \"en\", \"words\": \"true\", \"translations\": \"131\"}\n  data, err := callApi(\"1\", params)\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# By Chapter\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(chapter_number, params = {})\n  path = \"/verses/by_chapter/#{chapter_number}\"\n  uri = URI(API_BASE_URL + path)\n  uri.query = URI.encode_www_form(params) if params && !params.empty?\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\nparams = { \"language\" => \"en\", \"words\" => \"true\", \"translations\" => \"131\" }\ndata = call_api(\"1\", params)\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// By Chapter\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string chapter_number, Dictionary<string, string> query = null)\n{\n    var path = $@\"/verses/by_chapter/{chapter_number}\";\n    var url = API_BASE_URL + path;\n    if (query != null && query.Count > 0)\n    {\n        var queryString = string.Join(\"&\", query.Select(kvp =>\n            $\"{Uri.EscapeDataString(kvp.Key)}={Uri.EscapeDataString(kvp.Value)}\"));\n        url = $\"{url}?{queryString}\";\n    }\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar query = new Dictionary<string, string> { {\"language\", \"en\"}, {\"words\", \"true\"}, {\"translations\", \"131\"} };\nvar data = await CallApiAsync(\"1\", query);\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# By Chapter\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($chapter_number, $params = []) {\n  $path = sprintf(\"/verses/by_chapter/%s\", $chapter_number);\n  $url = API_BASE_URL . $path;\n  if (!empty($params)) {\n    $url .= '?' . http_build_query($params);\n  }\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$params = ['language' => 'en', 'words' => 'true', 'translations' => '131'];\n$data = callApi(\"1\", $params);\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// By Chapter\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String chapter_number, Map<String, String> params) throws IOException {\n    String path = String.format(\"/verses/by_chapter/%s\", chapter_number);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    if (params != null) {\n      for (Map.Entry<String, String> entry : params.entrySet()) {\n        urlBuilder.addQueryParameter(entry.getKey(), entry.getValue());\n      }\n    }\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    Map<String, String> params = new HashMap<>();\n    params.put(\"language\", \"en\");\n    params.put(\"words\", \"true\");\n    params.put(\"translations\", \"131\");\n    String data = callApi(\"1\", params);\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# By Chapter\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$chapter_number, [hashtable]$params = @{}) {\n  $path = \"/verses/by_chapter/$chapter_number\"\n  $url = \"$API_BASE_URL$path\"\n  if ($params.Count -gt 0) {\n    $query = ($params.GetEnumerator() | ForEach-Object {\n      \"$($_.Key)=$([System.Uri]::EscapeDataString([string]$_.Value))\"\n    }) -join \"&\"\n    $url = \"$url?$query\"\n  }\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$params = @{ language = \"en\"; words = \"true\"; translations = \"131\" }\n$data = Call-Api(\"1\", $params)\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# By Chapter\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/verses/by_chapter/1?language=en&words=true&translations=131' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to by chapter using the Quran Foundation API.\n\nEndpoint: GET /verses/by_chapter/{chapter_number}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  chapter_number: Chapter number ( 1  - 114 ) (e.g., \"1\")\nOptional Query Parameters:\n  language: Language to fetch word-by-word translation in a specific language.\n  words: Include words of each ayah? Use this to fetch word-by-word translation and transliteration.\n\n0 or false will not include words.\n\n1 or true will include the words.\n\nDefault is false.\n  translations: comma separated ids of translations to load for each ayah. See [/resources/translations](/docs/content_apis_versioned/translations) for available ids. Use translations=57 to include full-ayah transliteration.\n  audio: Ayah-by-ayah recitation ID from [/resources/recitations](/docs/content_apis_versioned/recitations). Chapter-reciter IDs from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters) are not supported.\n  tafsirs: Comma separated ids of tafsirs to load for each ayah if you want to load tafsirs. See [/resources/tafsirs](/docs/content_apis_versioned/tafsirs) for available ids.\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/verses/by_chapter/{chapter_number}?{queryParams}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts chapter_number and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/verses/by_page/{page_number}": {
      "get": {
        "tags": ["Verses"],
        "summary": "By Page",
        "description": "Get all verses of a specific page in the selected mushaf.",
        "operationId": "verses-by_page_number",
        "parameters": [
          {
            "name": "page_number",
            "in": "path",
            "description": "Page number in the selected mushaf.",
            "required": true,
            "schema": {
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "language",
            "in": "query",
            "description": "Language to fetch word-by-word translation in a specific language.",
            "schema": {
              "type": "string",
              "default": "en"
            }
          },
          {
            "name": "mushaf",
            "in": "query",
            "description": "Optional mushaf id. When provided, page boundaries and line layout are resolved from the selected mushaf.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "words",
            "in": "query",
            "description": "Include words of each ayah? Use this to fetch word-by-word translation and transliteration.\n\n0 or false will not include words.\n\n1 or true will include the words.\n\nDefault is false.",
            "schema": {
              "type": "string",
              "default": "false",
              "enum": ["true", "false"]
            }
          },
          {
            "name": "translations",
            "in": "query",
            "description": "comma separated ids of translations to load for each ayah. See [/resources/translations](/docs/content_apis_versioned/translations) for available ids. Use translations=57 to include full-ayah transliteration.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "audio",
            "in": "query",
            "description": "Ayah-by-ayah recitation ID from [/resources/recitations](/docs/content_apis_versioned/recitations). Chapter-reciter IDs from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters) are not supported.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "tafsirs",
            "in": "query",
            "description": "Comma separated ids of tafsirs to load for each ayah if you want to load tafsirs. See [/resources/tafsirs](/docs/content_apis_versioned/tafsirs) for available ids.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "word_fields",
            "in": "query",
            "description": "Comma-separated list of word-level fields to include in response. [See full field reference](/docs/api/field-reference#word-level-fields).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "translation_fields",
            "in": "query",
            "description": "Comma separated list of translation fields if you want to add more fields for each translation. [See full field reference](/docs/api/field-reference#translation-fields).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tafsir_fields",
            "in": "query",
            "description": "Comma separated list of tafsir fields if you want to add more fields for each tafsir. [See full field reference](/docs/api/field-reference#tafsir-fields).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated list of verse-level fields to include in response. Use `fields=text_uthmani,text_indopak` to include Arabic text. [See full field reference](/docs/api/field-reference#verse-level-fields).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "For paginating within the result",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "records per api call, you can get maximum 50 records. ",
            "schema": {
              "maximum": 50,
              "minimum": 1,
              "type": "integer",
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "verses": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/verse"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/pagination"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "verses": [
                        {
                          "id": 1,
                          "verse_number": 1,
                          "page_number": 1,
                          "verse_key": "1:1",
                          "juz_number": 1,
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "sajdah_type": null,
                          "sajdah_number": null,
                          "words": [
                            {
                              "id": 1,
                              "position": 1,
                              "audio_url": "wbw/001_001_001.mp3",
                              "char_type_name": "word",
                              "line_number": 2,
                              "page_number": 1,
                              "code_v1": "&#xfb51;",
                              "translation": {
                                "text": "In (the) name",
                                "language_name": "english"
                              },
                              "transliteration": {
                                "text": "bis'mi",
                                "language_name": "english"
                              }
                            }
                          ],
                          "translations": [
                            {
                              "resource_id": 131,
                              "text": "In the Name of Allah—the Most Compassionate, Most Merciful."
                            }
                          ],
                          "tafsirs": [
                            {
                              "id": 82641,
                              "language_name": "english",
                              "name": "Tafsir Ibn Kathir",
                              "text": "<h2 class=\"title\">Which was revealed in Makkah</h2><h2 class=\"title\">The Meaning of Al-Fatihah and its Various Names</h2>"
                            }
                          ]
                        }
                      ],
                      "pagination": {
                        "per_page": 1,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 7,
                        "total_records": 7
                      }
                    }
                  },
                  "compact_fields": {
                    "summary": "Compact verse fields for navigation views",
                    "value": {
                      "verses": [
                        {
                          "id": 255,
                          "chapter_id": 2,
                          "verse_number": 255,
                          "verse_key": "2:255",
                          "verse_index": 262,
                          "juz_number": 3,
                          "hizb_number": 5,
                          "rub_el_hizb_number": 19,
                          "page_number": 42
                        }
                      ],
                      "pagination": {
                        "per_page": 1,
                        "current_page": 1,
                        "next_page": null,
                        "total_pages": 1,
                        "total_records": 1
                      }
                    }
                  },
                  "with_words_translation_tafsir_audio": {
                    "summary": "Verse payload with words, translation, tafsir, and audio",
                    "value": {
                      "verses": [
                        {
                          "id": 1,
                          "chapter_id": 1,
                          "verse_number": 1,
                          "page_number": 1,
                          "verse_key": "1:1",
                          "juz_number": 1,
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "sajdah_type": null,
                          "sajdah_number": null,
                          "audio": {
                            "verse_key": "1:1",
                            "url": "https://verses.quran.foundation/Alafasy/mp3/001001.mp3"
                          },
                          "words": [
                            {
                              "id": 1,
                              "position": 1,
                              "audio_url": "wbw/001_001_001.mp3",
                              "char_type_name": "word",
                              "line_number": 2,
                              "page_number": 1,
                              "code_v1": "&#xfb51;",
                              "translation": {
                                "text": "In (the) name",
                                "language_name": "english"
                              },
                              "transliteration": {
                                "text": "bis'mi",
                                "language_name": "english"
                              }
                            }
                          ],
                          "translations": [
                            {
                              "resource_id": 131,
                              "resource_name": "Dr. Mustafa Khattab, the Clear Quran",
                              "text": "In the Name of Allah?the Most Compassionate, Most Merciful."
                            }
                          ],
                          "tafsirs": [
                            {
                              "id": 82641,
                              "resource_id": 169,
                              "language_name": "english",
                              "name": "Tafsir Ibn Kathir",
                              "text": "<h2 class=\"title\">The Meaning of Al-Fatihah and its Various Names</h2>"
                            }
                          ]
                        }
                      ],
                      "pagination": {
                        "per_page": 1,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 7,
                        "total_records": 7
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// By Page\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(page_number, options = {}) {\n  const response = await axios.get(\n    `${API_BASE_URL}/verses/by_page/${page_number}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      },\n      params: options\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(\"1\", {\"language\":\"en\",\"words\":\"true\",\"translations\":\"131\"})\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# By Page\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(page_number, language=None, words=None, translations=None):\n    params = {k: v for k, v in {'language': language, 'words': words, 'translations': translations}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/verses/by_page/{page_number}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(\"1\", language=\"en\", words=\"true\", translations=\"131\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// By Page\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(page_number string, params map[string]string) (string, error) {\n  path := fmt.Sprintf(\"/verses/by_page/%s\", page_number)\n  endpoint := API_BASE_URL + path\n  if params != nil && len(params) > 0 {\n    values := url.Values{}\n    for k, v := range params {\n      values.Set(k, v)\n    }\n    endpoint = endpoint + \"?\" + values.Encode()\n  }\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  params := map[string]string{\"language\": \"en\", \"words\": \"true\", \"translations\": \"131\"}\n  data, err := callApi(\"1\", params)\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# By Page\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(page_number, params = {})\n  path = \"/verses/by_page/#{page_number}\"\n  uri = URI(API_BASE_URL + path)\n  uri.query = URI.encode_www_form(params) if params && !params.empty?\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\nparams = { \"language\" => \"en\", \"words\" => \"true\", \"translations\" => \"131\" }\ndata = call_api(\"1\", params)\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// By Page\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string page_number, Dictionary<string, string> query = null)\n{\n    var path = $@\"/verses/by_page/{page_number}\";\n    var url = API_BASE_URL + path;\n    if (query != null && query.Count > 0)\n    {\n        var queryString = string.Join(\"&\", query.Select(kvp =>\n            $\"{Uri.EscapeDataString(kvp.Key)}={Uri.EscapeDataString(kvp.Value)}\"));\n        url = $\"{url}?{queryString}\";\n    }\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar query = new Dictionary<string, string> { {\"language\", \"en\"}, {\"words\", \"true\"}, {\"translations\", \"131\"} };\nvar data = await CallApiAsync(\"1\", query);\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# By Page\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($page_number, $params = []) {\n  $path = sprintf(\"/verses/by_page/%s\", $page_number);\n  $url = API_BASE_URL . $path;\n  if (!empty($params)) {\n    $url .= '?' . http_build_query($params);\n  }\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$params = ['language' => 'en', 'words' => 'true', 'translations' => '131'];\n$data = callApi(\"1\", $params);\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// By Page\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String page_number, Map<String, String> params) throws IOException {\n    String path = String.format(\"/verses/by_page/%s\", page_number);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    if (params != null) {\n      for (Map.Entry<String, String> entry : params.entrySet()) {\n        urlBuilder.addQueryParameter(entry.getKey(), entry.getValue());\n      }\n    }\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    Map<String, String> params = new HashMap<>();\n    params.put(\"language\", \"en\");\n    params.put(\"words\", \"true\");\n    params.put(\"translations\", \"131\");\n    String data = callApi(\"1\", params);\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# By Page\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$page_number, [hashtable]$params = @{}) {\n  $path = \"/verses/by_page/$page_number\"\n  $url = \"$API_BASE_URL$path\"\n  if ($params.Count -gt 0) {\n    $query = ($params.GetEnumerator() | ForEach-Object {\n      \"$($_.Key)=$([System.Uri]::EscapeDataString([string]$_.Value))\"\n    }) -join \"&\"\n    $url = \"$url?$query\"\n  }\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$params = @{ language = \"en\"; words = \"true\"; translations = \"131\" }\n$data = Call-Api(\"1\", $params)\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# By Page\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/verses/by_page/1?language=en&words=true&translations=131' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to by page using the Quran Foundation API.\n\nEndpoint: GET /verses/by_page/{page_number}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  page_number: Page number in the selected mushaf (e.g., \"1\")\nOptional Query Parameters:\n  language: Language to fetch word-by-word translation in a specific language.\n  mushaf: Optional mushaf id. When provided, page boundaries and line layout are resolved from the selected mushaf.\n  words: Include words of each ayah? Use this to fetch word-by-word translation and transliteration.\n\n0 or false will not include words.\n\n1 or true will include the words.\n\nDefault is false.\n  translations: comma separated ids of translations to load for each ayah. See [/resources/translations](/docs/content_apis_versioned/translations) for available ids. Use translations=57 to include full-ayah transliteration.\n  audio: Ayah-by-ayah recitation ID from [/resources/recitations](/docs/content_apis_versioned/recitations). Chapter-reciter IDs from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters) are not supported.\n  tafsirs: Comma separated ids of tafsirs to load for each ayah if you want to load tafsirs. See [/resources/tafsirs](/docs/content_apis_versioned/tafsirs) for available ids.\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/verses/by_page/{page_number}?{queryParams}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts page_number and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/verses/by_juz/{juz_number}": {
      "get": {
        "tags": ["Verses"],
        "summary": "By Juz",
        "description": "Get all verses from a specific juz(1-30).",
        "operationId": "verses-by_juz_number",
        "parameters": [
          {
            "name": "juz_number",
            "in": "path",
            "required": true,
            "schema": {
              "maximum": 30,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "language",
            "in": "query",
            "description": "Language to fetch word-by-word translation in a specific language.",
            "schema": {
              "type": "string",
              "default": "en"
            }
          },
          {
            "name": "words",
            "in": "query",
            "description": "Include words of each ayah? Use this to fetch word-by-word translation and transliteration.\n\n0 or false will not include words.\n\n1 or true will include the words.\n\nDefault is false.",
            "schema": {
              "type": "string",
              "default": "false",
              "enum": ["true", "false"]
            }
          },
          {
            "name": "translations",
            "in": "query",
            "description": "comma separated ids of translations to load for each ayah. See [/resources/translations](/docs/content_apis_versioned/translations) for available ids. Use translations=57 to include full-ayah transliteration.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "audio",
            "in": "query",
            "description": "Ayah-by-ayah recitation ID from [/resources/recitations](/docs/content_apis_versioned/recitations). Chapter-reciter IDs from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters) are not supported.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "tafsirs",
            "in": "query",
            "description": "Comma separated ids of tafsirs to load for each ayah if you want to load tafsirs. See [/resources/tafsirs](/docs/content_apis_versioned/tafsirs) for available ids.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "word_fields",
            "in": "query",
            "description": "Comma-separated list of word-level fields to include in response. [See full field reference](/docs/api/field-reference#word-level-fields).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "translation_fields",
            "in": "query",
            "description": "Comma separated list of translation fields if you want to add more fields for each translation. [See full field reference](/docs/api/field-reference#translation-fields).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tafsir_fields",
            "in": "query",
            "description": "Comma separated list of tafsir fields if you want to add more fields for each tafsir. [See full field reference](/docs/api/field-reference#tafsir-fields).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated list of verse-level fields to include in response. Use `fields=text_uthmani,text_indopak` to include Arabic text. [See full field reference](/docs/api/field-reference#verse-level-fields).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "For paginating within the result",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "records per api call, you can get maximum 50 records. ",
            "schema": {
              "maximum": 50,
              "minimum": 1,
              "type": "integer",
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "verses": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/verse"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/pagination"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "verses": [
                        {
                          "id": 1,
                          "verse_number": 1,
                          "page_number": 1,
                          "verse_key": "1:1",
                          "juz_number": 1,
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "sajdah_type": null,
                          "sajdah_number": null,
                          "words": [
                            {
                              "id": 1,
                              "position": 1,
                              "audio_url": "wbw/001_001_001.mp3",
                              "char_type_name": "word",
                              "line_number": 2,
                              "page_number": 1,
                              "code_v1": "&#xfb51;",
                              "translation": {
                                "text": "In (the) name",
                                "language_name": "english"
                              },
                              "transliteration": {
                                "text": "bis'mi",
                                "language_name": "english"
                              }
                            }
                          ],
                          "translations": [
                            {
                              "resource_id": 131,
                              "text": "In the Name of Allah—the Most Compassionate, Most Merciful."
                            }
                          ],
                          "tafsirs": [
                            {
                              "id": 82641,
                              "language_name": "english",
                              "name": "Tafsir Ibn Kathir",
                              "text": "<h2 class=\"title\">Which was revealed in Makkah</h2><h2 class=\"title\">The Meaning of Al-Fatihah and its Various Names</h2>"
                            }
                          ]
                        }
                      ],
                      "pagination": {
                        "per_page": 1,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 7,
                        "total_records": 7
                      }
                    }
                  },
                  "compact_fields": {
                    "summary": "Compact verse fields for navigation views",
                    "value": {
                      "verses": [
                        {
                          "id": 255,
                          "chapter_id": 2,
                          "verse_number": 255,
                          "verse_key": "2:255",
                          "verse_index": 262,
                          "juz_number": 3,
                          "hizb_number": 5,
                          "rub_el_hizb_number": 19,
                          "page_number": 42
                        }
                      ],
                      "pagination": {
                        "per_page": 1,
                        "current_page": 1,
                        "next_page": null,
                        "total_pages": 1,
                        "total_records": 1
                      }
                    }
                  },
                  "with_words_translation_tafsir_audio": {
                    "summary": "Verse payload with words, translation, tafsir, and audio",
                    "value": {
                      "verses": [
                        {
                          "id": 1,
                          "chapter_id": 1,
                          "verse_number": 1,
                          "page_number": 1,
                          "verse_key": "1:1",
                          "juz_number": 1,
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "sajdah_type": null,
                          "sajdah_number": null,
                          "audio": {
                            "verse_key": "1:1",
                            "url": "https://verses.quran.foundation/Alafasy/mp3/001001.mp3"
                          },
                          "words": [
                            {
                              "id": 1,
                              "position": 1,
                              "audio_url": "wbw/001_001_001.mp3",
                              "char_type_name": "word",
                              "line_number": 2,
                              "page_number": 1,
                              "code_v1": "&#xfb51;",
                              "translation": {
                                "text": "In (the) name",
                                "language_name": "english"
                              },
                              "transliteration": {
                                "text": "bis'mi",
                                "language_name": "english"
                              }
                            }
                          ],
                          "translations": [
                            {
                              "resource_id": 131,
                              "resource_name": "Dr. Mustafa Khattab, the Clear Quran",
                              "text": "In the Name of Allah?the Most Compassionate, Most Merciful."
                            }
                          ],
                          "tafsirs": [
                            {
                              "id": 82641,
                              "resource_id": 169,
                              "language_name": "english",
                              "name": "Tafsir Ibn Kathir",
                              "text": "<h2 class=\"title\">The Meaning of Al-Fatihah and its Various Names</h2>"
                            }
                          ]
                        }
                      ],
                      "pagination": {
                        "per_page": 1,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 7,
                        "total_records": 7
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// By Juz\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(juz_number, options = {}) {\n  const response = await axios.get(\n    `${API_BASE_URL}/verses/by_juz/${juz_number}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      },\n      params: options\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(\"1\", {\"language\":\"en\",\"words\":\"true\",\"translations\":\"131\"})\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# By Juz\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(juz_number, language=None, words=None, translations=None):\n    params = {k: v for k, v in {'language': language, 'words': words, 'translations': translations}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/verses/by_juz/{juz_number}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(\"1\", language=\"en\", words=\"true\", translations=\"131\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// By Juz\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(juz_number string, params map[string]string) (string, error) {\n  path := fmt.Sprintf(\"/verses/by_juz/%s\", juz_number)\n  endpoint := API_BASE_URL + path\n  if params != nil && len(params) > 0 {\n    values := url.Values{}\n    for k, v := range params {\n      values.Set(k, v)\n    }\n    endpoint = endpoint + \"?\" + values.Encode()\n  }\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  params := map[string]string{\"language\": \"en\", \"words\": \"true\", \"translations\": \"131\"}\n  data, err := callApi(\"1\", params)\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# By Juz\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(juz_number, params = {})\n  path = \"/verses/by_juz/#{juz_number}\"\n  uri = URI(API_BASE_URL + path)\n  uri.query = URI.encode_www_form(params) if params && !params.empty?\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\nparams = { \"language\" => \"en\", \"words\" => \"true\", \"translations\" => \"131\" }\ndata = call_api(\"1\", params)\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// By Juz\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string juz_number, Dictionary<string, string> query = null)\n{\n    var path = $@\"/verses/by_juz/{juz_number}\";\n    var url = API_BASE_URL + path;\n    if (query != null && query.Count > 0)\n    {\n        var queryString = string.Join(\"&\", query.Select(kvp =>\n            $\"{Uri.EscapeDataString(kvp.Key)}={Uri.EscapeDataString(kvp.Value)}\"));\n        url = $\"{url}?{queryString}\";\n    }\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar query = new Dictionary<string, string> { {\"language\", \"en\"}, {\"words\", \"true\"}, {\"translations\", \"131\"} };\nvar data = await CallApiAsync(\"1\", query);\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# By Juz\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($juz_number, $params = []) {\n  $path = sprintf(\"/verses/by_juz/%s\", $juz_number);\n  $url = API_BASE_URL . $path;\n  if (!empty($params)) {\n    $url .= '?' . http_build_query($params);\n  }\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$params = ['language' => 'en', 'words' => 'true', 'translations' => '131'];\n$data = callApi(\"1\", $params);\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// By Juz\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String juz_number, Map<String, String> params) throws IOException {\n    String path = String.format(\"/verses/by_juz/%s\", juz_number);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    if (params != null) {\n      for (Map.Entry<String, String> entry : params.entrySet()) {\n        urlBuilder.addQueryParameter(entry.getKey(), entry.getValue());\n      }\n    }\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    Map<String, String> params = new HashMap<>();\n    params.put(\"language\", \"en\");\n    params.put(\"words\", \"true\");\n    params.put(\"translations\", \"131\");\n    String data = callApi(\"1\", params);\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# By Juz\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$juz_number, [hashtable]$params = @{}) {\n  $path = \"/verses/by_juz/$juz_number\"\n  $url = \"$API_BASE_URL$path\"\n  if ($params.Count -gt 0) {\n    $query = ($params.GetEnumerator() | ForEach-Object {\n      \"$($_.Key)=$([System.Uri]::EscapeDataString([string]$_.Value))\"\n    }) -join \"&\"\n    $url = \"$url?$query\"\n  }\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$params = @{ language = \"en\"; words = \"true\"; translations = \"131\" }\n$data = Call-Api(\"1\", $params)\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# By Juz\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/verses/by_juz/1?language=en&words=true&translations=131' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to by juz using the Quran Foundation API.\n\nEndpoint: GET /verses/by_juz/{juz_number}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  juz_number: Required parameter (e.g., \"1\")\nOptional Query Parameters:\n  language: Language to fetch word-by-word translation in a specific language.\n  words: Include words of each ayah? Use this to fetch word-by-word translation and transliteration.\n\n0 or false will not include words.\n\n1 or true will include the words.\n\nDefault is false.\n  translations: comma separated ids of translations to load for each ayah. See [/resources/translations](/docs/content_apis_versioned/translations) for available ids. Use translations=57 to include full-ayah transliteration.\n  audio: Ayah-by-ayah recitation ID from [/resources/recitations](/docs/content_apis_versioned/recitations). Chapter-reciter IDs from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters) are not supported.\n  tafsirs: Comma separated ids of tafsirs to load for each ayah if you want to load tafsirs. See [/resources/tafsirs](/docs/content_apis_versioned/tafsirs) for available ids.\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/verses/by_juz/{juz_number}?{queryParams}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts juz_number and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/verses/by_hizb/{hizb_number}": {
      "get": {
        "tags": ["Verses"],
        "summary": "By Hizb number",
        "description": "Get all verses from a specific Hizb( half(1-60).",
        "operationId": "verses-by_hizb_number",
        "parameters": [
          {
            "name": "hizb_number",
            "in": "path",
            "description": "Hizb number(1-60)",
            "required": true,
            "schema": {
              "maximum": 60,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "language",
            "in": "query",
            "description": "Language to fetch word-by-word translation in a specific language.",
            "schema": {
              "type": "string",
              "default": "en"
            }
          },
          {
            "name": "words",
            "in": "query",
            "description": "Include words of each ayah? Use this to fetch word-by-word translation and transliteration.\n\n0 or false will not include words.\n\n1 or true will include the words.\n\nDefault is false.",
            "schema": {
              "type": "string",
              "default": "false",
              "enum": ["true", "false"]
            }
          },
          {
            "name": "translations",
            "in": "query",
            "description": "comma separated ids of translations to load for each ayah. See [/resources/translations](/docs/content_apis_versioned/translations) for available ids. Use translations=57 to include full-ayah transliteration.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "audio",
            "in": "query",
            "description": "Ayah-by-ayah recitation ID from [/resources/recitations](/docs/content_apis_versioned/recitations). Chapter-reciter IDs from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters) are not supported.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "tafsirs",
            "in": "query",
            "description": "Comma separated ids of tafsirs to load for each ayah if you want to load tafsirs. See [/resources/tafsirs](/docs/content_apis_versioned/tafsirs) for available ids.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "word_fields",
            "in": "query",
            "description": "Comma-separated list of word-level fields to include in response. [See full field reference](/docs/api/field-reference#word-level-fields).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "translation_fields",
            "in": "query",
            "description": "Comma separated list of translation fields if you want to add more fields for each translation. [See full field reference](/docs/api/field-reference#translation-fields).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tafsir_fields",
            "in": "query",
            "description": "Comma separated list of tafsir fields if you want to add more fields for each tafsir. [See full field reference](/docs/api/field-reference#tafsir-fields).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated list of verse-level fields to include in response. Use `fields=text_uthmani,text_indopak` to include Arabic text. [See full field reference](/docs/api/field-reference#verse-level-fields).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "For paginating within the result",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "records per api call, you can get maximum 50 records. ",
            "schema": {
              "maximum": 50,
              "minimum": 1,
              "type": "integer",
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "verses": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/verse"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/pagination"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "verses": [
                        {
                          "id": 1,
                          "verse_number": 1,
                          "page_number": 1,
                          "verse_key": "1:1",
                          "juz_number": 1,
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "sajdah_type": null,
                          "sajdah_number": null,
                          "words": [
                            {
                              "id": 1,
                              "position": 1,
                              "audio_url": "wbw/001_001_001.mp3",
                              "char_type_name": "word",
                              "line_number": 2,
                              "page_number": 1,
                              "code_v1": "&#xfb51;",
                              "translation": {
                                "text": "In (the) name",
                                "language_name": "english"
                              },
                              "transliteration": {
                                "text": "bis'mi",
                                "language_name": "english"
                              }
                            }
                          ],
                          "translations": [
                            {
                              "resource_id": 131,
                              "text": "In the Name of Allah—the Most Compassionate, Most Merciful."
                            }
                          ],
                          "tafsirs": [
                            {
                              "id": 82641,
                              "language_name": "english",
                              "name": "Tafsir Ibn Kathir",
                              "text": "<h2 class=\"title\">Which was revealed in Makkah</h2><h2 class=\"title\">The Meaning of Al-Fatihah and its Various Names</h2>"
                            }
                          ]
                        }
                      ],
                      "pagination": {
                        "per_page": 1,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 7,
                        "total_records": 7
                      }
                    }
                  },
                  "compact_fields": {
                    "summary": "Compact verse fields for navigation views",
                    "value": {
                      "verses": [
                        {
                          "id": 255,
                          "chapter_id": 2,
                          "verse_number": 255,
                          "verse_key": "2:255",
                          "verse_index": 262,
                          "juz_number": 3,
                          "hizb_number": 5,
                          "rub_el_hizb_number": 19,
                          "page_number": 42
                        }
                      ],
                      "pagination": {
                        "per_page": 1,
                        "current_page": 1,
                        "next_page": null,
                        "total_pages": 1,
                        "total_records": 1
                      }
                    }
                  },
                  "with_words_translation_tafsir_audio": {
                    "summary": "Verse payload with words, translation, tafsir, and audio",
                    "value": {
                      "verses": [
                        {
                          "id": 1,
                          "chapter_id": 1,
                          "verse_number": 1,
                          "page_number": 1,
                          "verse_key": "1:1",
                          "juz_number": 1,
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "sajdah_type": null,
                          "sajdah_number": null,
                          "audio": {
                            "verse_key": "1:1",
                            "url": "https://verses.quran.foundation/Alafasy/mp3/001001.mp3"
                          },
                          "words": [
                            {
                              "id": 1,
                              "position": 1,
                              "audio_url": "wbw/001_001_001.mp3",
                              "char_type_name": "word",
                              "line_number": 2,
                              "page_number": 1,
                              "code_v1": "&#xfb51;",
                              "translation": {
                                "text": "In (the) name",
                                "language_name": "english"
                              },
                              "transliteration": {
                                "text": "bis'mi",
                                "language_name": "english"
                              }
                            }
                          ],
                          "translations": [
                            {
                              "resource_id": 131,
                              "resource_name": "Dr. Mustafa Khattab, the Clear Quran",
                              "text": "In the Name of Allah?the Most Compassionate, Most Merciful."
                            }
                          ],
                          "tafsirs": [
                            {
                              "id": 82641,
                              "resource_id": 169,
                              "language_name": "english",
                              "name": "Tafsir Ibn Kathir",
                              "text": "<h2 class=\"title\">The Meaning of Al-Fatihah and its Various Names</h2>"
                            }
                          ]
                        }
                      ],
                      "pagination": {
                        "per_page": 1,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 7,
                        "total_records": 7
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// By Hizb number\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(hizb_number, options = {}) {\n  const response = await axios.get(\n    `${API_BASE_URL}/verses/by_hizb/${hizb_number}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      },\n      params: options\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(\"1\", {\"language\":\"en\",\"words\":\"true\",\"translations\":\"131\"})\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# By Hizb number\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(hizb_number, language=None, words=None, translations=None):\n    params = {k: v for k, v in {'language': language, 'words': words, 'translations': translations}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/verses/by_hizb/{hizb_number}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(\"1\", language=\"en\", words=\"true\", translations=\"131\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// By Hizb number\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(hizb_number string, params map[string]string) (string, error) {\n  path := fmt.Sprintf(\"/verses/by_hizb/%s\", hizb_number)\n  endpoint := API_BASE_URL + path\n  if params != nil && len(params) > 0 {\n    values := url.Values{}\n    for k, v := range params {\n      values.Set(k, v)\n    }\n    endpoint = endpoint + \"?\" + values.Encode()\n  }\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  params := map[string]string{\"language\": \"en\", \"words\": \"true\", \"translations\": \"131\"}\n  data, err := callApi(\"1\", params)\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# By Hizb number\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(hizb_number, params = {})\n  path = \"/verses/by_hizb/#{hizb_number}\"\n  uri = URI(API_BASE_URL + path)\n  uri.query = URI.encode_www_form(params) if params && !params.empty?\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\nparams = { \"language\" => \"en\", \"words\" => \"true\", \"translations\" => \"131\" }\ndata = call_api(\"1\", params)\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// By Hizb number\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string hizb_number, Dictionary<string, string> query = null)\n{\n    var path = $@\"/verses/by_hizb/{hizb_number}\";\n    var url = API_BASE_URL + path;\n    if (query != null && query.Count > 0)\n    {\n        var queryString = string.Join(\"&\", query.Select(kvp =>\n            $\"{Uri.EscapeDataString(kvp.Key)}={Uri.EscapeDataString(kvp.Value)}\"));\n        url = $\"{url}?{queryString}\";\n    }\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar query = new Dictionary<string, string> { {\"language\", \"en\"}, {\"words\", \"true\"}, {\"translations\", \"131\"} };\nvar data = await CallApiAsync(\"1\", query);\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# By Hizb number\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($hizb_number, $params = []) {\n  $path = sprintf(\"/verses/by_hizb/%s\", $hizb_number);\n  $url = API_BASE_URL . $path;\n  if (!empty($params)) {\n    $url .= '?' . http_build_query($params);\n  }\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$params = ['language' => 'en', 'words' => 'true', 'translations' => '131'];\n$data = callApi(\"1\", $params);\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// By Hizb number\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String hizb_number, Map<String, String> params) throws IOException {\n    String path = String.format(\"/verses/by_hizb/%s\", hizb_number);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    if (params != null) {\n      for (Map.Entry<String, String> entry : params.entrySet()) {\n        urlBuilder.addQueryParameter(entry.getKey(), entry.getValue());\n      }\n    }\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    Map<String, String> params = new HashMap<>();\n    params.put(\"language\", \"en\");\n    params.put(\"words\", \"true\");\n    params.put(\"translations\", \"131\");\n    String data = callApi(\"1\", params);\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# By Hizb number\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$hizb_number, [hashtable]$params = @{}) {\n  $path = \"/verses/by_hizb/$hizb_number\"\n  $url = \"$API_BASE_URL$path\"\n  if ($params.Count -gt 0) {\n    $query = ($params.GetEnumerator() | ForEach-Object {\n      \"$($_.Key)=$([System.Uri]::EscapeDataString([string]$_.Value))\"\n    }) -join \"&\"\n    $url = \"$url?$query\"\n  }\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$params = @{ language = \"en\"; words = \"true\"; translations = \"131\" }\n$data = Call-Api(\"1\", $params)\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# By Hizb number\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/verses/by_hizb/1?language=en&words=true&translations=131' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to by hizb number using the Quran Foundation API.\n\nEndpoint: GET /verses/by_hizb/{hizb_number}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  hizb_number: Hizb number(1-60) (e.g., \"1\")\nOptional Query Parameters:\n  language: Language to fetch word-by-word translation in a specific language.\n  words: Include words of each ayah? Use this to fetch word-by-word translation and transliteration.\n\n0 or false will not include words.\n\n1 or true will include the words.\n\nDefault is false.\n  translations: comma separated ids of translations to load for each ayah. See [/resources/translations](/docs/content_apis_versioned/translations) for available ids. Use translations=57 to include full-ayah transliteration.\n  audio: Ayah-by-ayah recitation ID from [/resources/recitations](/docs/content_apis_versioned/recitations). Chapter-reciter IDs from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters) are not supported.\n  tafsirs: Comma separated ids of tafsirs to load for each ayah if you want to load tafsirs. See [/resources/tafsirs](/docs/content_apis_versioned/tafsirs) for available ids.\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/verses/by_hizb/{hizb_number}?{queryParams}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts hizb_number and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/verses/by_rub/{rub_el_hizb_number}": {
      "get": {
        "tags": ["Verses"],
        "summary": "By Rub el Hizb number",
        "description": "Get all verses of a specific Rub el Hizb number(1-240).",
        "operationId": "verses-by_rub_el_hizb_number",
        "parameters": [
          {
            "name": "rub_el_hizb_number",
            "in": "path",
            "description": "Rub el Hizb number(1-240)",
            "required": true,
            "schema": {
              "maximum": 240,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "language",
            "in": "query",
            "description": "Language to fetch word-by-word translation in a specific language.",
            "schema": {
              "type": "string",
              "default": "en"
            }
          },
          {
            "name": "words",
            "in": "query",
            "description": "Include words of each ayah? Use this to fetch word-by-word translation and transliteration.\n\n0 or false will not include words.\n\n1 or true will include the words.\n\nDefault is false.",
            "schema": {
              "type": "string",
              "default": "false",
              "enum": ["true", "false"]
            }
          },
          {
            "name": "translations",
            "in": "query",
            "description": "comma separated ids of translations to load for each ayah. See [/resources/translations](/docs/content_apis_versioned/translations) for available ids. Use translations=57 to include full-ayah transliteration.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "audio",
            "in": "query",
            "description": "Ayah-by-ayah recitation ID from [/resources/recitations](/docs/content_apis_versioned/recitations). Chapter-reciter IDs from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters) are not supported.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "tafsirs",
            "in": "query",
            "description": "Comma separated ids of tafsirs to load for each ayah if you want to load tafsirs. See [/resources/tafsirs](/docs/content_apis_versioned/tafsirs) for available ids.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "word_fields",
            "in": "query",
            "description": "Comma-separated list of word-level fields to include in response. [See full field reference](/docs/api/field-reference#word-level-fields).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "translation_fields",
            "in": "query",
            "description": "Comma separated list of translation fields if you want to add more fields for each translation. [See full field reference](/docs/api/field-reference#translation-fields).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tafsir_fields",
            "in": "query",
            "description": "Comma separated list of tafsir fields if you want to add more fields for each tafsir. [See full field reference](/docs/api/field-reference#tafsir-fields).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated list of verse-level fields to include in response. Use `fields=text_uthmani,text_indopak` to include Arabic text. [See full field reference](/docs/api/field-reference#verse-level-fields).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "verses": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/verse"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/pagination"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "verses": [
                        {
                          "id": 1,
                          "verse_number": 1,
                          "page_number": 1,
                          "verse_key": "1:1",
                          "juz_number": 1,
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "sajdah_type": null,
                          "sajdah_number": null,
                          "words": [
                            {
                              "id": 1,
                              "position": 1,
                              "audio_url": "wbw/001_001_001.mp3",
                              "char_type_name": "word",
                              "line_number": 2,
                              "page_number": 1,
                              "code_v1": "&#xfb51;",
                              "translation": {
                                "text": "In (the) name",
                                "language_name": "english"
                              },
                              "transliteration": {
                                "text": "bis'mi",
                                "language_name": "english"
                              }
                            }
                          ],
                          "translations": [
                            {
                              "resource_id": 131,
                              "text": "In the Name of Allah—the Most Compassionate, Most Merciful."
                            }
                          ],
                          "tafsirs": [
                            {
                              "id": 82641,
                              "language_name": "english",
                              "name": "Tafsir Ibn Kathir",
                              "text": "<h2 class=\"title\">Which was revealed in Makkah</h2><h2 class=\"title\">The Meaning of Al-Fatihah and its Various Names</h2>"
                            }
                          ]
                        }
                      ],
                      "pagination": {
                        "per_page": 1,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 7,
                        "total_records": 7
                      }
                    }
                  },
                  "compact_fields": {
                    "summary": "Compact verse fields for navigation views",
                    "value": {
                      "verses": [
                        {
                          "id": 255,
                          "chapter_id": 2,
                          "verse_number": 255,
                          "verse_key": "2:255",
                          "verse_index": 262,
                          "juz_number": 3,
                          "hizb_number": 5,
                          "rub_el_hizb_number": 19,
                          "page_number": 42
                        }
                      ],
                      "pagination": {
                        "per_page": 1,
                        "current_page": 1,
                        "next_page": null,
                        "total_pages": 1,
                        "total_records": 1
                      }
                    }
                  },
                  "with_words_translation_tafsir_audio": {
                    "summary": "Verse payload with words, translation, tafsir, and audio",
                    "value": {
                      "verses": [
                        {
                          "id": 1,
                          "chapter_id": 1,
                          "verse_number": 1,
                          "page_number": 1,
                          "verse_key": "1:1",
                          "juz_number": 1,
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "sajdah_type": null,
                          "sajdah_number": null,
                          "audio": {
                            "verse_key": "1:1",
                            "url": "https://verses.quran.foundation/Alafasy/mp3/001001.mp3"
                          },
                          "words": [
                            {
                              "id": 1,
                              "position": 1,
                              "audio_url": "wbw/001_001_001.mp3",
                              "char_type_name": "word",
                              "line_number": 2,
                              "page_number": 1,
                              "code_v1": "&#xfb51;",
                              "translation": {
                                "text": "In (the) name",
                                "language_name": "english"
                              },
                              "transliteration": {
                                "text": "bis'mi",
                                "language_name": "english"
                              }
                            }
                          ],
                          "translations": [
                            {
                              "resource_id": 131,
                              "resource_name": "Dr. Mustafa Khattab, the Clear Quran",
                              "text": "In the Name of Allah?the Most Compassionate, Most Merciful."
                            }
                          ],
                          "tafsirs": [
                            {
                              "id": 82641,
                              "resource_id": 169,
                              "language_name": "english",
                              "name": "Tafsir Ibn Kathir",
                              "text": "<h2 class=\"title\">The Meaning of Al-Fatihah and its Various Names</h2>"
                            }
                          ]
                        }
                      ],
                      "pagination": {
                        "per_page": 1,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 7,
                        "total_records": 7
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// By Rub el Hizb number\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(rub_el_hizb_number, options = {}) {\n  const response = await axios.get(\n    `${API_BASE_URL}/verses/by_rub/${rub_el_hizb_number}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      },\n      params: options\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(\"1\", {\"language\":\"en\",\"words\":\"true\",\"translations\":\"131\"})\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# By Rub el Hizb number\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(rub_el_hizb_number, language=None, words=None, translations=None):\n    params = {k: v for k, v in {'language': language, 'words': words, 'translations': translations}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/verses/by_rub/{rub_el_hizb_number}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(\"1\", language=\"en\", words=\"true\", translations=\"131\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// By Rub el Hizb number\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(rub_el_hizb_number string, params map[string]string) (string, error) {\n  path := fmt.Sprintf(\"/verses/by_rub/%s\", rub_el_hizb_number)\n  endpoint := API_BASE_URL + path\n  if params != nil && len(params) > 0 {\n    values := url.Values{}\n    for k, v := range params {\n      values.Set(k, v)\n    }\n    endpoint = endpoint + \"?\" + values.Encode()\n  }\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  params := map[string]string{\"language\": \"en\", \"words\": \"true\", \"translations\": \"131\"}\n  data, err := callApi(\"1\", params)\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# By Rub el Hizb number\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(rub_el_hizb_number, params = {})\n  path = \"/verses/by_rub/#{rub_el_hizb_number}\"\n  uri = URI(API_BASE_URL + path)\n  uri.query = URI.encode_www_form(params) if params && !params.empty?\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\nparams = { \"language\" => \"en\", \"words\" => \"true\", \"translations\" => \"131\" }\ndata = call_api(\"1\", params)\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// By Rub el Hizb number\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string rub_el_hizb_number, Dictionary<string, string> query = null)\n{\n    var path = $@\"/verses/by_rub/{rub_el_hizb_number}\";\n    var url = API_BASE_URL + path;\n    if (query != null && query.Count > 0)\n    {\n        var queryString = string.Join(\"&\", query.Select(kvp =>\n            $\"{Uri.EscapeDataString(kvp.Key)}={Uri.EscapeDataString(kvp.Value)}\"));\n        url = $\"{url}?{queryString}\";\n    }\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar query = new Dictionary<string, string> { {\"language\", \"en\"}, {\"words\", \"true\"}, {\"translations\", \"131\"} };\nvar data = await CallApiAsync(\"1\", query);\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# By Rub el Hizb number\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($rub_el_hizb_number, $params = []) {\n  $path = sprintf(\"/verses/by_rub/%s\", $rub_el_hizb_number);\n  $url = API_BASE_URL . $path;\n  if (!empty($params)) {\n    $url .= '?' . http_build_query($params);\n  }\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$params = ['language' => 'en', 'words' => 'true', 'translations' => '131'];\n$data = callApi(\"1\", $params);\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// By Rub el Hizb number\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String rub_el_hizb_number, Map<String, String> params) throws IOException {\n    String path = String.format(\"/verses/by_rub/%s\", rub_el_hizb_number);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    if (params != null) {\n      for (Map.Entry<String, String> entry : params.entrySet()) {\n        urlBuilder.addQueryParameter(entry.getKey(), entry.getValue());\n      }\n    }\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    Map<String, String> params = new HashMap<>();\n    params.put(\"language\", \"en\");\n    params.put(\"words\", \"true\");\n    params.put(\"translations\", \"131\");\n    String data = callApi(\"1\", params);\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# By Rub el Hizb number\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$rub_el_hizb_number, [hashtable]$params = @{}) {\n  $path = \"/verses/by_rub/$rub_el_hizb_number\"\n  $url = \"$API_BASE_URL$path\"\n  if ($params.Count -gt 0) {\n    $query = ($params.GetEnumerator() | ForEach-Object {\n      \"$($_.Key)=$([System.Uri]::EscapeDataString([string]$_.Value))\"\n    }) -join \"&\"\n    $url = \"$url?$query\"\n  }\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$params = @{ language = \"en\"; words = \"true\"; translations = \"131\" }\n$data = Call-Api(\"1\", $params)\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# By Rub el Hizb number\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/verses/by_rub/1?language=en&words=true&translations=131' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to by rub el hizb number using the Quran Foundation API.\n\nEndpoint: GET /verses/by_rub/{rub_el_hizb_number}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  rub_el_hizb_number: Rub el Hizb number(1-240) (e.g., \"1\")\nOptional Query Parameters:\n  language: Language to fetch word-by-word translation in a specific language.\n  words: Include words of each ayah? Use this to fetch word-by-word translation and transliteration.\n\n0 or false will not include words.\n\n1 or true will include the words.\n\nDefault is false.\n  translations: comma separated ids of translations to load for each ayah. See [/resources/translations](/docs/content_apis_versioned/translations) for available ids. Use translations=57 to include full-ayah transliteration.\n  audio: Ayah-by-ayah recitation ID from [/resources/recitations](/docs/content_apis_versioned/recitations). Chapter-reciter IDs from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters) are not supported.\n  tafsirs: Comma separated ids of tafsirs to load for each ayah if you want to load tafsirs. See [/resources/tafsirs](/docs/content_apis_versioned/tafsirs) for available ids.\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/verses/by_rub/{rub_el_hizb_number}?{queryParams}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts rub_el_hizb_number and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/verses/by_manzil/{manzil_number}": {
      "get": {
        "tags": ["Verses"],
        "summary": "By Manzil",
        "description": "Get all verses from a specific manzil (1-7).",
        "operationId": "verses-by_manzil_number",
        "parameters": [
          {
            "name": "manzil_number",
            "in": "path",
            "description": "Manzil number (1-7)",
            "required": true,
            "schema": {
              "maximum": 7,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "language",
            "in": "query",
            "description": "Language to fetch word-by-word translation in a specific language.",
            "schema": {
              "type": "string",
              "default": "en"
            }
          },
          {
            "name": "words",
            "in": "query",
            "description": "Include words of each ayah? Use this to fetch word-by-word translation and transliteration.\n\n0 or false will not include words.\n\n1 or true will include the words.\n\nDefault is false.",
            "schema": {
              "type": "string",
              "default": "false",
              "enum": ["true", "false"]
            }
          },
          {
            "name": "translations",
            "in": "query",
            "description": "comma separated ids of translations to load for each ayah. See [/resources/translations](/docs/content_apis_versioned/translations) for available ids. Use translations=57 to include full-ayah transliteration.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "audio",
            "in": "query",
            "description": "Ayah-by-ayah recitation ID from [/resources/recitations](/docs/content_apis_versioned/recitations). Chapter-reciter IDs from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters) are not supported.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "tafsirs",
            "in": "query",
            "description": "Comma separated ids of tafsirs to load for each ayah if you want to load tafsirs. See [/resources/tafsirs](/docs/content_apis_versioned/tafsirs) for available ids.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "word_fields",
            "in": "query",
            "description": "Comma-separated list of word-level fields to include in response. [See full field reference](/docs/api/field-reference#word-level-fields).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "translation_fields",
            "in": "query",
            "description": "Comma separated list of translation fields if you want to add more fields for each translation. [See full field reference](/docs/api/field-reference#translation-fields).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tafsir_fields",
            "in": "query",
            "description": "Comma separated list of tafsir fields if you want to add more fields for each tafsir. [See full field reference](/docs/api/field-reference#tafsir-fields).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated list of verse-level fields to include in response. Use `fields=text_uthmani,text_indopak` to include Arabic text. [See full field reference](/docs/api/field-reference#verse-level-fields).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "For paginating within the result",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "records per api call, you can get maximum 50 records. ",
            "schema": {
              "maximum": 50,
              "minimum": 1,
              "type": "integer",
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "verses": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/verse"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/pagination"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "verses": [
                        {
                          "id": 1,
                          "verse_number": 1,
                          "page_number": 1,
                          "verse_key": "1:1",
                          "juz_number": 1,
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "ruku_number": 1,
                          "manzil_number": 1,
                          "sajdah_type": null,
                          "sajdah_number": null,
                          "words": [
                            {
                              "id": 1,
                              "position": 1,
                              "audio_url": "wbw/001_001_001.mp3",
                              "char_type_name": "word",
                              "line_number": 2,
                              "page_number": 1,
                              "code_v1": "&#xfb51;",
                              "translation": {
                                "text": "In (the) name",
                                "language_name": "english"
                              },
                              "transliteration": {
                                "text": "bis'mi",
                                "language_name": "english"
                              }
                            }
                          ],
                          "translations": [
                            {
                              "resource_id": 131,
                              "text": "In the Name of Allah—the Most Compassionate, Most Merciful."
                            }
                          ],
                          "tafsirs": [
                            {
                              "id": 82641,
                              "language_name": "english",
                              "name": "Tafsir Ibn Kathir",
                              "text": "<h2 class=\"title\">Which was revealed in Makkah</h2><h2 class=\"title\">The Meaning of Al-Fatihah and its Various Names</h2>"
                            }
                          ]
                        }
                      ],
                      "pagination": {
                        "per_page": 1,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 7,
                        "total_records": 7
                      }
                    }
                  },
                  "compact_fields": {
                    "summary": "Compact verse fields for navigation views",
                    "value": {
                      "verses": [
                        {
                          "id": 255,
                          "chapter_id": 2,
                          "verse_number": 255,
                          "verse_key": "2:255",
                          "verse_index": 262,
                          "juz_number": 3,
                          "hizb_number": 5,
                          "rub_el_hizb_number": 19,
                          "page_number": 42
                        }
                      ],
                      "pagination": {
                        "per_page": 1,
                        "current_page": 1,
                        "next_page": null,
                        "total_pages": 1,
                        "total_records": 1
                      }
                    }
                  },
                  "with_words_translation_tafsir_audio": {
                    "summary": "Verse payload with words, translation, tafsir, and audio",
                    "value": {
                      "verses": [
                        {
                          "id": 1,
                          "chapter_id": 1,
                          "verse_number": 1,
                          "page_number": 1,
                          "verse_key": "1:1",
                          "juz_number": 1,
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "sajdah_type": null,
                          "sajdah_number": null,
                          "audio": {
                            "verse_key": "1:1",
                            "url": "https://verses.quran.foundation/Alafasy/mp3/001001.mp3"
                          },
                          "words": [
                            {
                              "id": 1,
                              "position": 1,
                              "audio_url": "wbw/001_001_001.mp3",
                              "char_type_name": "word",
                              "line_number": 2,
                              "page_number": 1,
                              "code_v1": "&#xfb51;",
                              "translation": {
                                "text": "In (the) name",
                                "language_name": "english"
                              },
                              "transliteration": {
                                "text": "bis'mi",
                                "language_name": "english"
                              }
                            }
                          ],
                          "translations": [
                            {
                              "resource_id": 131,
                              "resource_name": "Dr. Mustafa Khattab, the Clear Quran",
                              "text": "In the Name of Allah?the Most Compassionate, Most Merciful."
                            }
                          ],
                          "tafsirs": [
                            {
                              "id": 82641,
                              "resource_id": 169,
                              "language_name": "english",
                              "name": "Tafsir Ibn Kathir",
                              "text": "<h2 class=\"title\">The Meaning of Al-Fatihah and its Various Names</h2>"
                            }
                          ]
                        }
                      ],
                      "pagination": {
                        "per_page": 1,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 7,
                        "total_records": 7
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// By Manzil\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(manzil_number, options = {}) {\n  const response = await axios.get(\n    `${API_BASE_URL}/verses/by_manzil/${manzil_number}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      },\n      params: options\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(\"1\", {\"language\":\"en\",\"words\":\"true\",\"translations\":\"131\"})\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# By Manzil\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(manzil_number, language=None, words=None, translations=None):\n    params = {k: v for k, v in {'language': language, 'words': words, 'translations': translations}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/verses/by_manzil/{manzil_number}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(\"1\", language=\"en\", words=\"true\", translations=\"131\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// By Manzil\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(manzil_number string, params map[string]string) (string, error) {\n  path := fmt.Sprintf(\"/verses/by_manzil/%s\", manzil_number)\n  endpoint := API_BASE_URL + path\n  if params != nil && len(params) > 0 {\n    values := url.Values{}\n    for k, v := range params {\n      values.Set(k, v)\n    }\n    endpoint = endpoint + \"?\" + values.Encode()\n  }\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  params := map[string]string{\"language\": \"en\", \"words\": \"true\", \"translations\": \"131\"}\n  data, err := callApi(\"1\", params)\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# By Manzil\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(manzil_number, params = {})\n  path = \"/verses/by_manzil/#{manzil_number}\"\n  uri = URI(API_BASE_URL + path)\n  uri.query = URI.encode_www_form(params) if params && !params.empty?\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\nparams = { \"language\" => \"en\", \"words\" => \"true\", \"translations\" => \"131\" }\ndata = call_api(\"1\", params)\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// By Manzil\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string manzil_number, Dictionary<string, string> query = null)\n{\n    var path = $@\"/verses/by_manzil/{manzil_number}\";\n    var url = API_BASE_URL + path;\n    if (query != null && query.Count > 0)\n    {\n        var queryString = string.Join(\"&\", query.Select(kvp =>\n            $\"{Uri.EscapeDataString(kvp.Key)}={Uri.EscapeDataString(kvp.Value)}\"));\n        url = $\"{url}?{queryString}\";\n    }\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar query = new Dictionary<string, string> { {\"language\", \"en\"}, {\"words\", \"true\"}, {\"translations\", \"131\"} };\nvar data = await CallApiAsync(\"1\", query);\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# By Manzil\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($manzil_number, $params = []) {\n  $path = sprintf(\"/verses/by_manzil/%s\", $manzil_number);\n  $url = API_BASE_URL . $path;\n  if (!empty($params)) {\n    $url .= '?' . http_build_query($params);\n  }\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$params = ['language' => 'en', 'words' => 'true', 'translations' => '131'];\n$data = callApi(\"1\", $params);\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// By Manzil\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String manzil_number, Map<String, String> params) throws IOException {\n    String path = String.format(\"/verses/by_manzil/%s\", manzil_number);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    if (params != null) {\n      for (Map.Entry<String, String> entry : params.entrySet()) {\n        urlBuilder.addQueryParameter(entry.getKey(), entry.getValue());\n      }\n    }\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    Map<String, String> params = new HashMap<>();\n    params.put(\"language\", \"en\");\n    params.put(\"words\", \"true\");\n    params.put(\"translations\", \"131\");\n    String data = callApi(\"1\", params);\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# By Manzil\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$manzil_number, [hashtable]$params = @{}) {\n  $path = \"/verses/by_manzil/$manzil_number\"\n  $url = \"$API_BASE_URL$path\"\n  if ($params.Count -gt 0) {\n    $query = ($params.GetEnumerator() | ForEach-Object {\n      \"$($_.Key)=$([System.Uri]::EscapeDataString([string]$_.Value))\"\n    }) -join \"&\"\n    $url = \"$url?$query\"\n  }\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$params = @{ language = \"en\"; words = \"true\"; translations = \"131\" }\n$data = Call-Api(\"1\", $params)\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# By Manzil\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/verses/by_manzil/1?language=en&words=true&translations=131' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to by manzil using the Quran Foundation API.\n\nEndpoint: GET /verses/by_manzil/{manzil_number}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  manzil_number: Manzil number (1-7) (e.g., \"1\")\nOptional Query Parameters:\n  language: Language to fetch word-by-word translation in a specific language.\n  words: Include words of each ayah? Use this to fetch word-by-word translation and transliteration.\n\n0 or false will not include words.\n\n1 or true will include the words.\n\nDefault is false.\n  translations: comma separated ids of translations to load for each ayah. See [/resources/translations](/docs/content_apis_versioned/translations) for available ids. Use translations=57 to include full-ayah transliteration.\n  audio: Ayah-by-ayah recitation ID from [/resources/recitations](/docs/content_apis_versioned/recitations). Chapter-reciter IDs from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters) are not supported.\n  tafsirs: Comma separated ids of tafsirs to load for each ayah if you want to load tafsirs. See [/resources/tafsirs](/docs/content_apis_versioned/tafsirs) for available ids.\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/verses/by_manzil/{manzil_number}?{queryParams}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts manzil_number and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/verses/by_ruku/{ruku_number}": {
      "get": {
        "tags": ["Verses"],
        "summary": "By Ruku",
        "description": "Get all verses in a specific ruku (1-558).",
        "operationId": "verses-by_ruku_number",
        "parameters": [
          {
            "name": "ruku_number",
            "in": "path",
            "description": "Ruku number (1-558)",
            "required": true,
            "schema": {
              "maximum": 558,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "language",
            "in": "query",
            "description": "Language to fetch word-by-word translation in a specific language.",
            "schema": {
              "type": "string",
              "default": "en"
            }
          },
          {
            "name": "words",
            "in": "query",
            "description": "Include words of each ayah? Use this to fetch word-by-word translation and transliteration.\n\n0 or false will not include words.\n\n1 or true will include the words.\n\nDefault is false.",
            "schema": {
              "type": "string",
              "default": "false",
              "enum": ["true", "false"]
            }
          },
          {
            "name": "translations",
            "in": "query",
            "description": "comma separated ids of translations to load for each ayah. See [/resources/translations](/docs/content_apis_versioned/translations) for available ids. Use translations=57 to include full-ayah transliteration.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "audio",
            "in": "query",
            "description": "Ayah-by-ayah recitation ID from [/resources/recitations](/docs/content_apis_versioned/recitations). Chapter-reciter IDs from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters) are not supported.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "tafsirs",
            "in": "query",
            "description": "Comma separated ids of tafsirs to load for each ayah if you want to load tafsirs. See [/resources/tafsirs](/docs/content_apis_versioned/tafsirs) for available ids.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "word_fields",
            "in": "query",
            "description": "Comma-separated list of word-level fields to include in response. [See full field reference](/docs/api/field-reference#word-level-fields).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "translation_fields",
            "in": "query",
            "description": "Comma separated list of translation fields if you want to add more fields for each translation. [See full field reference](/docs/api/field-reference#translation-fields).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tafsir_fields",
            "in": "query",
            "description": "Comma separated list of tafsir fields if you want to add more fields for each tafsir. [See full field reference](/docs/api/field-reference#tafsir-fields).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated list of verse-level fields to include in response. Use `fields=text_uthmani,text_indopak` to include Arabic text. [See full field reference](/docs/api/field-reference#verse-level-fields).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "verses": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/verse"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/pagination"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "verses": [
                        {
                          "id": 8,
                          "verse_number": 1,
                          "verse_key": "2:1",
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "ruku_number": 2,
                          "manzil_number": 1,
                          "sajdah_number": null,
                          "text_indopak": "الٓمّٓۚ‏",
                          "page_number": 2,
                          "juz_number": 1,
                          "audio": {
                            "url": "Alafasy/mp3/002001.mp3",
                            "segments": [[0, 1, 30, 7080]]
                          }
                        },
                        {
                          "id": 9,
                          "verse_number": 2,
                          "verse_key": "2:2",
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "ruku_number": 2,
                          "manzil_number": 1,
                          "sajdah_number": null,
                          "text_indopak": "ذٰلِكَ الۡڪِتٰبُ لَا رَيۡبَۛۚۖ فِيۡهِۛۚ هُدًى لِّلۡمُتَّقِيۡنَۙ‏",
                          "page_number": 2,
                          "juz_number": 1,
                          "audio": {
                            "url": "Alafasy/mp3/002002.mp3",
                            "segments": [
                              [0, 1, 150, 860],
                              [1, 2, 870, 1820],
                              [2, 3, 1830, 2130],
                              [3, 4, 2140, 2680],
                              [4, 5, 2690, 4980],
                              [5, 6, 4990, 5180],
                              [6, 7, 5190, 8610]
                            ]
                          }
                        },
                        {
                          "id": 10,
                          "verse_number": 3,
                          "verse_key": "2:3",
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "ruku_number": 2,
                          "manzil_number": 1,
                          "sajdah_number": null,
                          "text_indopak": "الَّذِيۡنَ يُؤۡمِنُوۡنَ بِالۡغَيۡبِ وَ يُقِيۡمُوۡنَ الصَّلٰوةَ وَمِمَّا رَزَقۡنٰهُمۡ يُن۫فِقُوۡنَۙ‏",
                          "page_number": 2,
                          "juz_number": 1,
                          "audio": {
                            "url": "Alafasy/mp3/002003.mp3",
                            "segments": [
                              [0, 1, 30, 1010],
                              [1, 2, 1020, 2120],
                              [2, 3, 2130, 3070],
                              [3, 4, 3080, 4200],
                              [4, 5, 4210, 5130],
                              [5, 6, 5140, 6570],
                              [6, 7, 6580, 7930],
                              [7, 8, 7940, 11060]
                            ]
                          }
                        },
                        {
                          "id": 11,
                          "verse_number": 4,
                          "verse_key": "2:4",
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "ruku_number": 2,
                          "manzil_number": 1,
                          "sajdah_number": null,
                          "text_indopak": "وَالَّذِيۡنَ يُؤۡمِنُوۡنَ بِمَۤا اُنۡزِلَ اِلَيۡكَ وَمَاۤ اُنۡزِلَ مِنۡ قَبۡلِكَۚ وَبِالۡاٰخِرَةِ هُمۡ يُوۡقِنُوۡنَؕ‏",
                          "page_number": 2,
                          "juz_number": 1,
                          "audio": {
                            "url": "Alafasy/mp3/002004.mp3",
                            "segments": [
                              [0, 1, 50, 1120],
                              [1, 2, 1130, 2190],
                              [2, 3, 2200, 3920],
                              [3, 4, 3930, 5250],
                              [4, 5, 5260, 5960],
                              [5, 6, 5970, 6180],
                              [6, 7, 6190, 9020],
                              [7, 8, 9030, 9830],
                              [8, 9, 9840, 10640],
                              [9, 10, 10650, 12110],
                              [10, 11, 12120, 12460],
                              [11, 12, 12470, 15480]
                            ]
                          }
                        },
                        {
                          "id": 12,
                          "verse_number": 5,
                          "verse_key": "2:5",
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "ruku_number": 2,
                          "manzil_number": 1,
                          "sajdah_number": null,
                          "text_indopak": "اُولٰٓٮِٕكَ عَلٰى هُدًى مِّنۡ رَّبِّهِمۡ​ وَاُولٰٓٮِٕكَ هُمُ الۡمُفۡلِحُوۡنَ‏ ﻿﻿",
                          "page_number": 2,
                          "juz_number": 1,
                          "audio": {
                            "url": "Alafasy/mp3/002005.mp3",
                            "segments": [
                              [0, 1, 70, 2490],
                              [1, 2, 2500, 3030],
                              [2, 3, 3040, 3480],
                              [3, 4, 3490, 4240],
                              [4, 5, 4250, 5490],
                              [5, 6, 5500, 7970],
                              [6, 7, 7980, 8380],
                              [7, 8, 8390, 10970]
                            ]
                          }
                        },
                        {
                          "id": 13,
                          "verse_number": 6,
                          "verse_key": "2:6",
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "ruku_number": 2,
                          "manzil_number": 1,
                          "sajdah_number": null,
                          "text_indopak": "اِنَّ الَّذِيۡنَ كَفَرُوۡا سَوَآءٌ عَلَيۡهِمۡ ءَاَنۡذَرۡتَهُمۡ اَمۡ لَمۡ تُنۡذِرۡهُمۡ لَا يُؤۡمِنُوۡنَ‏",
                          "page_number": 3,
                          "juz_number": 1,
                          "audio": {
                            "url": "Alafasy/mp3/002006.mp3",
                            "segments": [
                              [0, 1, 30, 1260],
                              [1, 2, 1270, 2150],
                              [2, 3, 2160, 2880],
                              [3, 4, 2890, 4950],
                              [4, 5, 4960, 5880],
                              [5, 6, 5890, 7780],
                              [6, 7, 7790, 8090],
                              [7, 8, 8100, 8430],
                              [8, 9, 8440, 10080],
                              [9, 10, 10090, 10430],
                              [10, 11, 10440, 12340]
                            ]
                          }
                        },
                        {
                          "id": 14,
                          "verse_number": 7,
                          "verse_key": "2:7",
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "ruku_number": 2,
                          "manzil_number": 1,
                          "sajdah_number": null,
                          "text_indopak": "خَتَمَ اللّٰهُ عَلَىٰ قُلُوۡبِهِمۡ وَعَلٰى سَمۡعِهِمۡ​ؕ وَعَلٰىٓ اَبۡصَارِهِمۡ غِشَاوَةٌ  وَّلَهُمۡ عَذَابٌ عَظِيۡمٌ‏",
                          "page_number": 3,
                          "juz_number": 1,
                          "audio": {
                            "url": "Alafasy/mp3/002007.mp3",
                            "segments": [
                              [0, 1, 140, 660],
                              [1, 2, 670, 1390],
                              [2, 3, 1400, 1950],
                              [3, 4, 1960, 3140],
                              [4, 5, 3150, 3820],
                              [5, 6, 3830, 5210],
                              [6, 7, 5220, 6900],
                              [7, 8, 6910, 8250],
                              [8, 9, 8260, 9580],
                              [9, 10, 9590, 10260],
                              [10, 11, 10270, 11230],
                              [11, 12, 11240, 12940]
                            ]
                          }
                        }
                      ],
                      "pagination": {
                        "per_page": 7,
                        "current_page": 1,
                        "next_page": null,
                        "total_pages": 1,
                        "total_records": 7
                      }
                    }
                  },
                  "compact_fields": {
                    "summary": "Compact verse fields for navigation views",
                    "value": {
                      "verses": [
                        {
                          "id": 255,
                          "chapter_id": 2,
                          "verse_number": 255,
                          "verse_key": "2:255",
                          "verse_index": 262,
                          "juz_number": 3,
                          "hizb_number": 5,
                          "rub_el_hizb_number": 19,
                          "page_number": 42
                        }
                      ],
                      "pagination": {
                        "per_page": 1,
                        "current_page": 1,
                        "next_page": null,
                        "total_pages": 1,
                        "total_records": 1
                      }
                    }
                  },
                  "with_words_translation_tafsir_audio": {
                    "summary": "Verse payload with words, translation, tafsir, and audio",
                    "value": {
                      "verses": [
                        {
                          "id": 1,
                          "chapter_id": 1,
                          "verse_number": 1,
                          "page_number": 1,
                          "verse_key": "1:1",
                          "juz_number": 1,
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "sajdah_type": null,
                          "sajdah_number": null,
                          "audio": {
                            "verse_key": "1:1",
                            "url": "https://verses.quran.foundation/Alafasy/mp3/001001.mp3"
                          },
                          "words": [
                            {
                              "id": 1,
                              "position": 1,
                              "audio_url": "wbw/001_001_001.mp3",
                              "char_type_name": "word",
                              "line_number": 2,
                              "page_number": 1,
                              "code_v1": "&#xfb51;",
                              "translation": {
                                "text": "In (the) name",
                                "language_name": "english"
                              },
                              "transliteration": {
                                "text": "bis'mi",
                                "language_name": "english"
                              }
                            }
                          ],
                          "translations": [
                            {
                              "resource_id": 131,
                              "resource_name": "Dr. Mustafa Khattab, the Clear Quran",
                              "text": "In the Name of Allah?the Most Compassionate, Most Merciful."
                            }
                          ],
                          "tafsirs": [
                            {
                              "id": 82641,
                              "resource_id": 169,
                              "language_name": "english",
                              "name": "Tafsir Ibn Kathir",
                              "text": "<h2 class=\"title\">The Meaning of Al-Fatihah and its Various Names</h2>"
                            }
                          ]
                        }
                      ],
                      "pagination": {
                        "per_page": 1,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 7,
                        "total_records": 7
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// By Ruku\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(ruku_number, options = {}) {\n  const response = await axios.get(\n    `${API_BASE_URL}/verses/by_ruku/${ruku_number}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      },\n      params: options\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(\"1\", {\"language\":\"en\",\"words\":\"true\",\"translations\":\"131\"})\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# By Ruku\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(ruku_number, language=None, words=None, translations=None):\n    params = {k: v for k, v in {'language': language, 'words': words, 'translations': translations}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/verses/by_ruku/{ruku_number}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(\"1\", language=\"en\", words=\"true\", translations=\"131\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// By Ruku\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(ruku_number string, params map[string]string) (string, error) {\n  path := fmt.Sprintf(\"/verses/by_ruku/%s\", ruku_number)\n  endpoint := API_BASE_URL + path\n  if params != nil && len(params) > 0 {\n    values := url.Values{}\n    for k, v := range params {\n      values.Set(k, v)\n    }\n    endpoint = endpoint + \"?\" + values.Encode()\n  }\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  params := map[string]string{\"language\": \"en\", \"words\": \"true\", \"translations\": \"131\"}\n  data, err := callApi(\"1\", params)\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# By Ruku\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(ruku_number, params = {})\n  path = \"/verses/by_ruku/#{ruku_number}\"\n  uri = URI(API_BASE_URL + path)\n  uri.query = URI.encode_www_form(params) if params && !params.empty?\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\nparams = { \"language\" => \"en\", \"words\" => \"true\", \"translations\" => \"131\" }\ndata = call_api(\"1\", params)\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// By Ruku\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string ruku_number, Dictionary<string, string> query = null)\n{\n    var path = $@\"/verses/by_ruku/{ruku_number}\";\n    var url = API_BASE_URL + path;\n    if (query != null && query.Count > 0)\n    {\n        var queryString = string.Join(\"&\", query.Select(kvp =>\n            $\"{Uri.EscapeDataString(kvp.Key)}={Uri.EscapeDataString(kvp.Value)}\"));\n        url = $\"{url}?{queryString}\";\n    }\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar query = new Dictionary<string, string> { {\"language\", \"en\"}, {\"words\", \"true\"}, {\"translations\", \"131\"} };\nvar data = await CallApiAsync(\"1\", query);\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# By Ruku\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($ruku_number, $params = []) {\n  $path = sprintf(\"/verses/by_ruku/%s\", $ruku_number);\n  $url = API_BASE_URL . $path;\n  if (!empty($params)) {\n    $url .= '?' . http_build_query($params);\n  }\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$params = ['language' => 'en', 'words' => 'true', 'translations' => '131'];\n$data = callApi(\"1\", $params);\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// By Ruku\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String ruku_number, Map<String, String> params) throws IOException {\n    String path = String.format(\"/verses/by_ruku/%s\", ruku_number);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    if (params != null) {\n      for (Map.Entry<String, String> entry : params.entrySet()) {\n        urlBuilder.addQueryParameter(entry.getKey(), entry.getValue());\n      }\n    }\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    Map<String, String> params = new HashMap<>();\n    params.put(\"language\", \"en\");\n    params.put(\"words\", \"true\");\n    params.put(\"translations\", \"131\");\n    String data = callApi(\"1\", params);\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# By Ruku\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$ruku_number, [hashtable]$params = @{}) {\n  $path = \"/verses/by_ruku/$ruku_number\"\n  $url = \"$API_BASE_URL$path\"\n  if ($params.Count -gt 0) {\n    $query = ($params.GetEnumerator() | ForEach-Object {\n      \"$($_.Key)=$([System.Uri]::EscapeDataString([string]$_.Value))\"\n    }) -join \"&\"\n    $url = \"$url?$query\"\n  }\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$params = @{ language = \"en\"; words = \"true\"; translations = \"131\" }\n$data = Call-Api(\"1\", $params)\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# By Ruku\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/verses/by_ruku/1?language=en&words=true&translations=131' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to by ruku using the Quran Foundation API.\n\nEndpoint: GET /verses/by_ruku/{ruku_number}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  ruku_number: Ruku number (1-558) (e.g., \"1\")\nOptional Query Parameters:\n  language: Language to fetch word-by-word translation in a specific language.\n  words: Include words of each ayah? Use this to fetch word-by-word translation and transliteration.\n\n0 or false will not include words.\n\n1 or true will include the words.\n\nDefault is false.\n  translations: comma separated ids of translations to load for each ayah. See [/resources/translations](/docs/content_apis_versioned/translations) for available ids. Use translations=57 to include full-ayah transliteration.\n  audio: Ayah-by-ayah recitation ID from [/resources/recitations](/docs/content_apis_versioned/recitations). Chapter-reciter IDs from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters) are not supported.\n  tafsirs: Comma separated ids of tafsirs to load for each ayah if you want to load tafsirs. See [/resources/tafsirs](/docs/content_apis_versioned/tafsirs) for available ids.\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/verses/by_ruku/{ruku_number}?{queryParams}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts ruku_number and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/verses/by_range": {
      "get": {
        "tags": ["Verses"],
        "summary": "By Range",
        "description": "Get verses within a verse key range. Both `from` and `to` are inclusive.",
        "operationId": "verses-by_range",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "description": "Start verse key (e.g., 2:255).",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "End verse key (e.g., 2:257).",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "language",
            "in": "query",
            "description": "Language to fetch word-by-word translation in a specific language.",
            "schema": {
              "type": "string",
              "default": "en"
            }
          },
          {
            "name": "words",
            "in": "query",
            "description": "Include words of each ayah? Use this to fetch word-by-word translation and transliteration.\n\n0 or false will not include words.\n\n1 or true will include the words.\n\nDefault is false.",
            "schema": {
              "type": "string",
              "default": "false",
              "enum": ["true", "false"]
            }
          },
          {
            "name": "translations",
            "in": "query",
            "description": "comma separated ids of translations to load for each ayah. See [/resources/translations](/docs/content_apis_versioned/translations) for available ids. Use translations=57 to include full-ayah transliteration.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "audio",
            "in": "query",
            "description": "Ayah-by-ayah recitation ID from [/resources/recitations](/docs/content_apis_versioned/recitations). Chapter-reciter IDs from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters) are not supported.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "tafsirs",
            "in": "query",
            "description": "Comma separated ids of tafsirs to load for each ayah if you want to load tafsirs. See [/resources/tafsirs](/docs/content_apis_versioned/tafsirs) for available ids.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "word_fields",
            "in": "query",
            "description": "Comma-separated list of word-level fields to include in response. [See full field reference](/docs/api/field-reference#word-level-fields).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "translation_fields",
            "in": "query",
            "description": "Comma separated list of translation fields if you want to add more fields for each translation. [See full field reference](/docs/api/field-reference#translation-fields).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tafsir_fields",
            "in": "query",
            "description": "Comma separated list of tafsir fields if you want to add more fields for each tafsir. [See full field reference](/docs/api/field-reference#tafsir-fields).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated list of verse-level fields to include in response. Use `fields=text_uthmani,text_indopak` to include Arabic text. [See full field reference](/docs/api/field-reference#verse-level-fields).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "For paginating within the result",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "records per api call, you can get maximum 50 records. ",
            "schema": {
              "maximum": 50,
              "minimum": 1,
              "type": "integer",
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "verses": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/verse"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/pagination"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "verses": [
                        {
                          "id": 1,
                          "verse_number": 1,
                          "page_number": 1,
                          "verse_key": "1:1",
                          "juz_number": 1,
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "sajdah_type": null,
                          "sajdah_number": null,
                          "words": [
                            {
                              "id": 1,
                              "position": 1,
                              "audio_url": "wbw/001_001_001.mp3",
                              "char_type_name": "word",
                              "line_number": 2,
                              "page_number": 1,
                              "code_v1": "&#xfb51;",
                              "translation": {
                                "text": "In (the) name",
                                "language_name": "english"
                              },
                              "transliteration": {
                                "text": "bis'mi",
                                "language_name": "english"
                              }
                            }
                          ],
                          "translations": [
                            {
                              "resource_id": 131,
                              "text": "In the Name of Allah—the Most Compassionate, Most Merciful."
                            }
                          ],
                          "tafsirs": [
                            {
                              "id": 82641,
                              "language_name": "english",
                              "name": "Tafsir Ibn Kathir",
                              "text": "<h2 class=\"title\">Which was revealed in Makkah</h2><h2 class=\"title\">The Meaning of Al-Fatihah and its Various Names</h2>"
                            }
                          ]
                        }
                      ],
                      "pagination": {
                        "per_page": 1,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 7,
                        "total_records": 7
                      }
                    }
                  },
                  "compact_fields": {
                    "summary": "Compact verse fields for navigation views",
                    "value": {
                      "verses": [
                        {
                          "id": 255,
                          "chapter_id": 2,
                          "verse_number": 255,
                          "verse_key": "2:255",
                          "verse_index": 262,
                          "juz_number": 3,
                          "hizb_number": 5,
                          "rub_el_hizb_number": 19,
                          "page_number": 42
                        }
                      ],
                      "pagination": {
                        "per_page": 1,
                        "current_page": 1,
                        "next_page": null,
                        "total_pages": 1,
                        "total_records": 1
                      }
                    }
                  },
                  "with_words_translation_tafsir_audio": {
                    "summary": "Verse payload with words, translation, tafsir, and audio",
                    "value": {
                      "verses": [
                        {
                          "id": 1,
                          "chapter_id": 1,
                          "verse_number": 1,
                          "page_number": 1,
                          "verse_key": "1:1",
                          "juz_number": 1,
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "sajdah_type": null,
                          "sajdah_number": null,
                          "audio": {
                            "verse_key": "1:1",
                            "url": "https://verses.quran.foundation/Alafasy/mp3/001001.mp3"
                          },
                          "words": [
                            {
                              "id": 1,
                              "position": 1,
                              "audio_url": "wbw/001_001_001.mp3",
                              "char_type_name": "word",
                              "line_number": 2,
                              "page_number": 1,
                              "code_v1": "&#xfb51;",
                              "translation": {
                                "text": "In (the) name",
                                "language_name": "english"
                              },
                              "transliteration": {
                                "text": "bis'mi",
                                "language_name": "english"
                              }
                            }
                          ],
                          "translations": [
                            {
                              "resource_id": 131,
                              "resource_name": "Dr. Mustafa Khattab, the Clear Quran",
                              "text": "In the Name of Allah?the Most Compassionate, Most Merciful."
                            }
                          ],
                          "tafsirs": [
                            {
                              "id": 82641,
                              "resource_id": 169,
                              "language_name": "english",
                              "name": "Tafsir Ibn Kathir",
                              "text": "<h2 class=\"title\">The Meaning of Al-Fatihah and its Various Names</h2>"
                            }
                          ]
                        }
                      ],
                      "pagination": {
                        "per_page": 1,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 7,
                        "total_records": 7
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// By Range\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(options = {}) {\n  const response = await axios.get(\n    `${API_BASE_URL}/verses/by_range`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      },\n      params: options\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi({\"from\":\"1:1\",\"to\":\"1:7\",\"language\":\"en\"})\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# By Range\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(from=None, to=None, language=None):\n    params = {k: v for k, v in {'from': from, 'to': to, 'language': language}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/verses/by_range',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(from=\"1:1\", to=\"1:7\", language=\"en\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// By Range\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(params map[string]string) (string, error) {\n  path := \"/verses/by_range\"\n  endpoint := API_BASE_URL + path\n  if params != nil && len(params) > 0 {\n    values := url.Values{}\n    for k, v := range params {\n      values.Set(k, v)\n    }\n    endpoint = endpoint + \"?\" + values.Encode()\n  }\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  params := map[string]string{\"from\": \"1:1\", \"to\": \"1:7\", \"language\": \"en\"}\n  data, err := callApi(params)\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# By Range\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(params = {})\n  path = \"/verses/by_range\"\n  uri = URI(API_BASE_URL + path)\n  uri.query = URI.encode_www_form(params) if params && !params.empty?\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\nparams = { \"from\" => \"1:1\", \"to\" => \"1:7\", \"language\" => \"en\" }\ndata = call_api(params)\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// By Range\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(Dictionary<string, string> query = null)\n{\n    var path = $@\"/verses/by_range\";\n    var url = API_BASE_URL + path;\n    if (query != null && query.Count > 0)\n    {\n        var queryString = string.Join(\"&\", query.Select(kvp =>\n            $\"{Uri.EscapeDataString(kvp.Key)}={Uri.EscapeDataString(kvp.Value)}\"));\n        url = $\"{url}?{queryString}\";\n    }\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar query = new Dictionary<string, string> { {\"from\", \"1:1\"}, {\"to\", \"1:7\"}, {\"language\", \"en\"} };\nvar data = await CallApiAsync(query);\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# By Range\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($params = []) {\n  $path = \"/verses/by_range\";\n  $url = API_BASE_URL . $path;\n  if (!empty($params)) {\n    $url .= '?' . http_build_query($params);\n  }\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$params = ['from' => '1:1', 'to' => '1:7', 'language' => 'en'];\n$data = callApi($params);\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// By Range\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(Map<String, String> params) throws IOException {\n    String path = \"/verses/by_range\";\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    if (params != null) {\n      for (Map.Entry<String, String> entry : params.entrySet()) {\n        urlBuilder.addQueryParameter(entry.getKey(), entry.getValue());\n      }\n    }\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    Map<String, String> params = new HashMap<>();\n    params.put(\"from\", \"1:1\");\n    params.put(\"to\", \"1:7\");\n    params.put(\"language\", \"en\");\n    String data = callApi(params);\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# By Range\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([hashtable]$params = @{}) {\n  $path = \"/verses/by_range\"\n  $url = \"$API_BASE_URL$path\"\n  if ($params.Count -gt 0) {\n    $query = ($params.GetEnumerator() | ForEach-Object {\n      \"$($_.Key)=$([System.Uri]::EscapeDataString([string]$_.Value))\"\n    }) -join \"&\"\n    $url = \"$url?$query\"\n  }\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$params = @{ from = \"1:1\"; to = \"1:7\"; language = \"en\" }\n$data = Call-Api($params)\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# By Range\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/verses/by_range?from=1%3A1&to=1%3A7&language=en' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to by range using the Quran Foundation API.\n\nEndpoint: GET /verses/by_range\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nOptional Query Parameters:\n  from: Start verse key (e.g., 2:255).\n  to: End verse key (e.g., 2:257).\n  language: Language to fetch word-by-word translation in a specific language.\n  words: Include words of each ayah? Use this to fetch word-by-word translation and transliteration.\n\n0 or false will not include words.\n\n1 or true will include the words.\n\nDefault is false.\n  translations: comma separated ids of translations to load for each ayah. See [/resources/translations](/docs/content_apis_versioned/translations) for available ids. Use translations=57 to include full-ayah transliteration.\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/verses/by_range?{queryParams}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/verses/by_key/{verse_key}": {
      "get": {
        "tags": ["Verses"],
        "summary": "By Specific Verse By Key",
        "description": "Get a specific ayah with key. Key is combination of surah number and ayah number. 1:1 is first ayah of first surah for example.\n\n10:5 is 5th ayah of 10th surah.",
        "operationId": "verses-by_verse_key",
        "parameters": [
          {
            "name": "verse_key",
            "in": "path",
            "description": "Verse key ( chapter:verse) ",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "language",
            "in": "query",
            "description": "Language to fetch word-by-word translations in a specific language.",
            "schema": {
              "type": "string",
              "default": "en"
            }
          },
          {
            "name": "words",
            "in": "query",
            "description": "Include words of each ayah? Use this to fetch word-by-word translation and transliteration.\n\n0 or false will not include words.\n\n1 or true will include the words.\n\nDefault is false.",
            "schema": {
              "type": "string",
              "default": "false",
              "enum": ["true", "false"]
            }
          },
          {
            "name": "translations",
            "in": "query",
            "description": "comma separated ids of translations to load for each ayah. See [/resources/translations](/docs/content_apis_versioned/translations) for available ids. Use translations=57 to include full-ayah transliteration.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "audio",
            "in": "query",
            "description": "Ayah-by-ayah recitation ID from [/resources/recitations](/docs/content_apis_versioned/recitations). Chapter-reciter IDs from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters) are not supported.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "tafsirs",
            "in": "query",
            "description": "Comma separated ids of tafsirs to load for each ayah if you want to load tafsirs. See [/resources/tafsirs](/docs/content_apis_versioned/tafsirs) for available ids.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "word_fields",
            "in": "query",
            "description": "Comma-separated list of word-level fields to include in response. [See full field reference](/docs/api/field-reference#word-level-fields).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "translation_fields",
            "in": "query",
            "description": "Comma separated list of translation fields if you want to add more fields for each translation. [See full field reference](/docs/api/field-reference#translation-fields).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tafsir_fields",
            "in": "query",
            "description": "Comma separated list of tafsir fields if you want to add more fields for each tafsir. [See full field reference](/docs/api/field-reference#tafsir-fields).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated list of verse-level fields to include in response. Use `fields=text_uthmani,text_indopak` to include Arabic text. [See full field reference](/docs/api/field-reference#verse-level-fields).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "required": ["verse"],
                  "type": "object",
                  "properties": {
                    "verse": {
                      "$ref": "#/components/schemas/verse"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "verse": {
                        "id": 1,
                        "verse_number": 1,
                        "page_number": 1,
                        "verse_key": "1:1",
                        "juz_number": 1,
                        "hizb_number": 1,
                        "rub_el_hizb_number": 1,
                        "sajdah_type": null,
                        "sajdah_number": null,
                        "words": [
                          {
                            "id": 1,
                            "position": 1,
                            "audio_url": "wbw/001_001_001.mp3",
                            "char_type_name": "word",
                            "line_number": 2,
                            "page_number": 1,
                            "code_v1": "&#xfb51;",
                            "translation": {
                              "text": "In (the) name",
                              "language_name": "english"
                            },
                            "transliteration": {
                              "text": "bis'mi",
                              "language_name": "english"
                            }
                          }
                        ],
                        "translations": [
                          {
                            "resource_id": 131,
                            "text": "In the Name of Allah—the Most Compassionate, Most Merciful."
                          }
                        ],
                        "tafsirs": [
                          {
                            "id": 82641,
                            "language_name": "english",
                            "name": "Tafsir Ibn Kathir",
                            "text": "<h2 class=\"title\">Which was revealed in Makkah</h2><h2 class=\"title\">The Meaning of Al-Fatihah and its Various Names</h2>"
                          }
                        ]
                      }
                    }
                  },
                  "compact_verse": {
                    "summary": "Compact single verse response",
                    "value": {
                      "verse": {
                        "id": 255,
                        "chapter_id": 2,
                        "verse_number": 255,
                        "verse_key": "2:255",
                        "verse_index": 262,
                        "juz_number": 3,
                        "hizb_number": 5,
                        "rub_el_hizb_number": 19,
                        "page_number": 42
                      }
                    }
                  },
                  "with_words_translation_tafsir_audio": {
                    "summary": "Single verse with words, translation, tafsir, and audio",
                    "value": {
                      "verse": {
                        "id": 1,
                        "chapter_id": 1,
                        "verse_number": 1,
                        "page_number": 1,
                        "verse_key": "1:1",
                        "juz_number": 1,
                        "hizb_number": 1,
                        "rub_el_hizb_number": 1,
                        "sajdah_type": null,
                        "sajdah_number": null,
                        "audio": {
                          "verse_key": "1:1",
                          "url": "https://verses.quran.foundation/Alafasy/mp3/001001.mp3"
                        },
                        "words": [
                          {
                            "id": 1,
                            "position": 1,
                            "audio_url": "wbw/001_001_001.mp3",
                            "char_type_name": "word",
                            "line_number": 2,
                            "page_number": 1,
                            "code_v1": "&#xfb51;",
                            "translation": {
                              "text": "In (the) name",
                              "language_name": "english"
                            },
                            "transliteration": {
                              "text": "bis'mi",
                              "language_name": "english"
                            }
                          }
                        ],
                        "translations": [
                          {
                            "resource_id": 131,
                            "resource_name": "Dr. Mustafa Khattab, the Clear Quran",
                            "text": "In the Name of Allah?the Most Compassionate, Most Merciful."
                          }
                        ],
                        "tafsirs": [
                          {
                            "id": 82641,
                            "resource_id": 169,
                            "language_name": "english",
                            "name": "Tafsir Ibn Kathir",
                            "text": "<h2 class=\"title\">The Meaning of Al-Fatihah and its Various Names</h2>"
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// By Specific Verse By Key\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(verse_key, options = {}) {\n  const response = await axios.get(\n    `${API_BASE_URL}/verses/by_key/${verse_key}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      },\n      params: options\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(\"2:255\", {\"language\":\"en\",\"words\":\"true\",\"translations\":\"131\"})\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# By Specific Verse By Key\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(verse_key, language=None, words=None, translations=None):\n    params = {k: v for k, v in {'language': language, 'words': words, 'translations': translations}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/verses/by_key/{verse_key}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(\"2:255\", language=\"en\", words=\"true\", translations=\"131\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// By Specific Verse By Key\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(verse_key string, params map[string]string) (string, error) {\n  path := fmt.Sprintf(\"/verses/by_key/%s\", verse_key)\n  endpoint := API_BASE_URL + path\n  if params != nil && len(params) > 0 {\n    values := url.Values{}\n    for k, v := range params {\n      values.Set(k, v)\n    }\n    endpoint = endpoint + \"?\" + values.Encode()\n  }\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  params := map[string]string{\"language\": \"en\", \"words\": \"true\", \"translations\": \"131\"}\n  data, err := callApi(\"2:255\", params)\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# By Specific Verse By Key\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(verse_key, params = {})\n  path = \"/verses/by_key/#{verse_key}\"\n  uri = URI(API_BASE_URL + path)\n  uri.query = URI.encode_www_form(params) if params && !params.empty?\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\nparams = { \"language\" => \"en\", \"words\" => \"true\", \"translations\" => \"131\" }\ndata = call_api(\"2:255\", params)\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// By Specific Verse By Key\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string verse_key, Dictionary<string, string> query = null)\n{\n    var path = $@\"/verses/by_key/{verse_key}\";\n    var url = API_BASE_URL + path;\n    if (query != null && query.Count > 0)\n    {\n        var queryString = string.Join(\"&\", query.Select(kvp =>\n            $\"{Uri.EscapeDataString(kvp.Key)}={Uri.EscapeDataString(kvp.Value)}\"));\n        url = $\"{url}?{queryString}\";\n    }\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar query = new Dictionary<string, string> { {\"language\", \"en\"}, {\"words\", \"true\"}, {\"translations\", \"131\"} };\nvar data = await CallApiAsync(\"2:255\", query);\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# By Specific Verse By Key\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($verse_key, $params = []) {\n  $path = sprintf(\"/verses/by_key/%s\", $verse_key);\n  $url = API_BASE_URL . $path;\n  if (!empty($params)) {\n    $url .= '?' . http_build_query($params);\n  }\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$params = ['language' => 'en', 'words' => 'true', 'translations' => '131'];\n$data = callApi(\"2:255\", $params);\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// By Specific Verse By Key\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String verse_key, Map<String, String> params) throws IOException {\n    String path = String.format(\"/verses/by_key/%s\", verse_key);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    if (params != null) {\n      for (Map.Entry<String, String> entry : params.entrySet()) {\n        urlBuilder.addQueryParameter(entry.getKey(), entry.getValue());\n      }\n    }\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    Map<String, String> params = new HashMap<>();\n    params.put(\"language\", \"en\");\n    params.put(\"words\", \"true\");\n    params.put(\"translations\", \"131\");\n    String data = callApi(\"2:255\", params);\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# By Specific Verse By Key\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$verse_key, [hashtable]$params = @{}) {\n  $path = \"/verses/by_key/$verse_key\"\n  $url = \"$API_BASE_URL$path\"\n  if ($params.Count -gt 0) {\n    $query = ($params.GetEnumerator() | ForEach-Object {\n      \"$($_.Key)=$([System.Uri]::EscapeDataString([string]$_.Value))\"\n    }) -join \"&\"\n    $url = \"$url?$query\"\n  }\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$params = @{ language = \"en\"; words = \"true\"; translations = \"131\" }\n$data = Call-Api(\"2:255\", $params)\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# By Specific Verse By Key\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/verses/by_key/2:255?language=en&words=true&translations=131' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to by specific verse by key using the Quran Foundation API.\n\nEndpoint: GET /verses/by_key/{verse_key}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  verse_key: Verse key ( chapter:verse)  (e.g., \"2:255\")\nOptional Query Parameters:\n  language: Language to fetch word-by-word translations in a specific language.\n  words: Include words of each ayah? Use this to fetch word-by-word translation and transliteration.\n\n0 or false will not include words.\n\n1 or true will include the words.\n\nDefault is false.\n  translations: comma separated ids of translations to load for each ayah. See [/resources/translations](/docs/content_apis_versioned/translations) for available ids. Use translations=57 to include full-ayah transliteration.\n  audio: Ayah-by-ayah recitation ID from [/resources/recitations](/docs/content_apis_versioned/recitations). Chapter-reciter IDs from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters) are not supported.\n  tafsirs: Comma separated ids of tafsirs to load for each ayah if you want to load tafsirs. See [/resources/tafsirs](/docs/content_apis_versioned/tafsirs) for available ids.\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/verses/by_key/{verse_key}?{queryParams}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts verse_key and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/verses/random": {
      "get": {
        "tags": ["Verses"],
        "summary": "Get random ayah",
        "description": "Get a random verse. You can get random verse from a specific `chapter`,`page`, `juz`, `hizb`, `rub-el-hizb`, `ruku`, `manzil`, or from whole Quran.",
        "operationId": "random_verse",
        "parameters": [
          {
            "name": "chapter_number",
            "in": "query",
            "description": "Return a random verse **only from the specified chapter (sūrah)**.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 114
            }
          },
          {
            "name": "page_number",
            "in": "query",
            "description": "Return a random verse **only from the specified Muṣḥaf page** (1 – 604).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 604
            }
          },
          {
            "name": "juz_number",
            "in": "query",
            "description": "Return a random verse **only from the specified juzʾ** (1 – 30).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 30
            }
          },
          {
            "name": "hizb_number",
            "in": "query",
            "description": "Return a random verse **only from the specified ḥizb** (1 – 60).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 60
            }
          },
          {
            "name": "rub_el_hizb_number",
            "in": "query",
            "description": "Return a random verse **only from the specified rubʿ al-ḥizb** (1 – 240).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 240
            }
          },
          {
            "name": "ruku_number",
            "in": "query",
            "description": "Return a random verse **only from the specified rukūʿ**.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "manzil_number",
            "in": "query",
            "description": "Return a random verse **only from the specified manzil** (1 – 7).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 7
            }
          },
          {
            "name": "language",
            "in": "query",
            "description": "Language to fetch word-by-word translation in a specific language.",
            "schema": {
              "type": "string",
              "default": "en"
            }
          },
          {
            "name": "words",
            "in": "query",
            "description": "Include words of each ayah? Use this to fetch word-by-word translation and transliteration.\n\n0 or false will not include words.\n\n1 or true will include the words.\n\nDefault is false.",
            "schema": {
              "type": "string",
              "default": "false",
              "enum": ["true", "false"]
            }
          },
          {
            "name": "translations",
            "in": "query",
            "description": "comma separated ids of translations to load for each ayah. See /resources/translations for available ids. Use translations=57 to include full-ayah transliteration.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "audio",
            "in": "query",
            "description": "Ayah-by-ayah recitation ID from [/resources/recitations](/docs/content_apis_versioned/recitations). Chapter-reciter IDs from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters) are not supported.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "tafsirs",
            "in": "query",
            "description": "Comma separated ids of tafsirs to load for each ayah if you want to load tafsirs. See /resources/tafsirs for available ids.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "word_fields",
            "in": "query",
            "description": "Comma-separated list of word-level fields to include in response. [See full field reference](/docs/api/field-reference#word-level-fields).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "translation_fields",
            "in": "query",
            "description": "Comma separated list of translation fields if you want to add more fields for each translation. [See full field reference](/docs/api/field-reference#translation-fields).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tafsir_fields",
            "in": "query",
            "description": "Comma separated list of tafsir fields if you want to add more fields for each tafsir. [See full field reference](/docs/api/field-reference#tafsir-fields).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated list of verse-level fields to include in response. Use `fields=text_uthmani,text_indopak` to include Arabic text. [See full field reference](/docs/api/field-reference#verse-level-fields).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "required": ["verse"],
                  "type": "object",
                  "properties": {
                    "verse": {
                      "$ref": "#/components/schemas/verse"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "verse": {
                        "id": 1,
                        "verse_number": 1,
                        "page_number": 1,
                        "verse_key": "1:1",
                        "juz_number": 1,
                        "hizb_number": 1,
                        "rub_el_hizb_number": 1,
                        "sajdah_type": null,
                        "sajdah_number": null,
                        "words": [
                          {
                            "id": 1,
                            "position": 1,
                            "audio_url": "wbw/001_001_001.mp3",
                            "char_type_name": "word",
                            "line_number": 2,
                            "page_number": 1,
                            "code_v1": "&#xfb51;",
                            "translation": {
                              "text": "In (the) name",
                              "language_name": "english"
                            },
                            "transliteration": {
                              "text": "bis'mi",
                              "language_name": "english"
                            }
                          }
                        ],
                        "translations": [
                          {
                            "resource_id": 131,
                            "text": "In the Name of Allah—the Most Compassionate, Most Merciful."
                          }
                        ],
                        "tafsirs": [
                          {
                            "id": 82641,
                            "language_name": "english",
                            "name": "Tafsir Ibn Kathir",
                            "text": "<h2 class=\"title\">Which was revealed in Makkah</h2><h2 class=\"title\">The Meaning of Al-Fatihah and its Various Names</h2>"
                          }
                        ]
                      }
                    }
                  },
                  "compact_verse": {
                    "summary": "Compact single verse response",
                    "value": {
                      "verse": {
                        "id": 255,
                        "chapter_id": 2,
                        "verse_number": 255,
                        "verse_key": "2:255",
                        "verse_index": 262,
                        "juz_number": 3,
                        "hizb_number": 5,
                        "rub_el_hizb_number": 19,
                        "page_number": 42
                      }
                    }
                  },
                  "with_words_translation_tafsir_audio": {
                    "summary": "Single verse with words, translation, tafsir, and audio",
                    "value": {
                      "verse": {
                        "id": 1,
                        "chapter_id": 1,
                        "verse_number": 1,
                        "page_number": 1,
                        "verse_key": "1:1",
                        "juz_number": 1,
                        "hizb_number": 1,
                        "rub_el_hizb_number": 1,
                        "sajdah_type": null,
                        "sajdah_number": null,
                        "audio": {
                          "verse_key": "1:1",
                          "url": "https://verses.quran.foundation/Alafasy/mp3/001001.mp3"
                        },
                        "words": [
                          {
                            "id": 1,
                            "position": 1,
                            "audio_url": "wbw/001_001_001.mp3",
                            "char_type_name": "word",
                            "line_number": 2,
                            "page_number": 1,
                            "code_v1": "&#xfb51;",
                            "translation": {
                              "text": "In (the) name",
                              "language_name": "english"
                            },
                            "transliteration": {
                              "text": "bis'mi",
                              "language_name": "english"
                            }
                          }
                        ],
                        "translations": [
                          {
                            "resource_id": 131,
                            "resource_name": "Dr. Mustafa Khattab, the Clear Quran",
                            "text": "In the Name of Allah?the Most Compassionate, Most Merciful."
                          }
                        ],
                        "tafsirs": [
                          {
                            "id": 82641,
                            "resource_id": 169,
                            "language_name": "english",
                            "name": "Tafsir Ibn Kathir",
                            "text": "<h2 class=\"title\">The Meaning of Al-Fatihah and its Various Names</h2>"
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get random ayah\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(options = {}) {\n  const response = await axios.get(\n    `${API_BASE_URL}/verses/random`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      },\n      params: options\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi({\"chapter_number\":\"1\",\"page_number\":\"1\",\"juz_number\":\"1\"})\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get random ayah\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(chapter_number=None, page_number=None, juz_number=None):\n    params = {k: v for k, v in {'chapter_number': chapter_number, 'page_number': page_number, 'juz_number': juz_number}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/verses/random',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(chapter_number=\"1\", page_number=\"1\", juz_number=\"1\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get random ayah\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(params map[string]string) (string, error) {\n  path := \"/verses/random\"\n  endpoint := API_BASE_URL + path\n  if params != nil && len(params) > 0 {\n    values := url.Values{}\n    for k, v := range params {\n      values.Set(k, v)\n    }\n    endpoint = endpoint + \"?\" + values.Encode()\n  }\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  params := map[string]string{\"chapter_number\": \"1\", \"page_number\": \"1\", \"juz_number\": \"1\"}\n  data, err := callApi(params)\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get random ayah\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(params = {})\n  path = \"/verses/random\"\n  uri = URI(API_BASE_URL + path)\n  uri.query = URI.encode_www_form(params) if params && !params.empty?\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\nparams = { \"chapter_number\" => \"1\", \"page_number\" => \"1\", \"juz_number\" => \"1\" }\ndata = call_api(params)\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get random ayah\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(Dictionary<string, string> query = null)\n{\n    var path = $@\"/verses/random\";\n    var url = API_BASE_URL + path;\n    if (query != null && query.Count > 0)\n    {\n        var queryString = string.Join(\"&\", query.Select(kvp =>\n            $\"{Uri.EscapeDataString(kvp.Key)}={Uri.EscapeDataString(kvp.Value)}\"));\n        url = $\"{url}?{queryString}\";\n    }\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar query = new Dictionary<string, string> { {\"chapter_number\", \"1\"}, {\"page_number\", \"1\"}, {\"juz_number\", \"1\"} };\nvar data = await CallApiAsync(query);\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get random ayah\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($params = []) {\n  $path = \"/verses/random\";\n  $url = API_BASE_URL . $path;\n  if (!empty($params)) {\n    $url .= '?' . http_build_query($params);\n  }\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$params = ['chapter_number' => '1', 'page_number' => '1', 'juz_number' => '1'];\n$data = callApi($params);\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get random ayah\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(Map<String, String> params) throws IOException {\n    String path = \"/verses/random\";\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    if (params != null) {\n      for (Map.Entry<String, String> entry : params.entrySet()) {\n        urlBuilder.addQueryParameter(entry.getKey(), entry.getValue());\n      }\n    }\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    Map<String, String> params = new HashMap<>();\n    params.put(\"chapter_number\", \"1\");\n    params.put(\"page_number\", \"1\");\n    params.put(\"juz_number\", \"1\");\n    String data = callApi(params);\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get random ayah\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([hashtable]$params = @{}) {\n  $path = \"/verses/random\"\n  $url = \"$API_BASE_URL$path\"\n  if ($params.Count -gt 0) {\n    $query = ($params.GetEnumerator() | ForEach-Object {\n      \"$($_.Key)=$([System.Uri]::EscapeDataString([string]$_.Value))\"\n    }) -join \"&\"\n    $url = \"$url?$query\"\n  }\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$params = @{ chapter_number = \"1\"; page_number = \"1\"; juz_number = \"1\" }\n$data = Call-Api($params)\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get random ayah\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/verses/random?chapter_number=1&page_number=1&juz_number=1' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get random ayah using the Quran Foundation API.\n\nEndpoint: GET /verses/random\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nOptional Query Parameters:\n  chapter_number: Return a random verse **only from the specified chapter (sūrah)**.\n  page_number: Return a random verse **only from the specified Muṣḥaf page** (1 – 604).\n  juz_number: Return a random verse **only from the specified juzʾ** (1 – 30).\n  hizb_number: Return a random verse **only from the specified ḥizb** (1 – 60).\n  rub_el_hizb_number: Return a random verse **only from the specified rubʿ al-ḥizb** (1 – 240).\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/verses/random?{queryParams}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/juzs": {
      "get": {
        "tags": ["Juz"],
        "summary": "List Juzs",
        "description": "Get list of all Juzs with verse boundaries.",
        "operationId": "list-juzs",
        "parameters": [
          {
            "name": "mushaf",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "Optional mushaf identifier (alias: mushaf_id) to select the verse mapping set."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["juzs"],
                  "properties": {
                    "juzs": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/juz"
                      }
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "juzs": [
                        {
                          "id": 1,
                          "juz_number": 1,
                          "verse_mapping": {
                            "1": "1-7",
                            "2": "1-141"
                          },
                          "first_verse_id": 1,
                          "last_verse_id": 148,
                          "verses_count": 148
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// List Juzs\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(options = {}) {\n  const response = await axios.get(\n    `${API_BASE_URL}/juzs`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      },\n      params: options\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi({\"mushaf\":1})\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# List Juzs\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(mushaf=None):\n    params = {k: v for k, v in {'mushaf': mushaf}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/juzs',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(mushaf=1)\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// List Juzs\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(params map[string]string) (string, error) {\n  path := \"/juzs\"\n  endpoint := API_BASE_URL + path\n  if params != nil && len(params) > 0 {\n    values := url.Values{}\n    for k, v := range params {\n      values.Set(k, v)\n    }\n    endpoint = endpoint + \"?\" + values.Encode()\n  }\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  params := map[string]string{\"mushaf\": \"1\"}\n  data, err := callApi(params)\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# List Juzs\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(params = {})\n  path = \"/juzs\"\n  uri = URI(API_BASE_URL + path)\n  uri.query = URI.encode_www_form(params) if params && !params.empty?\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\nparams = { \"mushaf\" => \"1\" }\ndata = call_api(params)\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// List Juzs\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(Dictionary<string, string> query = null)\n{\n    var path = $@\"/juzs\";\n    var url = API_BASE_URL + path;\n    if (query != null && query.Count > 0)\n    {\n        var queryString = string.Join(\"&\", query.Select(kvp =>\n            $\"{Uri.EscapeDataString(kvp.Key)}={Uri.EscapeDataString(kvp.Value)}\"));\n        url = $\"{url}?{queryString}\";\n    }\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar query = new Dictionary<string, string> { {\"mushaf\", \"1\"} };\nvar data = await CallApiAsync(query);\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# List Juzs\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($params = []) {\n  $path = \"/juzs\";\n  $url = API_BASE_URL . $path;\n  if (!empty($params)) {\n    $url .= '?' . http_build_query($params);\n  }\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$params = ['mushaf' => '1'];\n$data = callApi($params);\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// List Juzs\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(Map<String, String> params) throws IOException {\n    String path = \"/juzs\";\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    if (params != null) {\n      for (Map.Entry<String, String> entry : params.entrySet()) {\n        urlBuilder.addQueryParameter(entry.getKey(), entry.getValue());\n      }\n    }\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    Map<String, String> params = new HashMap<>();\n    params.put(\"mushaf\", \"1\");\n    String data = callApi(params);\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# List Juzs\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([hashtable]$params = @{}) {\n  $path = \"/juzs\"\n  $url = \"$API_BASE_URL$path\"\n  if ($params.Count -gt 0) {\n    $query = ($params.GetEnumerator() | ForEach-Object {\n      \"$($_.Key)=$([System.Uri]::EscapeDataString([string]$_.Value))\"\n    }) -join \"&\"\n    $url = \"$url?$query\"\n  }\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$params = @{ mushaf = \"1\" }\n$data = Call-Api($params)\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# List Juzs\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/juzs?mushaf=1' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to list juzs using the Quran Foundation API.\n\nEndpoint: GET /juzs\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nOptional Query Parameters:\n  mushaf: Optional mushaf identifier (alias: mushaf_id) to select the verse mapping set.\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/juzs?{queryParams}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/quran/verses/{script}": {
      "get": {
        "tags": ["Quran"],
        "summary": "Get Quran verses in a specific script",
        "description": "Stream the complete Quran text in the requested script. Use the structural filters to limit results to a chapter, juz, hizb, rub el hizb, manzil, ruku, or page.",
        "operationId": "quran-verses-by-script",
        "parameters": [
          {
            "name": "script",
            "in": "path",
            "description": "Script identifier for the response payload. Supported values: `uthmani`, `uthmani_simple`, `text_uthmani_simple`, `uthmani_tajweed`, `text_uthmani_tajweed`, `indopak`, `text_indopak`, `indopak_nastaleeq`, `text_indopak_nastaleeq`, `imlaei`, `text_imlaei`, `imlaei_simple`, `text_imlaei_simple`, `qpc_hafs`, `text_qpc_hafs`, `qpc_nastaleeq`, `text_qpc_nastaleeq`, `code_v1`, `v1`, `code_v2`, `v2`, `v1_image`. Unsupported values fall back to the Uthmani text payload.",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "uthmani",
                "uthmani_simple",
                "text_uthmani_simple",
                "uthmani_tajweed",
                "text_uthmani_tajweed",
                "indopak",
                "text_indopak",
                "indopak_nastaleeq",
                "text_indopak_nastaleeq",
                "imlaei",
                "text_imlaei",
                "imlaei_simple",
                "text_imlaei_simple",
                "qpc_hafs",
                "text_qpc_hafs",
                "qpc_nastaleeq",
                "text_qpc_nastaleeq",
                "code_v1",
                "v1",
                "code_v2",
                "v2",
                "v1_image"
              ]
            }
          },
          {
            "name": "chapter_number",
            "in": "query",
            "description": "Filter verses to a specific surah.",
            "schema": {
              "maximum": 114,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "juz_number",
            "in": "query",
            "description": "Filter verses to a specific juz.",
            "schema": {
              "maximum": 30,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "page_number",
            "in": "query",
            "description": "Filter verses to a Madani Mushaf page.",
            "schema": {
              "maximum": 604,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "hizb_number",
            "in": "query",
            "description": "Filter verses to a specific hizb.",
            "schema": {
              "maximum": 60,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "rub_el_hizb_number",
            "in": "query",
            "description": "Filter verses to a specific rub el hizb.",
            "schema": {
              "maximum": 240,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "manzil_number",
            "in": "query",
            "description": "Filter verses to a specific manzil.",
            "schema": {
              "maximum": 7,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "ruku_number",
            "in": "query",
            "description": "Filter verses to a specific ruku.",
            "schema": {
              "maximum": 558,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "verse_key",
            "in": "query",
            "description": "Fetch a single ayah by its `chapter:verse` key.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["verses", "meta"],
                  "properties": {
                    "verses": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/QuranVerseText"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/QuranFiltersMeta"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "verses": [
                        {
                          "id": 1,
                          "verse_key": "1:1",
                          "text_uthmani": "بِسْمِ ٱللَّهِ ٱلرَّحْمَـٰنِ ٱلرَّحِيمِ"
                        }
                      ],
                      "meta": {
                        "filters": {
                          "chapter_number": 1
                        }
                      }
                    }
                  },
                  "chapter_filter": {
                    "summary": "Text for a chapter filter",
                    "value": {
                      "verses": [
                        {
                          "id": 1,
                          "verse_key": "1:1",
                          "text_uthmani": "بِسْمِ ٱللَّهِ ٱلرَّحْمَـٰنِ ٱلرَّحِيمِ"
                        }
                      ],
                      "meta": {
                        "filters": {
                          "chapter_number": 1
                        }
                      }
                    }
                  },
                  "single_ayah_filter": {
                    "summary": "Text for one ayah",
                    "value": {
                      "verses": [
                        {
                          "id": 1,
                          "verse_key": "1:1",
                          "text_uthmani": "بِسْمِ ٱللَّهِ ٱلرَّحْمَـٰنِ ٱلرَّحِيمِ"
                        }
                      ],
                      "meta": {
                        "filters": {
                          "verse_key": "1:1"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get Quran verses in a specific script\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(script, options = {}) {\n  const response = await axios.get(\n    `${API_BASE_URL}/quran/verses/${script}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      },\n      params: options\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(\"uthmani\", {\"chapter_number\":\"1\",\"juz_number\":\"1\",\"page_number\":\"1\"})\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get Quran verses in a specific script\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(script, chapter_number=None, juz_number=None, page_number=None):\n    params = {k: v for k, v in {'chapter_number': chapter_number, 'juz_number': juz_number, 'page_number': page_number}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/quran/verses/{script}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(\"uthmani\", chapter_number=\"1\", juz_number=\"1\", page_number=\"1\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get Quran verses in a specific script\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(script string, params map[string]string) (string, error) {\n  path := fmt.Sprintf(\"/quran/verses/%s\", script)\n  endpoint := API_BASE_URL + path\n  if params != nil && len(params) > 0 {\n    values := url.Values{}\n    for k, v := range params {\n      values.Set(k, v)\n    }\n    endpoint = endpoint + \"?\" + values.Encode()\n  }\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  params := map[string]string{\"chapter_number\": \"1\", \"juz_number\": \"1\", \"page_number\": \"1\"}\n  data, err := callApi(\"uthmani\", params)\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get Quran verses in a specific script\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(script, params = {})\n  path = \"/quran/verses/#{script}\"\n  uri = URI(API_BASE_URL + path)\n  uri.query = URI.encode_www_form(params) if params && !params.empty?\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\nparams = { \"chapter_number\" => \"1\", \"juz_number\" => \"1\", \"page_number\" => \"1\" }\ndata = call_api(\"uthmani\", params)\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get Quran verses in a specific script\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string script, Dictionary<string, string> query = null)\n{\n    var path = $@\"/quran/verses/{script}\";\n    var url = API_BASE_URL + path;\n    if (query != null && query.Count > 0)\n    {\n        var queryString = string.Join(\"&\", query.Select(kvp =>\n            $\"{Uri.EscapeDataString(kvp.Key)}={Uri.EscapeDataString(kvp.Value)}\"));\n        url = $\"{url}?{queryString}\";\n    }\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar query = new Dictionary<string, string> { {\"chapter_number\", \"1\"}, {\"juz_number\", \"1\"}, {\"page_number\", \"1\"} };\nvar data = await CallApiAsync(\"uthmani\", query);\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get Quran verses in a specific script\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($script, $params = []) {\n  $path = sprintf(\"/quran/verses/%s\", $script);\n  $url = API_BASE_URL . $path;\n  if (!empty($params)) {\n    $url .= '?' . http_build_query($params);\n  }\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$params = ['chapter_number' => '1', 'juz_number' => '1', 'page_number' => '1'];\n$data = callApi(\"uthmani\", $params);\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get Quran verses in a specific script\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String script, Map<String, String> params) throws IOException {\n    String path = String.format(\"/quran/verses/%s\", script);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    if (params != null) {\n      for (Map.Entry<String, String> entry : params.entrySet()) {\n        urlBuilder.addQueryParameter(entry.getKey(), entry.getValue());\n      }\n    }\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    Map<String, String> params = new HashMap<>();\n    params.put(\"chapter_number\", \"1\");\n    params.put(\"juz_number\", \"1\");\n    params.put(\"page_number\", \"1\");\n    String data = callApi(\"uthmani\", params);\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get Quran verses in a specific script\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$script, [hashtable]$params = @{}) {\n  $path = \"/quran/verses/$script\"\n  $url = \"$API_BASE_URL$path\"\n  if ($params.Count -gt 0) {\n    $query = ($params.GetEnumerator() | ForEach-Object {\n      \"$($_.Key)=$([System.Uri]::EscapeDataString([string]$_.Value))\"\n    }) -join \"&\"\n    $url = \"$url?$query\"\n  }\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$params = @{ chapter_number = \"1\"; juz_number = \"1\"; page_number = \"1\" }\n$data = Call-Api(\"uthmani\", $params)\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get Quran verses in a specific script\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/quran/verses/uthmani?chapter_number=1&juz_number=1&page_number=1' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get quran verses in a specific script using the Quran Foundation API.\n\nEndpoint: GET /quran/verses/{script}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  script: Script identifier for the response payload. Supported values: `uthmani`, `uthmani_simple`, `uthmani_tajweed`, `indopak`, `indopak_nastaleeq`, `imlaei`, `imlaei_simple`, `qpc_hafs`, `qpc_nastaleeq`, `code_v1`, `code_v2`, `v1_image`. (e.g., \"uthmani\")\nOptional Query Parameters:\n  chapter_number: Filter verses to a specific surah.\n  juz_number: Filter verses to a specific juz.\n  page_number: Filter verses to a Madani Mushaf page.\n  hizb_number: Filter verses to a specific hizb.\n  rub_el_hizb_number: Filter verses to a specific rub el hizb.\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/quran/verses/{script}?{queryParams}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts script and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/quran/verses/indopak": {
      "get": {
        "tags": ["Quran"],
        "summary": "Get Indopak Script of ayah",
        "description": "Get Indopak script of ayah. Use query strings to filter results, leave all query string blank if you want to fetch Indopak script of whole Quran.",
        "operationId": "QURAN-verses-indopak",
        "parameters": [
          {
            "name": "chapter_number",
            "in": "query",
            "description": "If you want to get indopak script of a specific surah.",
            "schema": {
              "maximum": 114,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "juz_number",
            "in": "query",
            "description": "If you want to get indopak script of a specific juz.",
            "schema": {
              "maximum": 30,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "page_number",
            "in": "query",
            "description": "If you want to get indopak script of a Madani Mushaf page",
            "schema": {
              "maximum": 604,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "hizb_number",
            "in": "query",
            "description": "If you want to get indopak script of a specific hizb.",
            "schema": {
              "maximum": 60,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "rub_el_hizb_number",
            "in": "query",
            "description": "If you want to get indopak script of a specific Rub el Hizb.",
            "schema": {
              "maximum": 240,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "manzil_number",
            "in": "query",
            "description": "If you want to get indopak script of a specific manzil.",
            "schema": {
              "maximum": 7,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "ruku_number",
            "in": "query",
            "description": "If you want to get indopak script of a specific ruku.",
            "schema": {
              "maximum": 558,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "verse_key",
            "in": "query",
            "description": "If you want to get indopak script of a specific ayah.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["verses", "meta"],
                  "properties": {
                    "verses": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/QuranVerseText"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/QuranFiltersMeta"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "verses": [
                        {
                          "id": 1,
                          "verse_key": "1:1",
                          "text_indopak": "بِسۡمِ اللهِ الرَّحۡمٰنِ الرَّحِيۡمِ"
                        }
                      ],
                      "meta": {
                        "filters": {
                          "chapter_number": 1
                        }
                      }
                    }
                  },
                  "chapter_filter": {
                    "summary": "Text for a chapter filter",
                    "value": {
                      "verses": [
                        {
                          "id": 1,
                          "verse_key": "1:1",
                          "text_indopak": "بِسۡمِ اللهِ الرَّحۡمٰنِ الرَّحِيۡمِ"
                        }
                      ],
                      "meta": {
                        "filters": {
                          "chapter_number": 1
                        }
                      }
                    }
                  },
                  "single_ayah_filter": {
                    "summary": "Text for one ayah",
                    "value": {
                      "verses": [
                        {
                          "id": 1,
                          "verse_key": "1:1",
                          "text_indopak": "بِسۡمِ اللهِ الرَّحۡمٰنِ الرَّحِيۡمِ"
                        }
                      ],
                      "meta": {
                        "filters": {
                          "verse_key": "1:1"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get Indopak Script of ayah\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(options = {}) {\n  const response = await axios.get(\n    `${API_BASE_URL}/quran/verses/indopak`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      },\n      params: options\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi({\"chapter_number\":\"1\",\"juz_number\":\"1\",\"page_number\":\"1\"})\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get Indopak Script of ayah\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(chapter_number=None, juz_number=None, page_number=None):\n    params = {k: v for k, v in {'chapter_number': chapter_number, 'juz_number': juz_number, 'page_number': page_number}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/quran/verses/indopak',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(chapter_number=\"1\", juz_number=\"1\", page_number=\"1\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get Indopak Script of ayah\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(params map[string]string) (string, error) {\n  path := \"/quran/verses/indopak\"\n  endpoint := API_BASE_URL + path\n  if params != nil && len(params) > 0 {\n    values := url.Values{}\n    for k, v := range params {\n      values.Set(k, v)\n    }\n    endpoint = endpoint + \"?\" + values.Encode()\n  }\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  params := map[string]string{\"chapter_number\": \"1\", \"juz_number\": \"1\", \"page_number\": \"1\"}\n  data, err := callApi(params)\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get Indopak Script of ayah\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(params = {})\n  path = \"/quran/verses/indopak\"\n  uri = URI(API_BASE_URL + path)\n  uri.query = URI.encode_www_form(params) if params && !params.empty?\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\nparams = { \"chapter_number\" => \"1\", \"juz_number\" => \"1\", \"page_number\" => \"1\" }\ndata = call_api(params)\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get Indopak Script of ayah\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(Dictionary<string, string> query = null)\n{\n    var path = $@\"/quran/verses/indopak\";\n    var url = API_BASE_URL + path;\n    if (query != null && query.Count > 0)\n    {\n        var queryString = string.Join(\"&\", query.Select(kvp =>\n            $\"{Uri.EscapeDataString(kvp.Key)}={Uri.EscapeDataString(kvp.Value)}\"));\n        url = $\"{url}?{queryString}\";\n    }\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar query = new Dictionary<string, string> { {\"chapter_number\", \"1\"}, {\"juz_number\", \"1\"}, {\"page_number\", \"1\"} };\nvar data = await CallApiAsync(query);\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get Indopak Script of ayah\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($params = []) {\n  $path = \"/quran/verses/indopak\";\n  $url = API_BASE_URL . $path;\n  if (!empty($params)) {\n    $url .= '?' . http_build_query($params);\n  }\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$params = ['chapter_number' => '1', 'juz_number' => '1', 'page_number' => '1'];\n$data = callApi($params);\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get Indopak Script of ayah\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(Map<String, String> params) throws IOException {\n    String path = \"/quran/verses/indopak\";\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    if (params != null) {\n      for (Map.Entry<String, String> entry : params.entrySet()) {\n        urlBuilder.addQueryParameter(entry.getKey(), entry.getValue());\n      }\n    }\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    Map<String, String> params = new HashMap<>();\n    params.put(\"chapter_number\", \"1\");\n    params.put(\"juz_number\", \"1\");\n    params.put(\"page_number\", \"1\");\n    String data = callApi(params);\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get Indopak Script of ayah\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([hashtable]$params = @{}) {\n  $path = \"/quran/verses/indopak\"\n  $url = \"$API_BASE_URL$path\"\n  if ($params.Count -gt 0) {\n    $query = ($params.GetEnumerator() | ForEach-Object {\n      \"$($_.Key)=$([System.Uri]::EscapeDataString([string]$_.Value))\"\n    }) -join \"&\"\n    $url = \"$url?$query\"\n  }\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$params = @{ chapter_number = \"1\"; juz_number = \"1\"; page_number = \"1\" }\n$data = Call-Api($params)\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get Indopak Script of ayah\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/quran/verses/indopak?chapter_number=1&juz_number=1&page_number=1' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get indopak script of ayah using the Quran Foundation API.\n\nEndpoint: GET /quran/verses/indopak\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nOptional Query Parameters:\n  chapter_number: If you want to get indopak script of a specific surah.\n  juz_number: If you want to get indopak script of a specific juz.\n  page_number: If you want to get indopak script of a Madani Mushaf page\n  hizb_number: If you want to get indopak script of a specific hizb.\n  rub_el_hizb_number: If you want to get indopak script of a specific Rub el Hizb.\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/quran/verses/indopak?{queryParams}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/quran/verses/indopak_nastaleeq": {
      "get": {
        "tags": ["Quran"],
        "summary": "Get Indopak Nastaleeq Script of ayah",
        "description": "Get Indopak Nastaleeq script of ayah. Use query strings to filter results, leave all query string blank if you want to fetch Indopak Nastaleeq script of whole Quran.",
        "operationId": "QURAN-verses-indopak-nastaleeq",
        "parameters": [
          {
            "name": "chapter_number",
            "in": "query",
            "description": "If you want to get Indopak Nastaleeq script of a specific surah.",
            "schema": {
              "maximum": 114,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "juz_number",
            "in": "query",
            "description": "If you want to get Indopak Nastaleeq script of a specific juz.",
            "schema": {
              "maximum": 30,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "page_number",
            "in": "query",
            "description": "If you want to get Indopak Nastaleeq script of a Madani Mushaf page",
            "schema": {
              "maximum": 604,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "hizb_number",
            "in": "query",
            "description": "If you want to get Indopak Nastaleeq script of a specific hizb.",
            "schema": {
              "maximum": 60,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "rub_el_hizb_number",
            "in": "query",
            "description": "If you want to get Indopak Nastaleeq script of a specific Rub el Hizb.",
            "schema": {
              "maximum": 240,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "manzil_number",
            "in": "query",
            "description": "If you want to get Indopak Nastaleeq script of a specific manzil.",
            "schema": {
              "maximum": 7,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "ruku_number",
            "in": "query",
            "description": "If you want to get Indopak Nastaleeq script of a specific ruku.",
            "schema": {
              "maximum": 558,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "verse_key",
            "in": "query",
            "description": "If you want to get Indopak Nastaleeq script of a specific ayah.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["verses", "meta"],
                  "properties": {
                    "verses": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/QuranVerseText"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/QuranFiltersMeta"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "verses": [
                        {
                          "id": 1,
                          "verse_key": "1:1",
                          "text_indopak_nastaleeq": "بِسۡمِ اللهِ الرَّحۡمٰنِ الرَّحِيۡمِ"
                        }
                      ],
                      "meta": {
                        "filters": {
                          "chapter_number": 1
                        }
                      }
                    }
                  },
                  "chapter_filter": {
                    "summary": "Text for a chapter filter",
                    "value": {
                      "verses": [
                        {
                          "id": 1,
                          "verse_key": "1:1",
                          "text_indopak_nastaleeq": "بِسۡمِ اللهِ الرَّحۡمٰنِ الرَّحِيۡمِ"
                        }
                      ],
                      "meta": {
                        "filters": {
                          "chapter_number": 1
                        }
                      }
                    }
                  },
                  "single_ayah_filter": {
                    "summary": "Text for one ayah",
                    "value": {
                      "verses": [
                        {
                          "id": 1,
                          "verse_key": "1:1",
                          "text_indopak_nastaleeq": "بِسۡمِ اللهِ الرَّحۡمٰنِ الرَّحِيۡمِ"
                        }
                      ],
                      "meta": {
                        "filters": {
                          "verse_key": "1:1"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get Indopak Nastaleeq Script of ayah\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(options = {}) {\n  const response = await axios.get(\n    `${API_BASE_URL}/quran/verses/indopak_nastaleeq`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      },\n      params: options\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi({\"chapter_number\":\"1\",\"juz_number\":\"1\",\"page_number\":\"1\"})\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get Indopak Nastaleeq Script of ayah\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(chapter_number=None, juz_number=None, page_number=None):\n    params = {k: v for k, v in {'chapter_number': chapter_number, 'juz_number': juz_number, 'page_number': page_number}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/quran/verses/indopak_nastaleeq',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(chapter_number=\"1\", juz_number=\"1\", page_number=\"1\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get Indopak Nastaleeq Script of ayah\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(params map[string]string) (string, error) {\n  path := \"/quran/verses/indopak_nastaleeq\"\n  endpoint := API_BASE_URL + path\n  if params != nil && len(params) > 0 {\n    values := url.Values{}\n    for k, v := range params {\n      values.Set(k, v)\n    }\n    endpoint = endpoint + \"?\" + values.Encode()\n  }\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  params := map[string]string{\"chapter_number\": \"1\", \"juz_number\": \"1\", \"page_number\": \"1\"}\n  data, err := callApi(params)\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get Indopak Nastaleeq Script of ayah\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(params = {})\n  path = \"/quran/verses/indopak_nastaleeq\"\n  uri = URI(API_BASE_URL + path)\n  uri.query = URI.encode_www_form(params) if params && !params.empty?\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\nparams = { \"chapter_number\" => \"1\", \"juz_number\" => \"1\", \"page_number\" => \"1\" }\ndata = call_api(params)\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get Indopak Nastaleeq Script of ayah\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(Dictionary<string, string> query = null)\n{\n    var path = $@\"/quran/verses/indopak_nastaleeq\";\n    var url = API_BASE_URL + path;\n    if (query != null && query.Count > 0)\n    {\n        var queryString = string.Join(\"&\", query.Select(kvp =>\n            $\"{Uri.EscapeDataString(kvp.Key)}={Uri.EscapeDataString(kvp.Value)}\"));\n        url = $\"{url}?{queryString}\";\n    }\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar query = new Dictionary<string, string> { {\"chapter_number\", \"1\"}, {\"juz_number\", \"1\"}, {\"page_number\", \"1\"} };\nvar data = await CallApiAsync(query);\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get Indopak Nastaleeq Script of ayah\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($params = []) {\n  $path = \"/quran/verses/indopak_nastaleeq\";\n  $url = API_BASE_URL . $path;\n  if (!empty($params)) {\n    $url .= '?' . http_build_query($params);\n  }\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$params = ['chapter_number' => '1', 'juz_number' => '1', 'page_number' => '1'];\n$data = callApi($params);\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get Indopak Nastaleeq Script of ayah\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(Map<String, String> params) throws IOException {\n    String path = \"/quran/verses/indopak_nastaleeq\";\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    if (params != null) {\n      for (Map.Entry<String, String> entry : params.entrySet()) {\n        urlBuilder.addQueryParameter(entry.getKey(), entry.getValue());\n      }\n    }\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    Map<String, String> params = new HashMap<>();\n    params.put(\"chapter_number\", \"1\");\n    params.put(\"juz_number\", \"1\");\n    params.put(\"page_number\", \"1\");\n    String data = callApi(params);\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get Indopak Nastaleeq Script of ayah\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([hashtable]$params = @{}) {\n  $path = \"/quran/verses/indopak_nastaleeq\"\n  $url = \"$API_BASE_URL$path\"\n  if ($params.Count -gt 0) {\n    $query = ($params.GetEnumerator() | ForEach-Object {\n      \"$($_.Key)=$([System.Uri]::EscapeDataString([string]$_.Value))\"\n    }) -join \"&\"\n    $url = \"$url?$query\"\n  }\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$params = @{ chapter_number = \"1\"; juz_number = \"1\"; page_number = \"1\" }\n$data = Call-Api($params)\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get Indopak Nastaleeq Script of ayah\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/quran/verses/indopak_nastaleeq?chapter_number=1&juz_number=1&page_number=1' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get indopak nastaleeq script of ayah using the Quran Foundation API.\n\nEndpoint: GET /quran/verses/indopak_nastaleeq\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nOptional Query Parameters:\n  chapter_number: If you want to get Indopak Nastaleeq script of a specific surah.\n  juz_number: If you want to get Indopak Nastaleeq script of a specific juz.\n  page_number: If you want to get Indopak Nastaleeq script of a Madani Mushaf page\n  hizb_number: If you want to get Indopak Nastaleeq script of a specific hizb.\n  rub_el_hizb_number: If you want to get Indopak Nastaleeq script of a specific Rub el Hizb.\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/quran/verses/indopak_nastaleeq?{queryParams}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/quran/verses/uthmani_tajweed": {
      "get": {
        "tags": ["Quran"],
        "summary": "Get Uthmani Tajweed Script of ayah",
        "description": "Get Uthmani color coded tajweed text of ayah. Tajweed rules are embedded in text as `tajweed` html tags.",
        "operationId": "QURAN-verses-uthmani-tajweed",
        "parameters": [
          {
            "name": "chapter_number",
            "in": "query",
            "description": "If you want to get text of a specific surah.",
            "schema": {
              "maximum": 114,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "juz_number",
            "in": "query",
            "description": "If you want to get text of a specific juz.",
            "schema": {
              "maximum": 30,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "page_number",
            "in": "query",
            "description": "If you want to get text of a Madani Mushaf page",
            "schema": {
              "maximum": 604,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "hizb_number",
            "in": "query",
            "description": "If you want to get text of a specific hizb.",
            "schema": {
              "maximum": 60,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "rub_el_hizb_number",
            "in": "query",
            "description": "If you want to get text of a specific Rub el Hizb.",
            "schema": {
              "maximum": 240,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "manzil_number",
            "in": "query",
            "description": "If you want to get text of a specific manzil.",
            "schema": {
              "maximum": 7,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "ruku_number",
            "in": "query",
            "description": "If you want to get text of a specific ruku.",
            "schema": {
              "maximum": 558,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "verse_key",
            "in": "query",
            "description": "If you want to get text of a specific ayah.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["verses", "meta"],
                  "properties": {
                    "verses": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/QuranVerseText"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/QuranFiltersMeta"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "verses": [
                        {
                          "id": 1,
                          "verse_key": "1:1",
                          "text_uthmani_tajweed": "بِسْمِ <tajweed class=ham_wasl>ٱ</tajweed>للَّهِ <tajweed class=ham_wasl>ٱ</tajweed><tajweed class=laam_shamsiyah>ل</tajweed>رَّحْمَ<tajweed class=madda_normal>ـٰ</tajweed>نِ <tajweed class=ham_wasl>ٱ</tajweed><tajweed class=laam_shamsiyah>ل</tajweed>رَّح<tajweed class=madda_permissible>ِي</tajweed>مِ <span class=end>١</span>"
                        }
                      ],
                      "meta": {
                        "filters": {
                          "chapter_number": 1
                        }
                      }
                    }
                  },
                  "chapter_filter": {
                    "summary": "Text for a chapter filter",
                    "value": {
                      "verses": [
                        {
                          "id": 1,
                          "verse_key": "1:1",
                          "text_uthmani_tajweed": "بِسْمِ <tajweed class=ham_wasl>ٱ</tajweed>للَّهِ <tajweed class=ham_wasl>ٱ</tajweed><tajweed class=laam_shamsiyah>ل</tajweed>رَّحْمَ<tajweed class=madda_normal>ـٰ</tajweed>نِ <tajweed class=ham_wasl>ٱ</tajweed><tajweed class=laam_shamsiyah>ل</tajweed>رَّح<tajweed class=madda_permissible>ِي</tajweed>مِ <span class=end>١</span>"
                        }
                      ],
                      "meta": {
                        "filters": {
                          "chapter_number": 1
                        }
                      }
                    }
                  },
                  "single_ayah_filter": {
                    "summary": "Text for one ayah",
                    "value": {
                      "verses": [
                        {
                          "id": 1,
                          "verse_key": "1:1",
                          "text_uthmani_tajweed": "بِسْمِ <tajweed class=ham_wasl>ٱ</tajweed>للَّهِ <tajweed class=ham_wasl>ٱ</tajweed><tajweed class=laam_shamsiyah>ل</tajweed>رَّحْمَ<tajweed class=madda_normal>ـٰ</tajweed>نِ <tajweed class=ham_wasl>ٱ</tajweed><tajweed class=laam_shamsiyah>ل</tajweed>رَّح<tajweed class=madda_permissible>ِي</tajweed>مِ <span class=end>١</span>"
                        }
                      ],
                      "meta": {
                        "filters": {
                          "verse_key": "1:1"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get Uthmani Tajweed Script of ayah\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(options = {}) {\n  const response = await axios.get(\n    `${API_BASE_URL}/quran/verses/uthmani_tajweed`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      },\n      params: options\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi({\"chapter_number\":\"1\",\"juz_number\":\"1\",\"page_number\":\"1\"})\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get Uthmani Tajweed Script of ayah\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(chapter_number=None, juz_number=None, page_number=None):\n    params = {k: v for k, v in {'chapter_number': chapter_number, 'juz_number': juz_number, 'page_number': page_number}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/quran/verses/uthmani_tajweed',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(chapter_number=\"1\", juz_number=\"1\", page_number=\"1\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get Uthmani Tajweed Script of ayah\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(params map[string]string) (string, error) {\n  path := \"/quran/verses/uthmani_tajweed\"\n  endpoint := API_BASE_URL + path\n  if params != nil && len(params) > 0 {\n    values := url.Values{}\n    for k, v := range params {\n      values.Set(k, v)\n    }\n    endpoint = endpoint + \"?\" + values.Encode()\n  }\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  params := map[string]string{\"chapter_number\": \"1\", \"juz_number\": \"1\", \"page_number\": \"1\"}\n  data, err := callApi(params)\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get Uthmani Tajweed Script of ayah\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(params = {})\n  path = \"/quran/verses/uthmani_tajweed\"\n  uri = URI(API_BASE_URL + path)\n  uri.query = URI.encode_www_form(params) if params && !params.empty?\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\nparams = { \"chapter_number\" => \"1\", \"juz_number\" => \"1\", \"page_number\" => \"1\" }\ndata = call_api(params)\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get Uthmani Tajweed Script of ayah\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(Dictionary<string, string> query = null)\n{\n    var path = $@\"/quran/verses/uthmani_tajweed\";\n    var url = API_BASE_URL + path;\n    if (query != null && query.Count > 0)\n    {\n        var queryString = string.Join(\"&\", query.Select(kvp =>\n            $\"{Uri.EscapeDataString(kvp.Key)}={Uri.EscapeDataString(kvp.Value)}\"));\n        url = $\"{url}?{queryString}\";\n    }\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar query = new Dictionary<string, string> { {\"chapter_number\", \"1\"}, {\"juz_number\", \"1\"}, {\"page_number\", \"1\"} };\nvar data = await CallApiAsync(query);\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get Uthmani Tajweed Script of ayah\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($params = []) {\n  $path = \"/quran/verses/uthmani_tajweed\";\n  $url = API_BASE_URL . $path;\n  if (!empty($params)) {\n    $url .= '?' . http_build_query($params);\n  }\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$params = ['chapter_number' => '1', 'juz_number' => '1', 'page_number' => '1'];\n$data = callApi($params);\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get Uthmani Tajweed Script of ayah\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(Map<String, String> params) throws IOException {\n    String path = \"/quran/verses/uthmani_tajweed\";\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    if (params != null) {\n      for (Map.Entry<String, String> entry : params.entrySet()) {\n        urlBuilder.addQueryParameter(entry.getKey(), entry.getValue());\n      }\n    }\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    Map<String, String> params = new HashMap<>();\n    params.put(\"chapter_number\", \"1\");\n    params.put(\"juz_number\", \"1\");\n    params.put(\"page_number\", \"1\");\n    String data = callApi(params);\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get Uthmani Tajweed Script of ayah\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([hashtable]$params = @{}) {\n  $path = \"/quran/verses/uthmani_tajweed\"\n  $url = \"$API_BASE_URL$path\"\n  if ($params.Count -gt 0) {\n    $query = ($params.GetEnumerator() | ForEach-Object {\n      \"$($_.Key)=$([System.Uri]::EscapeDataString([string]$_.Value))\"\n    }) -join \"&\"\n    $url = \"$url?$query\"\n  }\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$params = @{ chapter_number = \"1\"; juz_number = \"1\"; page_number = \"1\" }\n$data = Call-Api($params)\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get Uthmani Tajweed Script of ayah\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/quran/verses/uthmani_tajweed?chapter_number=1&juz_number=1&page_number=1' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get uthmani tajweed script of ayah using the Quran Foundation API.\n\nEndpoint: GET /quran/verses/uthmani_tajweed\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nOptional Query Parameters:\n  chapter_number: If you want to get text of a specific surah.\n  juz_number: If you want to get text of a specific juz.\n  page_number: If you want to get text of a Madani Mushaf page\n  hizb_number: If you want to get text of a specific hizb.\n  rub_el_hizb_number: If you want to get text of a specific Rub el Hizb.\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/quran/verses/uthmani_tajweed?{queryParams}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/quran/verses/uthmani": {
      "get": {
        "tags": ["Quran"],
        "summary": "Get Uthmani Script of ayah",
        "description": "Get Uthmani script of ayah. Use query strings to filter results, leave all query string blank if you want to fetch Uthmani script of whole Quran.",
        "operationId": "QURAN-verses-uthmani",
        "parameters": [
          {
            "name": "chapter_number",
            "in": "query",
            "description": "If you want to get Uthmani script of a specific surah.",
            "schema": {
              "maximum": 114,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "juz_number",
            "in": "query",
            "description": "If you want to get Uthmani script of a specific juz.",
            "schema": {
              "maximum": 30,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "page_number",
            "in": "query",
            "description": "If you want to get Uthmani script of a Madani Mushaf page",
            "schema": {
              "maximum": 604,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "hizb_number",
            "in": "query",
            "description": "If you want to get Uthmani script of a specific hizb.",
            "schema": {
              "maximum": 60,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "rub_el_hizb_number",
            "in": "query",
            "description": "If you want to get Uthmani script of a specific Rub el Hizb.",
            "schema": {
              "maximum": 240,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "manzil_number",
            "in": "query",
            "description": "If you want to get Uthmani script of a specific manzil.",
            "schema": {
              "maximum": 7,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "ruku_number",
            "in": "query",
            "description": "If you want to get Uthmani script of a specific ruku.",
            "schema": {
              "maximum": 558,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "verse_key",
            "in": "query",
            "description": "If you want to get Uthmani script of a specific ayah.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["verses", "meta"],
                  "properties": {
                    "verses": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/QuranVerseText"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/QuranFiltersMeta"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "verses": [
                        {
                          "id": 1,
                          "verse_key": "1:1",
                          "text_uthmani": "بِسْمِ ٱللَّهِ ٱلرَّحْمَـٰنِ ٱلرَّحِيمِ"
                        }
                      ],
                      "meta": {
                        "filters": {
                          "chapter_number": 1
                        }
                      }
                    }
                  },
                  "chapter_filter": {
                    "summary": "Text for a chapter filter",
                    "value": {
                      "verses": [
                        {
                          "id": 1,
                          "verse_key": "1:1",
                          "text_uthmani": "بِسْمِ ٱللَّهِ ٱلرَّحْمَـٰنِ ٱلرَّحِيمِ"
                        }
                      ],
                      "meta": {
                        "filters": {
                          "chapter_number": 1
                        }
                      }
                    }
                  },
                  "single_ayah_filter": {
                    "summary": "Text for one ayah",
                    "value": {
                      "verses": [
                        {
                          "id": 1,
                          "verse_key": "1:1",
                          "text_uthmani": "بِسْمِ ٱللَّهِ ٱلرَّحْمَـٰنِ ٱلرَّحِيمِ"
                        }
                      ],
                      "meta": {
                        "filters": {
                          "verse_key": "1:1"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get Uthmani Script of ayah\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(options = {}) {\n  const response = await axios.get(\n    `${API_BASE_URL}/quran/verses/uthmani`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      },\n      params: options\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi({\"chapter_number\":\"1\",\"juz_number\":\"1\",\"page_number\":\"1\"})\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get Uthmani Script of ayah\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(chapter_number=None, juz_number=None, page_number=None):\n    params = {k: v for k, v in {'chapter_number': chapter_number, 'juz_number': juz_number, 'page_number': page_number}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/quran/verses/uthmani',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(chapter_number=\"1\", juz_number=\"1\", page_number=\"1\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get Uthmani Script of ayah\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(params map[string]string) (string, error) {\n  path := \"/quran/verses/uthmani\"\n  endpoint := API_BASE_URL + path\n  if params != nil && len(params) > 0 {\n    values := url.Values{}\n    for k, v := range params {\n      values.Set(k, v)\n    }\n    endpoint = endpoint + \"?\" + values.Encode()\n  }\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  params := map[string]string{\"chapter_number\": \"1\", \"juz_number\": \"1\", \"page_number\": \"1\"}\n  data, err := callApi(params)\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get Uthmani Script of ayah\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(params = {})\n  path = \"/quran/verses/uthmani\"\n  uri = URI(API_BASE_URL + path)\n  uri.query = URI.encode_www_form(params) if params && !params.empty?\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\nparams = { \"chapter_number\" => \"1\", \"juz_number\" => \"1\", \"page_number\" => \"1\" }\ndata = call_api(params)\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get Uthmani Script of ayah\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(Dictionary<string, string> query = null)\n{\n    var path = $@\"/quran/verses/uthmani\";\n    var url = API_BASE_URL + path;\n    if (query != null && query.Count > 0)\n    {\n        var queryString = string.Join(\"&\", query.Select(kvp =>\n            $\"{Uri.EscapeDataString(kvp.Key)}={Uri.EscapeDataString(kvp.Value)}\"));\n        url = $\"{url}?{queryString}\";\n    }\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar query = new Dictionary<string, string> { {\"chapter_number\", \"1\"}, {\"juz_number\", \"1\"}, {\"page_number\", \"1\"} };\nvar data = await CallApiAsync(query);\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get Uthmani Script of ayah\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($params = []) {\n  $path = \"/quran/verses/uthmani\";\n  $url = API_BASE_URL . $path;\n  if (!empty($params)) {\n    $url .= '?' . http_build_query($params);\n  }\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$params = ['chapter_number' => '1', 'juz_number' => '1', 'page_number' => '1'];\n$data = callApi($params);\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get Uthmani Script of ayah\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(Map<String, String> params) throws IOException {\n    String path = \"/quran/verses/uthmani\";\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    if (params != null) {\n      for (Map.Entry<String, String> entry : params.entrySet()) {\n        urlBuilder.addQueryParameter(entry.getKey(), entry.getValue());\n      }\n    }\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    Map<String, String> params = new HashMap<>();\n    params.put(\"chapter_number\", \"1\");\n    params.put(\"juz_number\", \"1\");\n    params.put(\"page_number\", \"1\");\n    String data = callApi(params);\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get Uthmani Script of ayah\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([hashtable]$params = @{}) {\n  $path = \"/quran/verses/uthmani\"\n  $url = \"$API_BASE_URL$path\"\n  if ($params.Count -gt 0) {\n    $query = ($params.GetEnumerator() | ForEach-Object {\n      \"$($_.Key)=$([System.Uri]::EscapeDataString([string]$_.Value))\"\n    }) -join \"&\"\n    $url = \"$url?$query\"\n  }\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$params = @{ chapter_number = \"1\"; juz_number = \"1\"; page_number = \"1\" }\n$data = Call-Api($params)\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get Uthmani Script of ayah\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/quran/verses/uthmani?chapter_number=1&juz_number=1&page_number=1' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get uthmani script of ayah using the Quran Foundation API.\n\nEndpoint: GET /quran/verses/uthmani\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nOptional Query Parameters:\n  chapter_number: If you want to get Uthmani script of a specific surah.\n  juz_number: If you want to get Uthmani script of a specific juz.\n  page_number: If you want to get Uthmani script of a Madani Mushaf page\n  hizb_number: If you want to get Uthmani script of a specific hizb.\n  rub_el_hizb_number: If you want to get Uthmani script of a specific Rub el Hizb.\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/quran/verses/uthmani?{queryParams}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/quran/verses/uthmani_simple": {
      "get": {
        "tags": ["Quran"],
        "summary": "Get Uthmani simple script of ayah",
        "description": "Get Uthmani simple script(without tashkiq/diacritical marks) of ayah. Use query strings to filter results, leave all query string blank if you want to fetch script of whole Quran.",
        "operationId": "QURAN-verses-uthmani_simple",
        "parameters": [
          {
            "name": "chapter_number",
            "in": "query",
            "description": "If you want to get Uthmani script of a specific surah.",
            "schema": {
              "maximum": 114,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "juz_number",
            "in": "query",
            "description": "If you want to get Uthmani script of a specific juz.",
            "schema": {
              "maximum": 30,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "page_number",
            "in": "query",
            "description": "If you want to get Uthmani script of a Madani Mushaf page",
            "schema": {
              "maximum": 604,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "hizb_number",
            "in": "query",
            "description": "If you want to get Uthmani script of a specific hizb.",
            "schema": {
              "maximum": 60,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "rub_el_hizb_number",
            "in": "query",
            "description": "If you want to get Uthmani script of a specific Rub el Hizb.",
            "schema": {
              "maximum": 240,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "manzil_number",
            "in": "query",
            "description": "If you want to get Uthmani script of a specific manzil.",
            "schema": {
              "maximum": 7,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "ruku_number",
            "in": "query",
            "description": "If you want to get Uthmani script of a specific ruku.",
            "schema": {
              "maximum": 558,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "verse_key",
            "in": "query",
            "description": "If you want to get Uthmani script of a specific ayah.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["verses", "meta"],
                  "properties": {
                    "verses": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/QuranVerseText"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/QuranFiltersMeta"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "verses": [
                        {
                          "id": 1,
                          "verse_key": "1:1",
                          "text_uthmani_simple": "بسم الله الرحمن الرحيم"
                        }
                      ],
                      "meta": {
                        "filters": {
                          "chapter_number": 1
                        }
                      }
                    }
                  },
                  "chapter_filter": {
                    "summary": "Text for a chapter filter",
                    "value": {
                      "verses": [
                        {
                          "id": 1,
                          "verse_key": "1:1",
                          "text_uthmani_simple": "بسم الله الرحمن الرحيم"
                        }
                      ],
                      "meta": {
                        "filters": {
                          "chapter_number": 1
                        }
                      }
                    }
                  },
                  "single_ayah_filter": {
                    "summary": "Text for one ayah",
                    "value": {
                      "verses": [
                        {
                          "id": 1,
                          "verse_key": "1:1",
                          "text_uthmani_simple": "بسم الله الرحمن الرحيم"
                        }
                      ],
                      "meta": {
                        "filters": {
                          "verse_key": "1:1"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get Uthmani simple script of ayah\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(options = {}) {\n  const response = await axios.get(\n    `${API_BASE_URL}/quran/verses/uthmani_simple`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      },\n      params: options\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi({\"chapter_number\":\"1\",\"juz_number\":\"1\",\"page_number\":\"1\"})\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get Uthmani simple script of ayah\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(chapter_number=None, juz_number=None, page_number=None):\n    params = {k: v for k, v in {'chapter_number': chapter_number, 'juz_number': juz_number, 'page_number': page_number}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/quran/verses/uthmani_simple',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(chapter_number=\"1\", juz_number=\"1\", page_number=\"1\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get Uthmani simple script of ayah\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(params map[string]string) (string, error) {\n  path := \"/quran/verses/uthmani_simple\"\n  endpoint := API_BASE_URL + path\n  if params != nil && len(params) > 0 {\n    values := url.Values{}\n    for k, v := range params {\n      values.Set(k, v)\n    }\n    endpoint = endpoint + \"?\" + values.Encode()\n  }\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  params := map[string]string{\"chapter_number\": \"1\", \"juz_number\": \"1\", \"page_number\": \"1\"}\n  data, err := callApi(params)\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get Uthmani simple script of ayah\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(params = {})\n  path = \"/quran/verses/uthmani_simple\"\n  uri = URI(API_BASE_URL + path)\n  uri.query = URI.encode_www_form(params) if params && !params.empty?\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\nparams = { \"chapter_number\" => \"1\", \"juz_number\" => \"1\", \"page_number\" => \"1\" }\ndata = call_api(params)\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get Uthmani simple script of ayah\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(Dictionary<string, string> query = null)\n{\n    var path = $@\"/quran/verses/uthmani_simple\";\n    var url = API_BASE_URL + path;\n    if (query != null && query.Count > 0)\n    {\n        var queryString = string.Join(\"&\", query.Select(kvp =>\n            $\"{Uri.EscapeDataString(kvp.Key)}={Uri.EscapeDataString(kvp.Value)}\"));\n        url = $\"{url}?{queryString}\";\n    }\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar query = new Dictionary<string, string> { {\"chapter_number\", \"1\"}, {\"juz_number\", \"1\"}, {\"page_number\", \"1\"} };\nvar data = await CallApiAsync(query);\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get Uthmani simple script of ayah\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($params = []) {\n  $path = \"/quran/verses/uthmani_simple\";\n  $url = API_BASE_URL . $path;\n  if (!empty($params)) {\n    $url .= '?' . http_build_query($params);\n  }\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$params = ['chapter_number' => '1', 'juz_number' => '1', 'page_number' => '1'];\n$data = callApi($params);\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get Uthmani simple script of ayah\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(Map<String, String> params) throws IOException {\n    String path = \"/quran/verses/uthmani_simple\";\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    if (params != null) {\n      for (Map.Entry<String, String> entry : params.entrySet()) {\n        urlBuilder.addQueryParameter(entry.getKey(), entry.getValue());\n      }\n    }\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    Map<String, String> params = new HashMap<>();\n    params.put(\"chapter_number\", \"1\");\n    params.put(\"juz_number\", \"1\");\n    params.put(\"page_number\", \"1\");\n    String data = callApi(params);\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get Uthmani simple script of ayah\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([hashtable]$params = @{}) {\n  $path = \"/quran/verses/uthmani_simple\"\n  $url = \"$API_BASE_URL$path\"\n  if ($params.Count -gt 0) {\n    $query = ($params.GetEnumerator() | ForEach-Object {\n      \"$($_.Key)=$([System.Uri]::EscapeDataString([string]$_.Value))\"\n    }) -join \"&\"\n    $url = \"$url?$query\"\n  }\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$params = @{ chapter_number = \"1\"; juz_number = \"1\"; page_number = \"1\" }\n$data = Call-Api($params)\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get Uthmani simple script of ayah\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/quran/verses/uthmani_simple?chapter_number=1&juz_number=1&page_number=1' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get uthmani simple script of ayah using the Quran Foundation API.\n\nEndpoint: GET /quran/verses/uthmani_simple\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nOptional Query Parameters:\n  chapter_number: If you want to get Uthmani script of a specific surah.\n  juz_number: If you want to get Uthmani script of a specific juz.\n  page_number: If you want to get Uthmani script of a Madani Mushaf page\n  hizb_number: If you want to get Uthmani script of a specific hizb.\n  rub_el_hizb_number: If you want to get Uthmani script of a specific Rub el Hizb.\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/quran/verses/uthmani_simple?{queryParams}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/quran/verses/imlaei": {
      "get": {
        "tags": ["Quran"],
        "summary": "Get Imlaei Simple text of ayah",
        "description": "Get Imlaei simple script(without tashkiq/diacritical marks) of ayah.",
        "operationId": "QURAN-verses-Imlaei",
        "parameters": [
          {
            "name": "chapter_number",
            "in": "query",
            "description": "If you want to get text of a specific surah.",
            "schema": {
              "maximum": 114,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "juz_number",
            "in": "query",
            "description": "If you want to get text of a specific juz.",
            "schema": {
              "maximum": 30,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "page_number",
            "in": "query",
            "description": "If you want to get text of a Madani Mushaf page",
            "schema": {
              "maximum": 604,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "hizb_number",
            "in": "query",
            "description": "If you want to get text of a specific hizb.",
            "schema": {
              "maximum": 60,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "rub_el_hizb_number",
            "in": "query",
            "description": "If you want to get text of a specific Rub el Hizb.",
            "schema": {
              "maximum": 240,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "manzil_number",
            "in": "query",
            "description": "If you want to get text of a specific manzil.",
            "schema": {
              "maximum": 7,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "ruku_number",
            "in": "query",
            "description": "If you want to get text of a specific ruku.",
            "schema": {
              "maximum": 558,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "verse_key",
            "in": "query",
            "description": "If you want to get text of a specific ayah.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["verses", "meta"],
                  "properties": {
                    "verses": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/QuranVerseText"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/QuranFiltersMeta"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "verses": [
                        {
                          "id": 1,
                          "verse_key": "1:1",
                          "text_imlaei": "بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ"
                        }
                      ],
                      "meta": {
                        "filters": {
                          "chapter_number": 1
                        }
                      }
                    }
                  },
                  "chapter_filter": {
                    "summary": "Text for a chapter filter",
                    "value": {
                      "verses": [
                        {
                          "id": 1,
                          "verse_key": "1:1",
                          "text_imlaei": "بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ"
                        }
                      ],
                      "meta": {
                        "filters": {
                          "chapter_number": 1
                        }
                      }
                    }
                  },
                  "single_ayah_filter": {
                    "summary": "Text for one ayah",
                    "value": {
                      "verses": [
                        {
                          "id": 1,
                          "verse_key": "1:1",
                          "text_imlaei": "بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ"
                        }
                      ],
                      "meta": {
                        "filters": {
                          "verse_key": "1:1"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get Imlaei Simple text of ayah\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(options = {}) {\n  const response = await axios.get(\n    `${API_BASE_URL}/quran/verses/imlaei`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      },\n      params: options\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi({\"chapter_number\":\"1\",\"juz_number\":\"1\",\"page_number\":\"1\"})\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get Imlaei Simple text of ayah\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(chapter_number=None, juz_number=None, page_number=None):\n    params = {k: v for k, v in {'chapter_number': chapter_number, 'juz_number': juz_number, 'page_number': page_number}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/quran/verses/imlaei',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(chapter_number=\"1\", juz_number=\"1\", page_number=\"1\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get Imlaei Simple text of ayah\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(params map[string]string) (string, error) {\n  path := \"/quran/verses/imlaei\"\n  endpoint := API_BASE_URL + path\n  if params != nil && len(params) > 0 {\n    values := url.Values{}\n    for k, v := range params {\n      values.Set(k, v)\n    }\n    endpoint = endpoint + \"?\" + values.Encode()\n  }\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  params := map[string]string{\"chapter_number\": \"1\", \"juz_number\": \"1\", \"page_number\": \"1\"}\n  data, err := callApi(params)\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get Imlaei Simple text of ayah\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(params = {})\n  path = \"/quran/verses/imlaei\"\n  uri = URI(API_BASE_URL + path)\n  uri.query = URI.encode_www_form(params) if params && !params.empty?\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\nparams = { \"chapter_number\" => \"1\", \"juz_number\" => \"1\", \"page_number\" => \"1\" }\ndata = call_api(params)\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get Imlaei Simple text of ayah\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(Dictionary<string, string> query = null)\n{\n    var path = $@\"/quran/verses/imlaei\";\n    var url = API_BASE_URL + path;\n    if (query != null && query.Count > 0)\n    {\n        var queryString = string.Join(\"&\", query.Select(kvp =>\n            $\"{Uri.EscapeDataString(kvp.Key)}={Uri.EscapeDataString(kvp.Value)}\"));\n        url = $\"{url}?{queryString}\";\n    }\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar query = new Dictionary<string, string> { {\"chapter_number\", \"1\"}, {\"juz_number\", \"1\"}, {\"page_number\", \"1\"} };\nvar data = await CallApiAsync(query);\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get Imlaei Simple text of ayah\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($params = []) {\n  $path = \"/quran/verses/imlaei\";\n  $url = API_BASE_URL . $path;\n  if (!empty($params)) {\n    $url .= '?' . http_build_query($params);\n  }\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$params = ['chapter_number' => '1', 'juz_number' => '1', 'page_number' => '1'];\n$data = callApi($params);\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get Imlaei Simple text of ayah\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(Map<String, String> params) throws IOException {\n    String path = \"/quran/verses/imlaei\";\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    if (params != null) {\n      for (Map.Entry<String, String> entry : params.entrySet()) {\n        urlBuilder.addQueryParameter(entry.getKey(), entry.getValue());\n      }\n    }\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    Map<String, String> params = new HashMap<>();\n    params.put(\"chapter_number\", \"1\");\n    params.put(\"juz_number\", \"1\");\n    params.put(\"page_number\", \"1\");\n    String data = callApi(params);\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get Imlaei Simple text of ayah\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([hashtable]$params = @{}) {\n  $path = \"/quran/verses/imlaei\"\n  $url = \"$API_BASE_URL$path\"\n  if ($params.Count -gt 0) {\n    $query = ($params.GetEnumerator() | ForEach-Object {\n      \"$($_.Key)=$([System.Uri]::EscapeDataString([string]$_.Value))\"\n    }) -join \"&\"\n    $url = \"$url?$query\"\n  }\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$params = @{ chapter_number = \"1\"; juz_number = \"1\"; page_number = \"1\" }\n$data = Call-Api($params)\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get Imlaei Simple text of ayah\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/quran/verses/imlaei?chapter_number=1&juz_number=1&page_number=1' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get imlaei simple text of ayah using the Quran Foundation API.\n\nEndpoint: GET /quran/verses/imlaei\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nOptional Query Parameters:\n  chapter_number: If you want to get text of a specific surah.\n  juz_number: If you want to get text of a specific juz.\n  page_number: If you want to get text of a Madani Mushaf page\n  hizb_number: If you want to get text of a specific hizb.\n  rub_el_hizb_number: If you want to get text of a specific Rub el Hizb.\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/quran/verses/imlaei?{queryParams}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/resources/recitations": {
      "get": {
        "tags": ["Audio"],
        "summary": "Recitations",
        "description": "Get list of available ayah-by-ayah recitations. Use these IDs with `/quran/recitations/{recitation_id}`, `/resources/recitations/{recitation_id}/info`, `/recitations/{recitation_id}/...`, and the `audio` query parameter on verse endpoints. These IDs are not interchangeable with chapter-reciter IDs from `/resources/chapter_reciters`.",
        "operationId": "recitations",
        "parameters": [
          {
            "name": "language",
            "in": "query",
            "description": "Name of reciters in specific language. Will fallback to English if we don't have names in specific language.",
            "schema": {
              "type": "string",
              "default": "en"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["recitations"],
                  "properties": {
                    "recitations": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/recitation"
                      }
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "recitations": [
                        {
                          "id": 1,
                          "reciter_name": "AbdulBaset AbdulSamad",
                          "style": "Mujawwad",
                          "translated_name": {
                            "name": "AbdulBaset AbdulSamad",
                            "language_name": "english"
                          }
                        }
                      ]
                    }
                  },
                  "murattal_and_mujawwad_reciters": {
                    "summary": "Recitation resources with different styles",
                    "value": {
                      "recitations": [
                        {
                          "id": 1,
                          "reciter_name": "AbdulBaset AbdulSamad",
                          "style": "Mujawwad",
                          "translated_name": {
                            "name": "AbdulBaset AbdulSamad",
                            "language_name": "english"
                          }
                        },
                        {
                          "id": 7,
                          "reciter_name": "Mishari Rashid al-Afasy",
                          "style": "Murattal",
                          "translated_name": {
                            "name": "Mishari Rashid al-Afasy",
                            "language_name": "english"
                          }
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Recitations\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(options = {}) {\n  const response = await axios.get(\n    `${API_BASE_URL}/resources/recitations`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      },\n      params: options\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi({\"language\":\"en\"})\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Recitations\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(language=None):\n    params = {k: v for k, v in {'language': language}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/resources/recitations',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(language=\"en\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Recitations\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(params map[string]string) (string, error) {\n  path := \"/resources/recitations\"\n  endpoint := API_BASE_URL + path\n  if params != nil && len(params) > 0 {\n    values := url.Values{}\n    for k, v := range params {\n      values.Set(k, v)\n    }\n    endpoint = endpoint + \"?\" + values.Encode()\n  }\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  params := map[string]string{\"language\": \"en\"}\n  data, err := callApi(params)\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Recitations\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(params = {})\n  path = \"/resources/recitations\"\n  uri = URI(API_BASE_URL + path)\n  uri.query = URI.encode_www_form(params) if params && !params.empty?\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\nparams = { \"language\" => \"en\" }\ndata = call_api(params)\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Recitations\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(Dictionary<string, string> query = null)\n{\n    var path = $@\"/resources/recitations\";\n    var url = API_BASE_URL + path;\n    if (query != null && query.Count > 0)\n    {\n        var queryString = string.Join(\"&\", query.Select(kvp =>\n            $\"{Uri.EscapeDataString(kvp.Key)}={Uri.EscapeDataString(kvp.Value)}\"));\n        url = $\"{url}?{queryString}\";\n    }\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar query = new Dictionary<string, string> { {\"language\", \"en\"} };\nvar data = await CallApiAsync(query);\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Recitations\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($params = []) {\n  $path = \"/resources/recitations\";\n  $url = API_BASE_URL . $path;\n  if (!empty($params)) {\n    $url .= '?' . http_build_query($params);\n  }\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$params = ['language' => 'en'];\n$data = callApi($params);\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Recitations\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(Map<String, String> params) throws IOException {\n    String path = \"/resources/recitations\";\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    if (params != null) {\n      for (Map.Entry<String, String> entry : params.entrySet()) {\n        urlBuilder.addQueryParameter(entry.getKey(), entry.getValue());\n      }\n    }\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    Map<String, String> params = new HashMap<>();\n    params.put(\"language\", \"en\");\n    String data = callApi(params);\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Recitations\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([hashtable]$params = @{}) {\n  $path = \"/resources/recitations\"\n  $url = \"$API_BASE_URL$path\"\n  if ($params.Count -gt 0) {\n    $query = ($params.GetEnumerator() | ForEach-Object {\n      \"$($_.Key)=$([System.Uri]::EscapeDataString([string]$_.Value))\"\n    }) -join \"&\"\n    $url = \"$url?$query\"\n  }\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$params = @{ language = \"en\" }\n$data = Call-Api($params)\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Recitations\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/resources/recitations?language=en' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to recitations using the Quran Foundation API.\n\nEndpoint: GET /resources/recitations\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nOptional Query Parameters:\n  language: Name of reciters in specific language. Will fallback to English if we don't have names in specific language.\n\nNotes:\n  This endpoint returns ayah-by-ayah recitation IDs.\n  Use these IDs with `/quran/recitations/{recitation_id}`, `/resources/recitations/{recitation_id}/info`, `/recitations/{recitation_id}/...`, and verse `audio` query parameters.\n  These IDs are not interchangeable with chapter-reciter IDs from `/resources/chapter_reciters`.\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/resources/recitations?{queryParams}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/quran/recitations/{recitation_id}": {
      "get": {
        "tags": ["Audio"],
        "summary": "Get list of Audio files of single recitation",
        "description": "Get list of AudioFile for a single ayah-by-ayah recitation. Use a `recitation_id` from [/resources/recitations](/docs/content_apis_versioned/recitations). Do not use chapter-reciter IDs from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters) here.\n\nYou can also include more fields of audio files using `fields` query string.",
        "operationId": "recitation-audio-files",
        "parameters": [
          {
            "name": "recitation_id",
            "in": "path",
            "description": "Ayah-by-ayah recitation ID from [/resources/recitations](/docs/content_apis_versioned/recitations). Do not use chapter-reciter IDs from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters) here.",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "comma separated field of audio files.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "chapter_number",
            "in": "query",
            "description": "If you want to get audio file of a specific surah.",
            "schema": {
              "maximum": 114,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "juz_number",
            "in": "query",
            "description": "If you want to get audio file of a specific juz.",
            "schema": {
              "maximum": 30,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "page_number",
            "in": "query",
            "description": "If you want to get audio file of a Madani Mushaf page",
            "schema": {
              "maximum": 604,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "hizb_number",
            "in": "query",
            "description": "If you want to get audio file of a specific hizb.",
            "schema": {
              "maximum": 60,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "rub_el_hizb_number",
            "in": "query",
            "description": "If you want to get audio file of a specific Rub el Hizb.",
            "schema": {
              "maximum": 240,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "manzil_number",
            "in": "query",
            "description": "If you want to get audio file of a specific manzil.",
            "schema": {
              "maximum": 7,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "ruku_number",
            "in": "query",
            "description": "If you want to get audio file of a specific ruku.",
            "schema": {
              "maximum": 558,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "verse_key",
            "in": "query",
            "description": "If you want to get audio file of a specific ayah.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "required": ["audio_files"],
                  "type": "object",
                  "properties": {
                    "audio_files": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/audiofile"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "reciter_name": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "audio_files": [
                        {
                          "verse_key": "1:1",
                          "url": "Alafasy/mp3/001001.mp3"
                        },
                        {
                          "verse_key": "1:2",
                          "url": "Alafasy/mp3/001002.mp3"
                        },
                        {
                          "verse_key": "1:3",
                          "url": "Alafasy/mp3/001003.mp3"
                        },
                        {
                          "verse_key": "1:4",
                          "url": "Alafasy/mp3/001004.mp3"
                        },
                        {
                          "verse_key": "1:5",
                          "url": "Alafasy/mp3/001005.mp3"
                        },
                        {
                          "verse_key": "1:6",
                          "url": "Alafasy/mp3/001006.mp3"
                        },
                        {
                          "verse_key": "1:7",
                          "url": "Alafasy/mp3/001007.mp3"
                        }
                      ],
                      "meta": {
                        "reciter_name": "Mishari Rashid al-`Afasy",
                        "recitation_style": null
                      }
                    }
                  },
                  "chapter_audio_files": {
                    "summary": "Ayah-by-ayah audio files for a chapter",
                    "value": {
                      "audio_files": [
                        {
                          "verse_key": "1:1",
                          "url": "Alafasy/mp3/001001.mp3"
                        },
                        {
                          "verse_key": "1:2",
                          "url": "Alafasy/mp3/001002.mp3"
                        }
                      ],
                      "meta": {
                        "reciter_name": "Mishari Rashid al-Afasy",
                        "recitation_style": null,
                        "filters": {
                          "chapter_number": 1
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get list of Audio files of single recitation\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(recitation_id, options = {}) {\n  const response = await axios.get(\n    `${API_BASE_URL}/quran/recitations/${recitation_id}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      },\n      params: options\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(1, {\"fields\":\"value\",\"chapter_number\":\"1\",\"juz_number\":\"1\"})\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get list of Audio files of single recitation\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(recitation_id, fields=None, chapter_number=None, juz_number=None):\n    params = {k: v for k, v in {'fields': fields, 'chapter_number': chapter_number, 'juz_number': juz_number}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/quran/recitations/{recitation_id}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(1, fields=\"value\", chapter_number=\"1\", juz_number=\"1\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get list of Audio files of single recitation\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(recitation_id string, params map[string]string) (string, error) {\n  path := fmt.Sprintf(\"/quran/recitations/%s\", recitation_id)\n  endpoint := API_BASE_URL + path\n  if params != nil && len(params) > 0 {\n    values := url.Values{}\n    for k, v := range params {\n      values.Set(k, v)\n    }\n    endpoint = endpoint + \"?\" + values.Encode()\n  }\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  params := map[string]string{\"fields\": \"value\", \"chapter_number\": \"1\", \"juz_number\": \"1\"}\n  data, err := callApi(1, params)\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get list of Audio files of single recitation\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(recitation_id, params = {})\n  path = \"/quran/recitations/#{recitation_id}\"\n  uri = URI(API_BASE_URL + path)\n  uri.query = URI.encode_www_form(params) if params && !params.empty?\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\nparams = { \"fields\" => \"value\", \"chapter_number\" => \"1\", \"juz_number\" => \"1\" }\ndata = call_api(1, params)\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get list of Audio files of single recitation\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string recitation_id, Dictionary<string, string> query = null)\n{\n    var path = $@\"/quran/recitations/{recitation_id}\";\n    var url = API_BASE_URL + path;\n    if (query != null && query.Count > 0)\n    {\n        var queryString = string.Join(\"&\", query.Select(kvp =>\n            $\"{Uri.EscapeDataString(kvp.Key)}={Uri.EscapeDataString(kvp.Value)}\"));\n        url = $\"{url}?{queryString}\";\n    }\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar query = new Dictionary<string, string> { {\"fields\", \"value\"}, {\"chapter_number\", \"1\"}, {\"juz_number\", \"1\"} };\nvar data = await CallApiAsync(1, query);\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get list of Audio files of single recitation\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($recitation_id, $params = []) {\n  $path = sprintf(\"/quran/recitations/%s\", $recitation_id);\n  $url = API_BASE_URL . $path;\n  if (!empty($params)) {\n    $url .= '?' . http_build_query($params);\n  }\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$params = ['fields' => 'value', 'chapter_number' => '1', 'juz_number' => '1'];\n$data = callApi(1, $params);\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get list of Audio files of single recitation\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String recitation_id, Map<String, String> params) throws IOException {\n    String path = String.format(\"/quran/recitations/%s\", recitation_id);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    if (params != null) {\n      for (Map.Entry<String, String> entry : params.entrySet()) {\n        urlBuilder.addQueryParameter(entry.getKey(), entry.getValue());\n      }\n    }\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    Map<String, String> params = new HashMap<>();\n    params.put(\"fields\", \"value\");\n    params.put(\"chapter_number\", \"1\");\n    params.put(\"juz_number\", \"1\");\n    String data = callApi(1, params);\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get list of Audio files of single recitation\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$recitation_id, [hashtable]$params = @{}) {\n  $path = \"/quran/recitations/$recitation_id\"\n  $url = \"$API_BASE_URL$path\"\n  if ($params.Count -gt 0) {\n    $query = ($params.GetEnumerator() | ForEach-Object {\n      \"$($_.Key)=$([System.Uri]::EscapeDataString([string]$_.Value))\"\n    }) -join \"&\"\n    $url = \"$url?$query\"\n  }\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$params = @{ fields = \"value\"; chapter_number = \"1\"; juz_number = \"1\" }\n$data = Call-Api(1, $params)\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get list of Audio files of single recitation\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/quran/recitations/1?fields=value&chapter_number=1&juz_number=1' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get list of audio files of single recitation using the Quran Foundation API.\n\nEndpoint: GET /quran/recitations/{recitation_id}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  recitation_id: Ayah-by-ayah recitation ID from [/resources/recitations](/docs/content_apis_versioned/recitations). Do not use chapter-reciter IDs from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters) here. (e.g., \"1\")\nOptional Query Parameters:\n  fields: comma separated field of audio files.\n  chapter_number: If you want to get audio file of a specific surah.\n  juz_number: If you want to get audio file of a specific juz.\n  page_number: If you want to get audio file of a Madani Mushaf page\n  hizb_number: If you want to get audio file of a specific hizb.\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/quran/recitations/{recitation_id}?{queryParams}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts recitation_id and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/quran/translations/{translation_id}": {
      "get": {
        "tags": ["Quran"],
        "summary": "Get a single translation",
        "description": "Get a single Translation of all ayah.\n\nSee [/resources/translations](/docs/content_apis_versioned/translations) endpoint to fetch available translations.\n\nYou can also include more fields of translation using `fields` query string.",
        "operationId": "translation",
        "parameters": [
          {
            "name": "translation_id",
            "in": "path",
            "description": "Translation resource ID. Use `/resources/translations` to discover available translations.",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated list of extra translation fields to include. Supported values: chapter_id, verse_number, verse_key, juz_number, hizb_number, rub_el_hizb_number, page_number, ruku_number, manzil_number, resource_name, language_name, language_id, id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "foot_notes",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "If true, includes a `foot_notes` map inside each translation item keyed by footnote IDs from `<sup>` tags."
          },
          {
            "name": "chapter_number",
            "in": "query",
            "description": "If you want to get translation of a specific surah.",
            "schema": {
              "maximum": 114,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "juz_number",
            "in": "query",
            "description": "If you want to get translation of a specific juz.",
            "schema": {
              "maximum": 30,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "page_number",
            "in": "query",
            "description": "If you want to get translation of a Madani Mushaf page",
            "schema": {
              "maximum": 604,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "hizb_number",
            "in": "query",
            "description": "If you want to get translation of a specific hizb.",
            "schema": {
              "maximum": 60,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "rub_el_hizb_number",
            "in": "query",
            "description": "If you want to get translation of a specific Rub el Hizb.",
            "schema": {
              "maximum": 240,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "manzil_number",
            "in": "query",
            "description": "If you want to get translation of a specific manzil.",
            "schema": {
              "maximum": 7,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "ruku_number",
            "in": "query",
            "description": "If you want to get translation of a specific ruku.",
            "schema": {
              "maximum": 558,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "verse_key",
            "in": "query",
            "description": "If you want to get translation of a specific ayah.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "required": ["translations", "meta"],
                  "type": "object",
                  "properties": {
                    "translations": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/translation"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/QuranTranslationMeta"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "translations": [
                        {
                          "resource_id": 131,
                          "resource_name": "Dr. Mustafa Khattab, the Clear Quran",
                          "id": 903958,
                          "text": "In the Name of Allah - the Most Compassionate, Most Merciful.",
                          "verse_id": 1,
                          "language_id": 38,
                          "language_name": "english",
                          "verse_key": "1:1",
                          "chapter_id": 1,
                          "verse_number": 1,
                          "juz_number": 1,
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "page_number": 1,
                          "ruku_number": 1,
                          "manzil_number": 1,
                          "foot_notes": {
                            "1": "Some editions note variant readings here."
                          }
                        }
                      ],
                      "meta": {
                        "translation_name": "Dr. Mustafa Khattab, the Clear Quran",
                        "author_name": "Dr. Mustafa Khattab",
                        "filters": {
                          "chapter_number": 1
                        }
                      }
                    }
                  },
                  "chapter_filter_with_footnotes": {
                    "summary": "Translation chapter filter with footnotes",
                    "value": {
                      "translations": [
                        {
                          "resource_id": 131,
                          "resource_name": "Dr. Mustafa Khattab, the Clear Quran",
                          "id": 903958,
                          "text": "In the Name of Allah?the Most Compassionate, Most Merciful.",
                          "verse_id": 1,
                          "language_id": 38,
                          "language_name": "english",
                          "verse_key": "1:1",
                          "chapter_id": 1,
                          "verse_number": 1,
                          "juz_number": 1,
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "page_number": 1,
                          "ruku_number": 1,
                          "manzil_number": 1,
                          "foot_notes": {
                            "1": "Some editions include a translator footnote here."
                          }
                        }
                      ],
                      "meta": {
                        "translation_name": "Dr. Mustafa Khattab, the Clear Quran",
                        "author_name": "Dr. Mustafa Khattab",
                        "filters": {
                          "chapter_number": 1,
                          "foot_notes": true
                        }
                      }
                    }
                  },
                  "verse_key_without_footnotes": {
                    "summary": "Single ayah translation without footnotes",
                    "value": {
                      "translations": [
                        {
                          "resource_id": 131,
                          "resource_name": "Dr. Mustafa Khattab, the Clear Quran",
                          "id": 904212,
                          "text": "Allah! There is no god except Him, the Ever-Living, All-Sustaining.",
                          "verse_id": 255,
                          "language_id": 38,
                          "language_name": "english",
                          "verse_key": "2:255",
                          "chapter_id": 2,
                          "verse_number": 255,
                          "juz_number": 3,
                          "hizb_number": 5,
                          "rub_el_hizb_number": 19,
                          "page_number": 42,
                          "ruku_number": 35,
                          "manzil_number": 1
                        }
                      ],
                      "meta": {
                        "translation_name": "Dr. Mustafa Khattab, the Clear Quran",
                        "author_name": "Dr. Mustafa Khattab",
                        "filters": {
                          "verse_key": "2:255"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get a single translation\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(translation_id, options = {}) {\n  const response = await axios.get(\n    `${API_BASE_URL}/quran/translations/${translation_id}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      },\n      params: options\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(\"131\", {\"fields\":\"value\",\"foot_notes\":\"true\",\"chapter_number\":\"1\"})\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get a single translation\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(translation_id, fields=None, foot_notes=None, chapter_number=None):\n    params = {k: v for k, v in {'fields': fields, 'foot_notes': foot_notes, 'chapter_number': chapter_number}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/quran/translations/{translation_id}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(\"131\", fields=\"value\", foot_notes=\"true\", chapter_number=\"1\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get a single translation\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(translation_id string, params map[string]string) (string, error) {\n  path := fmt.Sprintf(\"/quran/translations/%s\", translation_id)\n  endpoint := API_BASE_URL + path\n  if params != nil && len(params) > 0 {\n    values := url.Values{}\n    for k, v := range params {\n      values.Set(k, v)\n    }\n    endpoint = endpoint + \"?\" + values.Encode()\n  }\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  params := map[string]string{\"fields\": \"value\", \"foot_notes\": \"true\", \"chapter_number\": \"1\"}\n  data, err := callApi(\"131\", params)\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get a single translation\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(translation_id, params = {})\n  path = \"/quran/translations/#{translation_id}\"\n  uri = URI(API_BASE_URL + path)\n  uri.query = URI.encode_www_form(params) if params && !params.empty?\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\nparams = { \"fields\" => \"value\", \"foot_notes\" => \"true\", \"chapter_number\" => \"1\" }\ndata = call_api(\"131\", params)\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get a single translation\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string translation_id, Dictionary<string, string> query = null)\n{\n    var path = $@\"/quran/translations/{translation_id}\";\n    var url = API_BASE_URL + path;\n    if (query != null && query.Count > 0)\n    {\n        var queryString = string.Join(\"&\", query.Select(kvp =>\n            $\"{Uri.EscapeDataString(kvp.Key)}={Uri.EscapeDataString(kvp.Value)}\"));\n        url = $\"{url}?{queryString}\";\n    }\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar query = new Dictionary<string, string> { {\"fields\", \"value\"}, {\"foot_notes\", \"true\"}, {\"chapter_number\", \"1\"} };\nvar data = await CallApiAsync(\"131\", query);\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get a single translation\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($translation_id, $params = []) {\n  $path = sprintf(\"/quran/translations/%s\", $translation_id);\n  $url = API_BASE_URL . $path;\n  if (!empty($params)) {\n    $url .= '?' . http_build_query($params);\n  }\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$params = ['fields' => 'value', 'foot_notes' => 'true', 'chapter_number' => '1'];\n$data = callApi(\"131\", $params);\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get a single translation\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String translation_id, Map<String, String> params) throws IOException {\n    String path = String.format(\"/quran/translations/%s\", translation_id);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    if (params != null) {\n      for (Map.Entry<String, String> entry : params.entrySet()) {\n        urlBuilder.addQueryParameter(entry.getKey(), entry.getValue());\n      }\n    }\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    Map<String, String> params = new HashMap<>();\n    params.put(\"fields\", \"value\");\n    params.put(\"foot_notes\", \"true\");\n    params.put(\"chapter_number\", \"1\");\n    String data = callApi(\"131\", params);\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get a single translation\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$translation_id, [hashtable]$params = @{}) {\n  $path = \"/quran/translations/$translation_id\"\n  $url = \"$API_BASE_URL$path\"\n  if ($params.Count -gt 0) {\n    $query = ($params.GetEnumerator() | ForEach-Object {\n      \"$($_.Key)=$([System.Uri]::EscapeDataString([string]$_.Value))\"\n    }) -join \"&\"\n    $url = \"$url?$query\"\n  }\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$params = @{ fields = \"value\"; foot_notes = \"true\"; chapter_number = \"1\" }\n$data = Call-Api(\"131\", $params)\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get a single translation\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/quran/translations/131?fields=value&foot_notes=true&chapter_number=1' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get a single translation using the Quran Foundation API.\n\nEndpoint: GET /quran/translations/{translation_id}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  translation_id: Translation resource ID. Use `/resources/translations` to discover available translations. (e.g., \"131\")\nOptional Query Parameters:\n  fields: comma separated fields of translation.\n  foot_notes: If true, includes a foot_notes map keyed by footnote IDs (from &lt;sup&gt; tags) to their text.\n  chapter_number: If you want to get translation of a specific surah.\n  juz_number: If you want to get translation of a specific juz.\n  page_number: If you want to get translation of a Madani Mushaf page\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/quran/translations/{translation_id}?{queryParams}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts translation_id and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/resources/chapter_reciters": {
      "get": {
        "tags": ["Audio"],
        "summary": "List of Chapter Reciters",
        "description": "Get list of available chapter reciters. Use these IDs with `/chapter_recitations/{reciter_id}`, `/chapter_recitations/{reciter_id}/{chapter_number}`, `/audio/reciters/{reciter_id}/timestamp`, and `/audio/reciters/{reciter_id}/lookup`. These IDs are not interchangeable with ayah-by-ayah recitation IDs from `/resources/recitations`.",
        "operationId": "chapter-reciters",
        "parameters": [
          {
            "name": "language",
            "in": "query",
            "description": "Name of reciters in specific language. Will fallback to English if we don't have names in specific language.",
            "schema": {
              "type": "string",
              "default": "en"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["reciters"],
                  "properties": {
                    "reciters": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/chapter-reciters"
                      }
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "reciters": [
                        {
                          "id": 3,
                          "name": "Abu Bakr al-Shatri",
                          "style": {
                            "name": "Murattal",
                            "language_name": "english"
                          },
                          "qirat": {
                            "name": "Hafs",
                            "language_name": "english"
                          },
                          "translated_name": {
                            "name": "Abu Bakr al-Shatri",
                            "language_name": "english"
                          }
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// List of Chapter Reciters\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(options = {}) {\n  const response = await axios.get(\n    `${API_BASE_URL}/resources/chapter_reciters`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      },\n      params: options\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi({\"language\":\"en\"})\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# List of Chapter Reciters\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(language=None):\n    params = {k: v for k, v in {'language': language}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/resources/chapter_reciters',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(language=\"en\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// List of Chapter Reciters\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(params map[string]string) (string, error) {\n  path := \"/resources/chapter_reciters\"\n  endpoint := API_BASE_URL + path\n  if params != nil && len(params) > 0 {\n    values := url.Values{}\n    for k, v := range params {\n      values.Set(k, v)\n    }\n    endpoint = endpoint + \"?\" + values.Encode()\n  }\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  params := map[string]string{\"language\": \"en\"}\n  data, err := callApi(params)\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# List of Chapter Reciters\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(params = {})\n  path = \"/resources/chapter_reciters\"\n  uri = URI(API_BASE_URL + path)\n  uri.query = URI.encode_www_form(params) if params && !params.empty?\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\nparams = { \"language\" => \"en\" }\ndata = call_api(params)\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// List of Chapter Reciters\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(Dictionary<string, string> query = null)\n{\n    var path = $@\"/resources/chapter_reciters\";\n    var url = API_BASE_URL + path;\n    if (query != null && query.Count > 0)\n    {\n        var queryString = string.Join(\"&\", query.Select(kvp =>\n            $\"{Uri.EscapeDataString(kvp.Key)}={Uri.EscapeDataString(kvp.Value)}\"));\n        url = $\"{url}?{queryString}\";\n    }\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar query = new Dictionary<string, string> { {\"language\", \"en\"} };\nvar data = await CallApiAsync(query);\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# List of Chapter Reciters\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($params = []) {\n  $path = \"/resources/chapter_reciters\";\n  $url = API_BASE_URL . $path;\n  if (!empty($params)) {\n    $url .= '?' . http_build_query($params);\n  }\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$params = ['language' => 'en'];\n$data = callApi($params);\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// List of Chapter Reciters\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(Map<String, String> params) throws IOException {\n    String path = \"/resources/chapter_reciters\";\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    if (params != null) {\n      for (Map.Entry<String, String> entry : params.entrySet()) {\n        urlBuilder.addQueryParameter(entry.getKey(), entry.getValue());\n      }\n    }\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    Map<String, String> params = new HashMap<>();\n    params.put(\"language\", \"en\");\n    String data = callApi(params);\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# List of Chapter Reciters\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([hashtable]$params = @{}) {\n  $path = \"/resources/chapter_reciters\"\n  $url = \"$API_BASE_URL$path\"\n  if ($params.Count -gt 0) {\n    $query = ($params.GetEnumerator() | ForEach-Object {\n      \"$($_.Key)=$([System.Uri]::EscapeDataString([string]$_.Value))\"\n    }) -join \"&\"\n    $url = \"$url?$query\"\n  }\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$params = @{ language = \"en\" }\n$data = Call-Api($params)\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# List of Chapter Reciters\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/resources/chapter_reciters?language=en' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to list of chapter reciters using the Quran Foundation API.\n\nEndpoint: GET /resources/chapter_reciters\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nOptional Query Parameters:\n  language: Name of reciters in specific language. Will fallback to English if we don't have names in specific language.\n\nNotes:\n  This endpoint returns chapter-reciter IDs.\n  Use these IDs with `/chapter_recitations/{reciter_id}`, `/chapter_recitations/{reciter_id}/{chapter_number}`, `/audio/reciters/{reciter_id}/timestamp`, and `/audio/reciters/{reciter_id}/lookup`.\n  These IDs are not interchangeable with ayah-by-ayah recitation IDs from `/resources/recitations`.\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/resources/chapter_reciters?{queryParams}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/quran/tafsirs/{tafsir_id}": {
      "get": {
        "tags": ["Quran"],
        "summary": "Get paginated tafsir records",
        "description": "Get a paginated list of ayah for the requested tafsir.\n\nSee [/resources/tafsirs](/docs/content_apis_versioned/tafsirs) endpoint to fetch available tafsirs.\n\nYou can also include more fields of tafsir using `fields` query string.",
        "operationId": "tafsir",
        "parameters": [
          {
            "name": "tafsir_id",
            "in": "path",
            "description": "tafsir id",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "comma separated fields of tafsir.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "chapter_number",
            "in": "query",
            "description": "If you want to get tafsir of a specific surah.",
            "schema": {
              "maximum": 114,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "juz_number",
            "in": "query",
            "description": "If you want to get tafsir of a specific juz.",
            "schema": {
              "maximum": 30,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "page_number",
            "in": "query",
            "description": "If you want to get tafsir of a Madani Mushaf page",
            "schema": {
              "maximum": 604,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "hizb_number",
            "in": "query",
            "description": "If you want to get tafsir of a specific hizb.",
            "schema": {
              "maximum": 60,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "rub_el_hizb_number",
            "in": "query",
            "description": "If you want to get tafsir of a specific Rub el Hizb.",
            "schema": {
              "maximum": 240,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "manzil_number",
            "in": "query",
            "description": "If you want to get tafsir of a specific manzil.",
            "schema": {
              "maximum": 7,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "ruku_number",
            "in": "query",
            "description": "If you want to get tafsir of a specific ruku.",
            "schema": {
              "maximum": 558,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "verse_key",
            "in": "query",
            "description": "If you want to get tafsir of a specific ayah.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "For paginating within the result.",
            "schema": {
              "type": "integer",
              "default": 1,
              "minimum": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "Records per API call. Defaults to 10 and is capped at 50. Use all to request all available records up to the maximum of 50.",
            "schema": {
              "oneOf": [
                {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 50
                },
                {
                  "type": "string",
                  "enum": ["all"]
                }
              ],
              "default": 10
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Alias for per_page. Defaults to 10 and is capped at 50. Use all to request all available records up to the maximum of 50.",
            "schema": {
              "oneOf": [
                {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 50
                },
                {
                  "type": "string",
                  "enum": ["all"]
                }
              ],
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "required": ["tafsirs", "pagination"],
                  "type": "object",
                  "properties": {
                    "tafsirs": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/tafsir"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "tafsir_name": {
                          "type": "string"
                        },
                        "author_name": {
                          "type": "string",
                          "nullable": true
                        }
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/pagination"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "tafsirs": [
                        {
                          "resource_id": 169,
                          "text": "<h2 class=\"title\">Which was revealed in Makkah</h2><h2 class=\"title\">The Meaning of Al-Fatihah and its Various Names</h2><p>This Surah is called</p><p>-        Al-Fatihah, that is, the Opener of the Book, the Surah with which prayers are begun."
                        }
                      ],
                      "meta": {
                        "tafsir_name": "Tafsir Ibn Kathir",
                        "author_name": "Hafiz Ibn Kathir"
                      },
                      "pagination": {
                        "per_page": 10,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 624,
                        "total_records": 6236
                      }
                    }
                  },
                  "chapter_filter": {
                    "summary": "Tafsir records for a chapter",
                    "value": {
                      "tafsirs": [
                        {
                          "id": 82641,
                          "resource_id": 169,
                          "verse_id": 1,
                          "language_id": 38,
                          "text": "<p>Bismillah is a verse of the Holy Qur'an.</p>",
                          "language_name": "english",
                          "resource_name": "Tafsir Ibn Kathir",
                          "verse_key": "1:1",
                          "chapter_id": 1,
                          "verse_number": 1,
                          "juz_number": 1,
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "page_number": 1,
                          "ruku_number": 1,
                          "manzil_number": 1,
                          "slug": "tafsir-ibn-kathir"
                        }
                      ],
                      "meta": {
                        "tafsir_name": "Tafsir Ibn Kathir",
                        "author_name": "Hafiz Ibn Kathir",
                        "filters": {
                          "chapter_number": 1
                        }
                      },
                      "pagination": {
                        "per_page": 10,
                        "current_page": 1,
                        "next_page": null,
                        "total_pages": 1,
                        "total_records": 7
                      }
                    }
                  },
                  "verse_key_filter": {
                    "summary": "Tafsir record for one ayah",
                    "value": {
                      "tafsirs": [
                        {
                          "id": 82641,
                          "resource_id": 169,
                          "verse_id": 255,
                          "language_id": 38,
                          "text": "<p>Bismillah is a verse of the Holy Qur'an.</p>",
                          "language_name": "english",
                          "resource_name": "Tafsir Ibn Kathir",
                          "verse_key": "2:255",
                          "chapter_id": 2,
                          "verse_number": 255,
                          "juz_number": 1,
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "page_number": 1,
                          "ruku_number": 1,
                          "manzil_number": 1,
                          "slug": "tafsir-ibn-kathir"
                        }
                      ],
                      "meta": {
                        "tafsir_name": "Tafsir Ibn Kathir",
                        "author_name": "Hafiz Ibn Kathir",
                        "filters": {
                          "verse_key": "2:255"
                        }
                      },
                      "pagination": {
                        "per_page": 10,
                        "current_page": 1,
                        "next_page": null,
                        "total_pages": 1,
                        "total_records": 1
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get paginated tafsir records\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(tafsir_id, options = {}) {\n  const response = await axios.get(\n    `${API_BASE_URL}/quran/tafsirs/${tafsir_id}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      },\n      params: options\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(\"169\", {\"fields\":\"value\",\"chapter_number\":\"1\",\"juz_number\":\"1\",\"page\":\"1\",\"per_page\":\"10\"})\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get paginated tafsir records\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(tafsir_id, fields=None, chapter_number=None, juz_number=None, page=1, per_page=10):\n    params = {k: v for k, v in {'fields': fields, 'chapter_number': chapter_number, 'juz_number': juz_number, 'page': page, 'per_page': per_page}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/quran/tafsirs/{tafsir_id}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(\"169\", fields=\"value\", chapter_number=\"1\", juz_number=\"1\", page=1, per_page=10)\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get paginated tafsir records\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(tafsir_id string, params map[string]string) (string, error) {\n  path := fmt.Sprintf(\"/quran/tafsirs/%s\", tafsir_id)\n  endpoint := API_BASE_URL + path\n  if params != nil && len(params) > 0 {\n    values := url.Values{}\n    for k, v := range params {\n      values.Set(k, v)\n    }\n    endpoint = endpoint + \"?\" + values.Encode()\n  }\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  params := map[string]string{\"fields\": \"value\", \"chapter_number\": \"1\", \"juz_number\": \"1\", \"page\": \"1\", \"per_page\": \"10\"}\n  data, err := callApi(\"169\", params)\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get paginated tafsir records\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(tafsir_id, params = {})\n  path = \"/quran/tafsirs/#{tafsir_id}\"\n  uri = URI(API_BASE_URL + path)\n  uri.query = URI.encode_www_form(params) if params && !params.empty?\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\nparams = { \"fields\" => \"value\", \"chapter_number\" => \"1\", \"juz_number\" => \"1\", \"page\" => \"1\", \"per_page\" => \"10\" }\ndata = call_api(\"169\", params)\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get paginated tafsir records\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string tafsir_id, Dictionary<string, string> query = null)\n{\n    var path = $@\"/quran/tafsirs/{tafsir_id}\";\n    var url = API_BASE_URL + path;\n    if (query != null && query.Count > 0)\n    {\n        var queryString = string.Join(\"&\", query.Select(kvp =>\n            $\"{Uri.EscapeDataString(kvp.Key)}={Uri.EscapeDataString(kvp.Value)}\"));\n        url = $\"{url}?{queryString}\";\n    }\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar query = new Dictionary<string, string> { {\"fields\", \"value\"}, {\"chapter_number\", \"1\"}, {\"juz_number\", \"1\"}, {\"page\", \"1\"}, {\"per_page\", \"10\"} };\nvar data = await CallApiAsync(\"169\", query);\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get paginated tafsir records\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($tafsir_id, $params = []) {\n  $path = sprintf(\"/quran/tafsirs/%s\", $tafsir_id);\n  $url = API_BASE_URL . $path;\n  if (!empty($params)) {\n    $url .= '?' . http_build_query($params);\n  }\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$params = ['fields' => 'value', 'chapter_number' => '1', 'juz_number' => '1', 'page' => '1', 'per_page' => '10'];\n$data = callApi(\"169\", $params);\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get paginated tafsir records\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String tafsir_id, Map<String, String> params) throws IOException {\n    String path = String.format(\"/quran/tafsirs/%s\", tafsir_id);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    if (params != null) {\n      for (Map.Entry<String, String> entry : params.entrySet()) {\n        urlBuilder.addQueryParameter(entry.getKey(), entry.getValue());\n      }\n    }\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    Map<String, String> params = new HashMap<>();\n    params.put(\"fields\", \"value\");\n    params.put(\"chapter_number\", \"1\");\n    params.put(\"juz_number\", \"1\");\n    params.put(\"page\", \"1\");\n    params.put(\"per_page\", \"10\");\n    String data = callApi(\"169\", params);\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get paginated tafsir records\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$tafsir_id, [hashtable]$params = @{}) {\n  $path = \"/quran/tafsirs/$tafsir_id\"\n  $url = \"$API_BASE_URL$path\"\n  if ($params.Count -gt 0) {\n    $query = ($params.GetEnumerator() | ForEach-Object {\n      \"$($_.Key)=$([System.Uri]::EscapeDataString([string]$_.Value))\"\n    }) -join \"&\"\n    $url = \"$url?$query\"\n  }\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$params = @{ fields = \"value\"; chapter_number = \"1\"; juz_number = \"1\"; page = \"1\"; per_page = \"10\" }\n$data = Call-Api(\"169\", $params)\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get paginated tafsir records\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/quran/tafsirs/169?fields=value&chapter_number=1&juz_number=1&page=1&per_page=10' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get paginated tafsir records using the Quran Foundation API.\n\nEndpoint: GET /quran/tafsirs/{tafsir_id}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  tafsir_id: tafsir id (e.g., \"169\")\nOptional Query Parameters:\n  fields: comma separated fields of tafsir.\n  chapter_number: If you want to get tafsir of a specific surah.\n  juz_number: If you want to get tafsir of a specific juz.\n  page_number: If you want to get tafsir of a Madani Mushaf page\n  hizb_number: If you want to get tafsir of a specific hizb.\n  page: Page number for paginating within the result (default: 1).\n  per_page: Records per API call (default: 10, maximum: 50, or all up to 50).\n  limit: Alias for per_page.\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/quran/tafsirs/{tafsir_id}?{queryParams}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts tafsir_id, optional filters, and pagination parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/quran/verses/code_v1": {
      "get": {
        "tags": ["Quran"],
        "summary": "Get V1 Glyph codes of ayah",
        "description": "Get glyph codes of ayah for QCF v1 font",
        "operationId": "QURAN-verses-code_v1",
        "parameters": [
          {
            "name": "chapter_number",
            "in": "query",
            "description": "If you want to get text of a specific surah.",
            "schema": {
              "maximum": 114,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "juz_number",
            "in": "query",
            "description": "If you want to get text of a specific juz.",
            "schema": {
              "maximum": 30,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "page_number",
            "in": "query",
            "description": "If you want to get text of a Madani Mushaf page",
            "schema": {
              "maximum": 604,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "hizb_number",
            "in": "query",
            "description": "If you want to get text of a specific hizb.",
            "schema": {
              "maximum": 60,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "rub_el_hizb_number",
            "in": "query",
            "description": "If you want to get text of a specific Rub el Hizb.",
            "schema": {
              "maximum": 240,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "manzil_number",
            "in": "query",
            "description": "If you want to get text of a specific manzil.",
            "schema": {
              "maximum": 7,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "ruku_number",
            "in": "query",
            "description": "If you want to get text of a specific ruku.",
            "schema": {
              "maximum": 558,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "verse_key",
            "in": "query",
            "description": "If you want to get text of a specific ayah.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["verses", "meta"],
                  "properties": {
                    "verses": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/QuranVerseText"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/QuranFiltersMeta"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "verses": [
                        {
                          "id": 1,
                          "verse_key": "1:1",
                          "v1_page": 1
                        }
                      ],
                      "meta": {
                        "filters": {
                          "chapter_number": 1
                        }
                      }
                    }
                  },
                  "qcf_v1_font_page": {
                    "summary": "QCF v1 glyphs for a font page",
                    "value": {
                      "verses": [
                        {
                          "id": 1,
                          "verse_key": "1:1",
                          "code_v1": "&#xfb51;",
                          "v1_page": 1
                        }
                      ],
                      "meta": {
                        "filters": {
                          "chapter_number": 1
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get V1 Glyph codes of ayah\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(options = {}) {\n  const response = await axios.get(\n    `${API_BASE_URL}/quran/verses/code_v1`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      },\n      params: options\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi({\"chapter_number\":\"1\",\"juz_number\":\"1\",\"page_number\":\"1\"})\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get V1 Glyph codes of ayah\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(chapter_number=None, juz_number=None, page_number=None):\n    params = {k: v for k, v in {'chapter_number': chapter_number, 'juz_number': juz_number, 'page_number': page_number}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/quran/verses/code_v1',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(chapter_number=\"1\", juz_number=\"1\", page_number=\"1\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get V1 Glyph codes of ayah\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(params map[string]string) (string, error) {\n  path := \"/quran/verses/code_v1\"\n  endpoint := API_BASE_URL + path\n  if params != nil && len(params) > 0 {\n    values := url.Values{}\n    for k, v := range params {\n      values.Set(k, v)\n    }\n    endpoint = endpoint + \"?\" + values.Encode()\n  }\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  params := map[string]string{\"chapter_number\": \"1\", \"juz_number\": \"1\", \"page_number\": \"1\"}\n  data, err := callApi(params)\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get V1 Glyph codes of ayah\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(params = {})\n  path = \"/quran/verses/code_v1\"\n  uri = URI(API_BASE_URL + path)\n  uri.query = URI.encode_www_form(params) if params && !params.empty?\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\nparams = { \"chapter_number\" => \"1\", \"juz_number\" => \"1\", \"page_number\" => \"1\" }\ndata = call_api(params)\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get V1 Glyph codes of ayah\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(Dictionary<string, string> query = null)\n{\n    var path = $@\"/quran/verses/code_v1\";\n    var url = API_BASE_URL + path;\n    if (query != null && query.Count > 0)\n    {\n        var queryString = string.Join(\"&\", query.Select(kvp =>\n            $\"{Uri.EscapeDataString(kvp.Key)}={Uri.EscapeDataString(kvp.Value)}\"));\n        url = $\"{url}?{queryString}\";\n    }\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar query = new Dictionary<string, string> { {\"chapter_number\", \"1\"}, {\"juz_number\", \"1\"}, {\"page_number\", \"1\"} };\nvar data = await CallApiAsync(query);\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get V1 Glyph codes of ayah\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($params = []) {\n  $path = \"/quran/verses/code_v1\";\n  $url = API_BASE_URL . $path;\n  if (!empty($params)) {\n    $url .= '?' . http_build_query($params);\n  }\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$params = ['chapter_number' => '1', 'juz_number' => '1', 'page_number' => '1'];\n$data = callApi($params);\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get V1 Glyph codes of ayah\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(Map<String, String> params) throws IOException {\n    String path = \"/quran/verses/code_v1\";\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    if (params != null) {\n      for (Map.Entry<String, String> entry : params.entrySet()) {\n        urlBuilder.addQueryParameter(entry.getKey(), entry.getValue());\n      }\n    }\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    Map<String, String> params = new HashMap<>();\n    params.put(\"chapter_number\", \"1\");\n    params.put(\"juz_number\", \"1\");\n    params.put(\"page_number\", \"1\");\n    String data = callApi(params);\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get V1 Glyph codes of ayah\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([hashtable]$params = @{}) {\n  $path = \"/quran/verses/code_v1\"\n  $url = \"$API_BASE_URL$path\"\n  if ($params.Count -gt 0) {\n    $query = ($params.GetEnumerator() | ForEach-Object {\n      \"$($_.Key)=$([System.Uri]::EscapeDataString([string]$_.Value))\"\n    }) -join \"&\"\n    $url = \"$url?$query\"\n  }\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$params = @{ chapter_number = \"1\"; juz_number = \"1\"; page_number = \"1\" }\n$data = Call-Api($params)\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get V1 Glyph codes of ayah\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/quran/verses/code_v1?chapter_number=1&juz_number=1&page_number=1' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get v1 glyph codes of ayah using the Quran Foundation API.\n\nEndpoint: GET /quran/verses/code_v1\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nOptional Query Parameters:\n  chapter_number: If you want to get text of a specific surah.\n  juz_number: If you want to get text of a specific juz.\n  page_number: If you want to get text of a Madani Mushaf page\n  hizb_number: If you want to get text of a specific hizb.\n  rub_el_hizb_number: If you want to get text of a specific Rub el Hizb.\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/quran/verses/code_v1?{queryParams}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/quran/verses/code_v2": {
      "get": {
        "tags": ["Quran"],
        "summary": "Get V2 Glyph codes of ayah",
        "description": "Get glyph codes of ayah for QCF v2 font",
        "operationId": "QURAN-verses-code_v2",
        "parameters": [
          {
            "name": "chapter_number",
            "in": "query",
            "description": "If you want to get text of a specific surah.",
            "schema": {
              "maximum": 114,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "juz_number",
            "in": "query",
            "description": "If you want to get text of a specific juz.",
            "schema": {
              "maximum": 30,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "page_number",
            "in": "query",
            "description": "If you want to get text of a Madani Mushaf page",
            "schema": {
              "maximum": 604,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "hizb_number",
            "in": "query",
            "description": "If you want to get text of a specific hizb.",
            "schema": {
              "maximum": 60,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "rub_el_hizb_number",
            "in": "query",
            "description": "If you want to get text of a specific Rub el Hizb.",
            "schema": {
              "maximum": 240,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "manzil_number",
            "in": "query",
            "description": "If you want to get text of a specific manzil.",
            "schema": {
              "maximum": 7,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "ruku_number",
            "in": "query",
            "description": "If you want to get text of a specific ruku.",
            "schema": {
              "maximum": 558,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "verse_key",
            "in": "query",
            "description": "If you want to get text of a specific ayah.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["verses", "meta"],
                  "properties": {
                    "verses": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/QuranVerseText"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/QuranFiltersMeta"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "verses": [
                        {
                          "id": 1,
                          "verse_key": "1:1",
                          "v2_page": 1
                        }
                      ],
                      "meta": {
                        "filters": {
                          "chapter_number": 1
                        }
                      }
                    }
                  },
                  "qcf_v2_font_page": {
                    "summary": "QCF v2 glyphs for a font page",
                    "value": {
                      "verses": [
                        {
                          "id": 1,
                          "verse_key": "1:1",
                          "code_v2": "&#xE001;",
                          "v2_page": 1
                        }
                      ],
                      "meta": {
                        "filters": {
                          "chapter_number": 1
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get V2 Glyph codes of ayah\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(options = {}) {\n  const response = await axios.get(\n    `${API_BASE_URL}/quran/verses/code_v2`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      },\n      params: options\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi({\"chapter_number\":\"1\",\"juz_number\":\"1\",\"page_number\":\"1\"})\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get V2 Glyph codes of ayah\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(chapter_number=None, juz_number=None, page_number=None):\n    params = {k: v for k, v in {'chapter_number': chapter_number, 'juz_number': juz_number, 'page_number': page_number}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/quran/verses/code_v2',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(chapter_number=\"1\", juz_number=\"1\", page_number=\"1\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get V2 Glyph codes of ayah\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(params map[string]string) (string, error) {\n  path := \"/quran/verses/code_v2\"\n  endpoint := API_BASE_URL + path\n  if params != nil && len(params) > 0 {\n    values := url.Values{}\n    for k, v := range params {\n      values.Set(k, v)\n    }\n    endpoint = endpoint + \"?\" + values.Encode()\n  }\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  params := map[string]string{\"chapter_number\": \"1\", \"juz_number\": \"1\", \"page_number\": \"1\"}\n  data, err := callApi(params)\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get V2 Glyph codes of ayah\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(params = {})\n  path = \"/quran/verses/code_v2\"\n  uri = URI(API_BASE_URL + path)\n  uri.query = URI.encode_www_form(params) if params && !params.empty?\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\nparams = { \"chapter_number\" => \"1\", \"juz_number\" => \"1\", \"page_number\" => \"1\" }\ndata = call_api(params)\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get V2 Glyph codes of ayah\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(Dictionary<string, string> query = null)\n{\n    var path = $@\"/quran/verses/code_v2\";\n    var url = API_BASE_URL + path;\n    if (query != null && query.Count > 0)\n    {\n        var queryString = string.Join(\"&\", query.Select(kvp =>\n            $\"{Uri.EscapeDataString(kvp.Key)}={Uri.EscapeDataString(kvp.Value)}\"));\n        url = $\"{url}?{queryString}\";\n    }\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar query = new Dictionary<string, string> { {\"chapter_number\", \"1\"}, {\"juz_number\", \"1\"}, {\"page_number\", \"1\"} };\nvar data = await CallApiAsync(query);\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get V2 Glyph codes of ayah\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($params = []) {\n  $path = \"/quran/verses/code_v2\";\n  $url = API_BASE_URL . $path;\n  if (!empty($params)) {\n    $url .= '?' . http_build_query($params);\n  }\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$params = ['chapter_number' => '1', 'juz_number' => '1', 'page_number' => '1'];\n$data = callApi($params);\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get V2 Glyph codes of ayah\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(Map<String, String> params) throws IOException {\n    String path = \"/quran/verses/code_v2\";\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    if (params != null) {\n      for (Map.Entry<String, String> entry : params.entrySet()) {\n        urlBuilder.addQueryParameter(entry.getKey(), entry.getValue());\n      }\n    }\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    Map<String, String> params = new HashMap<>();\n    params.put(\"chapter_number\", \"1\");\n    params.put(\"juz_number\", \"1\");\n    params.put(\"page_number\", \"1\");\n    String data = callApi(params);\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get V2 Glyph codes of ayah\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([hashtable]$params = @{}) {\n  $path = \"/quran/verses/code_v2\"\n  $url = \"$API_BASE_URL$path\"\n  if ($params.Count -gt 0) {\n    $query = ($params.GetEnumerator() | ForEach-Object {\n      \"$($_.Key)=$([System.Uri]::EscapeDataString([string]$_.Value))\"\n    }) -join \"&\"\n    $url = \"$url?$query\"\n  }\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$params = @{ chapter_number = \"1\"; juz_number = \"1\"; page_number = \"1\" }\n$data = Call-Api($params)\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get V2 Glyph codes of ayah\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/quran/verses/code_v2?chapter_number=1&juz_number=1&page_number=1' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get v2 glyph codes of ayah using the Quran Foundation API.\n\nEndpoint: GET /quran/verses/code_v2\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nOptional Query Parameters:\n  chapter_number: If you want to get text of a specific surah.\n  juz_number: If you want to get text of a specific juz.\n  page_number: If you want to get text of a Madani Mushaf page\n  hizb_number: If you want to get text of a specific hizb.\n  rub_el_hizb_number: If you want to get text of a specific Rub el Hizb.\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/quran/verses/code_v2?{queryParams}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/recitations/{recitation_id}/by_chapter/{chapter_number}": {
      "get": {
        "tags": ["Audio"],
        "summary": "Get Ayah recitations for specific Surah",
        "description": "Returns per-verse audio file URLs for the chapter. Response includes a `pagination` object.",
        "operationId": "list-surah-recitation",
        "parameters": [
          {
            "name": "recitation_id",
            "in": "path",
            "description": "Ayah-by-ayah recitation ID from [/resources/recitations](/docs/content_apis_versioned/recitations). Do not use chapter-reciter IDs from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters) here.",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "chapter_number",
            "in": "path",
            "required": true,
            "schema": {
              "maximum": 114,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "For paginating within the result",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "records per api call, you can get maximum 50 records.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated list of extra audio file fields to include. Supported values: chapter_id, verse_number, verse_key, juz_number, hizb_number, rub_el_hizb_number, page_number, ruku_number, manzil_number, format, url, segments, duration, id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListSurahRecitationResponse"
                },
                "examples": {
                  "default_first_page": {
                    "summary": "First page (no segments/timestamps)",
                    "value": {
                      "audio_files": [
                        {
                          "verse_key": "1:1",
                          "url": "Alafasy/mp3/001001.mp3"
                        },
                        {
                          "verse_key": "1:2",
                          "url": "Alafasy/mp3/001002.mp3"
                        },
                        {
                          "verse_key": "1:3",
                          "url": "Alafasy/mp3/001003.mp3"
                        },
                        {
                          "verse_key": "1:4",
                          "url": "Alafasy/mp3/001004.mp3"
                        },
                        {
                          "verse_key": "1:5",
                          "url": "Alafasy/mp3/001005.mp3"
                        },
                        {
                          "verse_key": "1:6",
                          "url": "Alafasy/mp3/001006.mp3"
                        },
                        {
                          "verse_key": "1:7",
                          "url": "Alafasy/mp3/001007.mp3"
                        }
                      ],
                      "pagination": {
                        "per_page": 10,
                        "current_page": 1,
                        "next_page": null,
                        "total_pages": 1,
                        "total_records": 7
                      }
                    }
                  },
                  "page_2_example": {
                    "summary": "Second page (illustrative)",
                    "value": {
                      "audio_files": [],
                      "pagination": {
                        "per_page": 10,
                        "current_page": 2,
                        "next_page": null,
                        "total_pages": 2,
                        "total_records": 15
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get Ayah recitations for specific Surah\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(recitation_id, chapter_number) {\n  const response = await axios.get(\n    `${API_BASE_URL}/recitations/${recitation_id}/by_chapter/${chapter_number}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      }\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(1, \"1\")\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get Ayah recitations for specific Surah\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(recitation_id, chapter_number):\n    params = {k: v for k, v in {}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/recitations/{recitation_id}/by_chapter/{chapter_number}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(1, \"1\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get Ayah recitations for specific Surah\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(recitation_id string, chapter_number string) (string, error) {\n  path := fmt.Sprintf(\"/recitations/%s/by_chapter/%s\", recitation_id, chapter_number)\n  endpoint := API_BASE_URL + path\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  data, err := callApi(1, \"1\")\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get Ayah recitations for specific Surah\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(recitation_id, chapter_number)\n  path = \"/recitations/#{recitation_id}/by_chapter/#{chapter_number}\"\n  uri = URI(API_BASE_URL + path)\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\ndata = call_api(1, \"1\")\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get Ayah recitations for specific Surah\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string recitation_id, string chapter_number)\n{\n    var path = $@\"/recitations/{recitation_id}/by_chapter/{chapter_number}\";\n    var url = API_BASE_URL + path;\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar data = await CallApiAsync(1, \"1\");\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get Ayah recitations for specific Surah\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($recitation_id, $chapter_number) {\n  $path = sprintf(\"/recitations/%s/by_chapter/%s\", $recitation_id, $chapter_number);\n  $url = API_BASE_URL . $path;\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$data = callApi(1, \"1\");\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get Ayah recitations for specific Surah\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String recitation_id, String chapter_number) throws IOException {\n    String path = String.format(\"/recitations/%s/by_chapter/%s\", recitation_id, chapter_number);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    String data = callApi(1, \"1\");\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get Ayah recitations for specific Surah\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$recitation_id, [string]$chapter_number) {\n  $path = \"/recitations/$recitation_id/by_chapter/$chapter_number\"\n  $url = \"$API_BASE_URL$path\"\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$data = Call-Api(1, \"1\")\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get Ayah recitations for specific Surah\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/recitations/1/by_chapter/1' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get ayah recitations for specific surah using the Quran Foundation API.\n\nEndpoint: GET /recitations/{recitation_id}/by_chapter/{chapter_number}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  recitation_id: Ayah-by-ayah recitation ID from [/resources/recitations](/docs/content_apis_versioned/recitations). Do not use chapter-reciter IDs from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters) here. (e.g., \"1\")\n  chapter_number: Required parameter (e.g., \"1\")\nOptional Query Parameters:\n  page: For paginating within the result\n  per_page: records per api call, you can get maximum 50 records.\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/recitations/{recitation_id}/by_chapter/{chapter_number}?{queryParams}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts recitation_id, chapter_number and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/recitations/{recitation_id}/by_juz/{juz_number}": {
      "get": {
        "tags": ["Audio"],
        "summary": "Get Ayah recitations for specific Juz",
        "description": "Get list of ayah AudioFile for a juz.",
        "operationId": "list-juz-recitation",
        "parameters": [
          {
            "name": "recitation_id",
            "in": "path",
            "description": "Ayah-by-ayah recitation ID from [/resources/recitations](/docs/content_apis_versioned/recitations). Do not use chapter-reciter IDs from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters) here.",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "juz_number",
            "in": "path",
            "required": true,
            "schema": {
              "maximum": 30,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated list of extra audio file fields to include. Supported values: chapter_id, verse_number, verse_key, juz_number, hizb_number, rub_el_hizb_number, page_number, ruku_number, manzil_number, format, url, segments, duration, id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "For paginating within the result",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "records per api call, you can get maximum 50 records.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "required": ["audio_files", "pagination"],
                  "type": "object",
                  "properties": {
                    "audio_files": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/audiofile"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/pagination"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "audio_files": [
                        {
                          "verse_key": "1:1",
                          "url": "AbdulBaset/Mujawwad/mp3/001001.mp3"
                        },
                        {
                          "verse_key": "1:2",
                          "url": "AbdulBaset/Mujawwad/mp3/001002.mp3"
                        },
                        {
                          "verse_key": "1:3",
                          "url": "AbdulBaset/Mujawwad/mp3/001003.mp3"
                        }
                      ],
                      "pagination": {
                        "per_page": 10,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 2,
                        "total_records": 20
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get Ayah recitations for specific Juz\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(recitation_id, juz_number) {\n  const response = await axios.get(\n    `${API_BASE_URL}/recitations/${recitation_id}/by_juz/${juz_number}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      }\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(1, \"1\")\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get Ayah recitations for specific Juz\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(recitation_id, juz_number):\n    params = {k: v for k, v in {}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/recitations/{recitation_id}/by_juz/{juz_number}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(1, \"1\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get Ayah recitations for specific Juz\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(recitation_id string, juz_number string) (string, error) {\n  path := fmt.Sprintf(\"/recitations/%s/by_juz/%s\", recitation_id, juz_number)\n  endpoint := API_BASE_URL + path\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  data, err := callApi(1, \"1\")\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get Ayah recitations for specific Juz\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(recitation_id, juz_number)\n  path = \"/recitations/#{recitation_id}/by_juz/#{juz_number}\"\n  uri = URI(API_BASE_URL + path)\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\ndata = call_api(1, \"1\")\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get Ayah recitations for specific Juz\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string recitation_id, string juz_number)\n{\n    var path = $@\"/recitations/{recitation_id}/by_juz/{juz_number}\";\n    var url = API_BASE_URL + path;\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar data = await CallApiAsync(1, \"1\");\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get Ayah recitations for specific Juz\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($recitation_id, $juz_number) {\n  $path = sprintf(\"/recitations/%s/by_juz/%s\", $recitation_id, $juz_number);\n  $url = API_BASE_URL . $path;\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$data = callApi(1, \"1\");\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get Ayah recitations for specific Juz\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String recitation_id, String juz_number) throws IOException {\n    String path = String.format(\"/recitations/%s/by_juz/%s\", recitation_id, juz_number);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    String data = callApi(1, \"1\");\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get Ayah recitations for specific Juz\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$recitation_id, [string]$juz_number) {\n  $path = \"/recitations/$recitation_id/by_juz/$juz_number\"\n  $url = \"$API_BASE_URL$path\"\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$data = Call-Api(1, \"1\")\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get Ayah recitations for specific Juz\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/recitations/1/by_juz/1' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get ayah recitations for specific juz using the Quran Foundation API.\n\nEndpoint: GET /recitations/{recitation_id}/by_juz/{juz_number}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  recitation_id: Ayah-by-ayah recitation ID from [/resources/recitations](/docs/content_apis_versioned/recitations). Do not use chapter-reciter IDs from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters) here. (e.g., \"1\")\n  juz_number: Required parameter (e.g., \"1\")\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/recitations/{recitation_id}/by_juz/{juz_number}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts recitation_id, juz_number and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/recitations/{recitation_id}/by_page/{page_number}": {
      "get": {
        "tags": ["Audio"],
        "summary": "Get Ayah recitations for specific Madani Mushaf page",
        "description": "Get list of ayah AudioFile for a Madani Mushaf page.",
        "operationId": "list-page-recitation",
        "parameters": [
          {
            "name": "recitation_id",
            "in": "path",
            "description": "Ayah-by-ayah recitation ID from [/resources/recitations](/docs/content_apis_versioned/recitations). Do not use chapter-reciter IDs from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters) here.",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page_number",
            "in": "path",
            "required": true,
            "schema": {
              "maximum": 604,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated list of extra audio file fields to include. Supported values: chapter_id, verse_number, verse_key, juz_number, hizb_number, rub_el_hizb_number, page_number, ruku_number, manzil_number, format, url, segments, duration, id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "For paginating within the result",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "records per api call, you can get maximum 50 records.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "required": ["audio_files", "pagination"],
                  "type": "object",
                  "properties": {
                    "audio_files": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/audiofile"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/pagination"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "audio_files": [
                        {
                          "verse_key": "1:1",
                          "url": "AbdulBaset/Mujawwad/mp3/001001.mp3"
                        },
                        {
                          "verse_key": "1:2",
                          "url": "AbdulBaset/Mujawwad/mp3/001002.mp3"
                        },
                        {
                          "verse_key": "1:3",
                          "url": "AbdulBaset/Mujawwad/mp3/001003.mp3"
                        }
                      ],
                      "pagination": {
                        "per_page": 10,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 15,
                        "total_records": 148
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get Ayah recitations for specific Madani Mushaf page\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(recitation_id, page_number) {\n  const response = await axios.get(\n    `${API_BASE_URL}/recitations/${recitation_id}/by_page/${page_number}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      }\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(1, \"1\")\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get Ayah recitations for specific Madani Mushaf page\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(recitation_id, page_number):\n    params = {k: v for k, v in {}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/recitations/{recitation_id}/by_page/{page_number}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(1, \"1\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get Ayah recitations for specific Madani Mushaf page\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(recitation_id string, page_number string) (string, error) {\n  path := fmt.Sprintf(\"/recitations/%s/by_page/%s\", recitation_id, page_number)\n  endpoint := API_BASE_URL + path\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  data, err := callApi(1, \"1\")\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get Ayah recitations for specific Madani Mushaf page\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(recitation_id, page_number)\n  path = \"/recitations/#{recitation_id}/by_page/#{page_number}\"\n  uri = URI(API_BASE_URL + path)\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\ndata = call_api(1, \"1\")\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get Ayah recitations for specific Madani Mushaf page\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string recitation_id, string page_number)\n{\n    var path = $@\"/recitations/{recitation_id}/by_page/{page_number}\";\n    var url = API_BASE_URL + path;\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar data = await CallApiAsync(1, \"1\");\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get Ayah recitations for specific Madani Mushaf page\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($recitation_id, $page_number) {\n  $path = sprintf(\"/recitations/%s/by_page/%s\", $recitation_id, $page_number);\n  $url = API_BASE_URL . $path;\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$data = callApi(1, \"1\");\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get Ayah recitations for specific Madani Mushaf page\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String recitation_id, String page_number) throws IOException {\n    String path = String.format(\"/recitations/%s/by_page/%s\", recitation_id, page_number);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    String data = callApi(1, \"1\");\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get Ayah recitations for specific Madani Mushaf page\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$recitation_id, [string]$page_number) {\n  $path = \"/recitations/$recitation_id/by_page/$page_number\"\n  $url = \"$API_BASE_URL$path\"\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$data = Call-Api(1, \"1\")\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get Ayah recitations for specific Madani Mushaf page\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/recitations/1/by_page/1' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get ayah recitations for specific madani mushaf page using the Quran Foundation API.\n\nEndpoint: GET /recitations/{recitation_id}/by_page/{page_number}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  recitation_id: Ayah-by-ayah recitation ID from [/resources/recitations](/docs/content_apis_versioned/recitations). Do not use chapter-reciter IDs from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters) here. (e.g., \"1\")\n  page_number: Required parameter (e.g., \"1\")\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/recitations/{recitation_id}/by_page/{page_number}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts recitation_id, page_number and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/recitations/{recitation_id}/by_rub/{rub_el_hizb_number}": {
      "get": {
        "tags": ["Audio"],
        "summary": "Get Ayah recitations for specific Rub el Hizb",
        "description": "Get list of ayah AudioFile for a Rub el Hizb.",
        "operationId": "list-rub-el-hizb-recitation",
        "parameters": [
          {
            "name": "recitation_id",
            "in": "path",
            "description": "Ayah-by-ayah recitation ID from [/resources/recitations](/docs/content_apis_versioned/recitations). Do not use chapter-reciter IDs from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters) here.",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "rub_el_hizb_number",
            "in": "path",
            "required": true,
            "schema": {
              "maximum": 240,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated list of extra audio file fields to include. Supported values: chapter_id, verse_number, verse_key, juz_number, hizb_number, rub_el_hizb_number, page_number, ruku_number, manzil_number, format, url, segments, duration, id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "For paginating within the result",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "records per api call, you can get maximum 50 records.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "required": ["audio_files", "pagination"],
                  "type": "object",
                  "properties": {
                    "audio_files": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/audiofile"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/pagination"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "audio_files": [
                        {
                          "verse_key": "1:1",
                          "url": "AbdulBaset/Mujawwad/mp3/001001.mp3"
                        },
                        {
                          "verse_key": "1:2",
                          "url": "AbdulBaset/Mujawwad/mp3/001002.mp3"
                        },
                        {
                          "verse_key": "1:3",
                          "url": "AbdulBaset/Mujawwad/mp3/001003.mp3"
                        }
                      ],
                      "pagination": {
                        "per_page": 10,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 15,
                        "total_records": 148
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get Ayah recitations for specific Rub el Hizb\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(recitation_id, rub_el_hizb_number) {\n  const response = await axios.get(\n    `${API_BASE_URL}/recitations/${recitation_id}/by_rub/${rub_el_hizb_number}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      }\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(1, \"1\")\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get Ayah recitations for specific Rub el Hizb\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(recitation_id, rub_el_hizb_number):\n    params = {k: v for k, v in {}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/recitations/{recitation_id}/by_rub/{rub_el_hizb_number}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(1, \"1\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get Ayah recitations for specific Rub el Hizb\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(recitation_id string, rub_el_hizb_number string) (string, error) {\n  path := fmt.Sprintf(\"/recitations/%s/by_rub/%s\", recitation_id, rub_el_hizb_number)\n  endpoint := API_BASE_URL + path\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  data, err := callApi(1, \"1\")\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get Ayah recitations for specific Rub el Hizb\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(recitation_id, rub_el_hizb_number)\n  path = \"/recitations/#{recitation_id}/by_rub/#{rub_el_hizb_number}\"\n  uri = URI(API_BASE_URL + path)\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\ndata = call_api(1, \"1\")\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get Ayah recitations for specific Rub el Hizb\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string recitation_id, string rub_el_hizb_number)\n{\n    var path = $@\"/recitations/{recitation_id}/by_rub/{rub_el_hizb_number}\";\n    var url = API_BASE_URL + path;\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar data = await CallApiAsync(1, \"1\");\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get Ayah recitations for specific Rub el Hizb\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($recitation_id, $rub_el_hizb_number) {\n  $path = sprintf(\"/recitations/%s/by_rub/%s\", $recitation_id, $rub_el_hizb_number);\n  $url = API_BASE_URL . $path;\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$data = callApi(1, \"1\");\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get Ayah recitations for specific Rub el Hizb\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String recitation_id, String rub_el_hizb_number) throws IOException {\n    String path = String.format(\"/recitations/%s/by_rub/%s\", recitation_id, rub_el_hizb_number);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    String data = callApi(1, \"1\");\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get Ayah recitations for specific Rub el Hizb\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$recitation_id, [string]$rub_el_hizb_number) {\n  $path = \"/recitations/$recitation_id/by_rub/$rub_el_hizb_number\"\n  $url = \"$API_BASE_URL$path\"\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$data = Call-Api(1, \"1\")\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get Ayah recitations for specific Rub el Hizb\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/recitations/1/by_rub/1' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get ayah recitations for specific rub el hizb using the Quran Foundation API.\n\nEndpoint: GET /recitations/{recitation_id}/by_rub/{rub_el_hizb_number}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  recitation_id: Ayah-by-ayah recitation ID from [/resources/recitations](/docs/content_apis_versioned/recitations). Do not use chapter-reciter IDs from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters) here. (e.g., \"1\")\n  rub_el_hizb_number: Required parameter (e.g., \"1\")\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/recitations/{recitation_id}/by_rub/{rub_el_hizb_number}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts recitation_id, rub_el_hizb_number and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/recitations/{recitation_id}/by_hizb/{hizb_number}": {
      "get": {
        "tags": ["Audio"],
        "summary": "Get Ayah recitations for specific Hizb",
        "description": "Get list of ayah AudioFile for a Hizb.",
        "operationId": "list-hizb-recitation",
        "parameters": [
          {
            "name": "recitation_id",
            "in": "path",
            "description": "Ayah-by-ayah recitation ID from [/resources/recitations](/docs/content_apis_versioned/recitations). Do not use chapter-reciter IDs from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters) here.",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "hizb_number",
            "in": "path",
            "required": true,
            "schema": {
              "maximum": 60,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated list of extra audio file fields to include. Supported values: chapter_id, verse_number, verse_key, juz_number, hizb_number, rub_el_hizb_number, page_number, ruku_number, manzil_number, format, url, segments, duration, id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "For paginating within the result",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "records per api call, you can get maximum 50 records.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "required": ["audio_files", "pagination"],
                  "type": "object",
                  "properties": {
                    "audio_files": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/audiofile"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/pagination"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "audio_files": [
                        {
                          "verse_key": "1:1",
                          "url": "AbdulBaset/Mujawwad/mp3/001001.mp3"
                        },
                        {
                          "verse_key": "1:2",
                          "url": "AbdulBaset/Mujawwad/mp3/001002.mp3"
                        },
                        {
                          "verse_key": "1:3",
                          "url": "AbdulBaset/Mujawwad/mp3/001003.mp3"
                        }
                      ],
                      "pagination": {
                        "per_page": 10,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 15,
                        "total_records": 148
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get Ayah recitations for specific Hizb\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(recitation_id, hizb_number) {\n  const response = await axios.get(\n    `${API_BASE_URL}/recitations/${recitation_id}/by_hizb/${hizb_number}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      }\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(1, \"1\")\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get Ayah recitations for specific Hizb\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(recitation_id, hizb_number):\n    params = {k: v for k, v in {}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/recitations/{recitation_id}/by_hizb/{hizb_number}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(1, \"1\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get Ayah recitations for specific Hizb\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(recitation_id string, hizb_number string) (string, error) {\n  path := fmt.Sprintf(\"/recitations/%s/by_hizb/%s\", recitation_id, hizb_number)\n  endpoint := API_BASE_URL + path\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  data, err := callApi(1, \"1\")\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get Ayah recitations for specific Hizb\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(recitation_id, hizb_number)\n  path = \"/recitations/#{recitation_id}/by_hizb/#{hizb_number}\"\n  uri = URI(API_BASE_URL + path)\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\ndata = call_api(1, \"1\")\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get Ayah recitations for specific Hizb\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string recitation_id, string hizb_number)\n{\n    var path = $@\"/recitations/{recitation_id}/by_hizb/{hizb_number}\";\n    var url = API_BASE_URL + path;\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar data = await CallApiAsync(1, \"1\");\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get Ayah recitations for specific Hizb\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($recitation_id, $hizb_number) {\n  $path = sprintf(\"/recitations/%s/by_hizb/%s\", $recitation_id, $hizb_number);\n  $url = API_BASE_URL . $path;\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$data = callApi(1, \"1\");\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get Ayah recitations for specific Hizb\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String recitation_id, String hizb_number) throws IOException {\n    String path = String.format(\"/recitations/%s/by_hizb/%s\", recitation_id, hizb_number);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    String data = callApi(1, \"1\");\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get Ayah recitations for specific Hizb\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$recitation_id, [string]$hizb_number) {\n  $path = \"/recitations/$recitation_id/by_hizb/$hizb_number\"\n  $url = \"$API_BASE_URL$path\"\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$data = Call-Api(1, \"1\")\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get Ayah recitations for specific Hizb\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/recitations/1/by_hizb/1' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get ayah recitations for specific hizb using the Quran Foundation API.\n\nEndpoint: GET /recitations/{recitation_id}/by_hizb/{hizb_number}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  recitation_id: Ayah-by-ayah recitation ID from [/resources/recitations](/docs/content_apis_versioned/recitations). Do not use chapter-reciter IDs from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters) here. (e.g., \"1\")\n  hizb_number: Required parameter (e.g., \"1\")\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/recitations/{recitation_id}/by_hizb/{hizb_number}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts recitation_id, hizb_number and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/recitations/{recitation_id}/by_ayah/{ayah_key}": {
      "get": {
        "tags": ["Audio"],
        "summary": "Get Ayah recitations for specific Ayah",
        "description": "Get list of ayah AudioFile for a specific Ayah.",
        "operationId": "list-ayah-recitation",
        "parameters": [
          {
            "name": "recitation_id",
            "in": "path",
            "description": "Ayah-by-ayah recitation ID from [/resources/recitations](/docs/content_apis_versioned/recitations). Do not use chapter-reciter IDs from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters) here.",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "ayah_key",
            "in": "path",
            "description": "Ayah key is combination of surah number and  ayah number. e.g 1:1 will be first Ayah of first Surah",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated list of extra audio file fields to include. Supported values: chapter_id, verse_number, verse_key, juz_number, hizb_number, rub_el_hizb_number, page_number, ruku_number, manzil_number, format, url, segments, duration, id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "For paginating within the result",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "records per api call, you can get maximum 50 records.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "required": ["audio_files", "pagination"],
                  "type": "object",
                  "properties": {
                    "audio_files": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/audiofile"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/pagination"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "audio_files": [
                        {
                          "verse_key": "1:1",
                          "url": "AbdulBaset/Mujawwad/mp3/001001.mp3"
                        },
                        {
                          "verse_key": "1:2",
                          "url": "AbdulBaset/Mujawwad/mp3/001002.mp3"
                        },
                        {
                          "verse_key": "1:3",
                          "url": "AbdulBaset/Mujawwad/mp3/001003.mp3"
                        }
                      ],
                      "pagination": {
                        "per_page": 10,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 15,
                        "total_records": 148
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get Ayah recitations for specific Ayah\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(recitation_id, ayah_key) {\n  const response = await axios.get(\n    `${API_BASE_URL}/recitations/${recitation_id}/by_ayah/${ayah_key}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      }\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(1, \"value\")\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get Ayah recitations for specific Ayah\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(recitation_id, ayah_key):\n    params = {k: v for k, v in {}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/recitations/{recitation_id}/by_ayah/{ayah_key}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(1, \"value\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get Ayah recitations for specific Ayah\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(recitation_id string, ayah_key string) (string, error) {\n  path := fmt.Sprintf(\"/recitations/%s/by_ayah/%s\", recitation_id, ayah_key)\n  endpoint := API_BASE_URL + path\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  data, err := callApi(1, \"value\")\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get Ayah recitations for specific Ayah\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(recitation_id, ayah_key)\n  path = \"/recitations/#{recitation_id}/by_ayah/#{ayah_key}\"\n  uri = URI(API_BASE_URL + path)\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\ndata = call_api(1, \"value\")\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get Ayah recitations for specific Ayah\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string recitation_id, string ayah_key)\n{\n    var path = $@\"/recitations/{recitation_id}/by_ayah/{ayah_key}\";\n    var url = API_BASE_URL + path;\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar data = await CallApiAsync(1, \"value\");\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get Ayah recitations for specific Ayah\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($recitation_id, $ayah_key) {\n  $path = sprintf(\"/recitations/%s/by_ayah/%s\", $recitation_id, $ayah_key);\n  $url = API_BASE_URL . $path;\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$data = callApi(1, \"value\");\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get Ayah recitations for specific Ayah\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String recitation_id, String ayah_key) throws IOException {\n    String path = String.format(\"/recitations/%s/by_ayah/%s\", recitation_id, ayah_key);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    String data = callApi(1, \"value\");\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get Ayah recitations for specific Ayah\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$recitation_id, [string]$ayah_key) {\n  $path = \"/recitations/$recitation_id/by_ayah/$ayah_key\"\n  $url = \"$API_BASE_URL$path\"\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$data = Call-Api(1, \"value\")\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get Ayah recitations for specific Ayah\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/recitations/1/by_ayah/value' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get ayah recitations for specific ayah using the Quran Foundation API.\n\nEndpoint: GET /recitations/{recitation_id}/by_ayah/{ayah_key}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  recitation_id: Ayah-by-ayah recitation ID from [/resources/recitations](/docs/content_apis_versioned/recitations). Do not use chapter-reciter IDs from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters) here. (e.g., \"1\")\n  ayah_key: Ayah key is combination of surah number and  ayah number. e.g 1:1 will be first Ayah of first Surah (e.g., \"value\")\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/recitations/{recitation_id}/by_ayah/{ayah_key}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts recitation_id, ayah_key and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/resources/recitations/{recitation_id}/info": {
      "get": {
        "tags": ["Resources"],
        "summary": "Recitation Info",
        "description": "Get information for a specific ayah-by-ayah recitation. Use a `recitation_id` from [/resources/recitations](/docs/content_apis_versioned/recitations). Do not use chapter-reciter IDs from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters) here. Could include detail about the reciter, recitation style, and recording.",
        "operationId": "recitation-info",
        "parameters": [
          {
            "name": "recitation_id",
            "in": "path",
            "description": "Ayah-by-ayah recitation ID from [/resources/recitations](/docs/content_apis_versioned/recitations). Do not use chapter-reciter IDs from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters) here.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "info": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "info": {
                          "type": "string",
                          "nullable": true
                        }
                      },
                      "required": ["id", "info"]
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "info": {
                        "id": 1,
                        "info": null
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Recitation Info\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(recitation_id) {\n  const response = await axios.get(\n    `${API_BASE_URL}/resources/recitations/${recitation_id}/info`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      }\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(\"value\")\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Recitation Info\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(recitation_id):\n    params = {k: v for k, v in {}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/resources/recitations/{recitation_id}/info',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(\"value\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Recitation Info\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(recitation_id string) (string, error) {\n  path := fmt.Sprintf(\"/resources/recitations/%s/info\", recitation_id)\n  endpoint := API_BASE_URL + path\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  data, err := callApi(\"value\")\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Recitation Info\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(recitation_id)\n  path = \"/resources/recitations/#{recitation_id}/info\"\n  uri = URI(API_BASE_URL + path)\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\ndata = call_api(\"value\")\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Recitation Info\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string recitation_id)\n{\n    var path = $@\"/resources/recitations/{recitation_id}/info\";\n    var url = API_BASE_URL + path;\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar data = await CallApiAsync(\"value\");\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Recitation Info\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($recitation_id) {\n  $path = sprintf(\"/resources/recitations/%s/info\", $recitation_id);\n  $url = API_BASE_URL . $path;\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$data = callApi(\"value\");\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Recitation Info\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String recitation_id) throws IOException {\n    String path = String.format(\"/resources/recitations/%s/info\", recitation_id);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    String data = callApi(\"value\");\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Recitation Info\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$recitation_id) {\n  $path = \"/resources/recitations/$recitation_id/info\"\n  $url = \"$API_BASE_URL$path\"\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$data = Call-Api(\"value\")\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Recitation Info\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/resources/recitations/value/info' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to recitation info using the Quran Foundation API.\n\nEndpoint: GET /resources/recitations/{recitation_id}/info\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  recitation_id: Ayah-by-ayah recitation ID from [/resources/recitations](/docs/content_apis_versioned/recitations). Do not use chapter-reciter IDs from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters) here. (e.g., \"value\")\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/resources/recitations/{recitation_id}/info\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts recitation_id and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/resources/translations/{translation_id}/info": {
      "get": {
        "tags": ["Resources"],
        "summary": "Translation Info",
        "description": "Get information of a specific translation. Could include detail about the author, publishing date and publisher etc.",
        "operationId": "translation-info",
        "parameters": [
          {
            "name": "translation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "info": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "info": {
                          "type": "string",
                          "nullable": true
                        }
                      },
                      "required": ["id", "info"]
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "info": {
                        "id": 1,
                        "info": null
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Translation Info\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(translation_id) {\n  const response = await axios.get(\n    `${API_BASE_URL}/resources/translations/${translation_id}/info`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      }\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(\"131\")\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Translation Info\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(translation_id):\n    params = {k: v for k, v in {}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/resources/translations/{translation_id}/info',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(\"131\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Translation Info\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(translation_id string) (string, error) {\n  path := fmt.Sprintf(\"/resources/translations/%s/info\", translation_id)\n  endpoint := API_BASE_URL + path\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  data, err := callApi(\"131\")\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Translation Info\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(translation_id)\n  path = \"/resources/translations/#{translation_id}/info\"\n  uri = URI(API_BASE_URL + path)\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\ndata = call_api(\"131\")\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Translation Info\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string translation_id)\n{\n    var path = $@\"/resources/translations/{translation_id}/info\";\n    var url = API_BASE_URL + path;\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar data = await CallApiAsync(\"131\");\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Translation Info\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($translation_id) {\n  $path = sprintf(\"/resources/translations/%s/info\", $translation_id);\n  $url = API_BASE_URL . $path;\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$data = callApi(\"131\");\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Translation Info\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String translation_id) throws IOException {\n    String path = String.format(\"/resources/translations/%s/info\", translation_id);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    String data = callApi(\"131\");\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Translation Info\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$translation_id) {\n  $path = \"/resources/translations/$translation_id/info\"\n  $url = \"$API_BASE_URL$path\"\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$data = Call-Api(\"131\")\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Translation Info\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/resources/translations/131/info' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to translation info using the Quran Foundation API.\n\nEndpoint: GET /resources/translations/{translation_id}/info\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  translation_id: Required parameter (e.g., \"131\")\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/resources/translations/{translation_id}/info\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts translation_id and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/resources/translations": {
      "get": {
        "tags": ["Resources"],
        "summary": "Translations",
        "description": "Get list of available translations. Use `language` query to get translated names of authors in specific language(e.g language=ur will send translation names in Urdu). \n\nFor list of available language see [/resources/languages](/docs/content_apis_versioned/languages) endpoint.",
        "operationId": "translations",
        "parameters": [
          {
            "name": "language",
            "in": "query",
            "description": "ISO language code to return translated names in that language when available; defaults to English otherwise.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "translations": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/resource"
                      }
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "translations": [
                        {
                          "id": 131,
                          "name": "Dr. Mustafa Khattab, the Clear Quran",
                          "author_name": "Dr. Mustafa Khattab",
                          "slug": "clearquran-with-tafsir",
                          "language_name": "english",
                          "translated_name": {
                            "name": "Dr. Mustafa Khattab",
                            "language_name": "english"
                          }
                        }
                      ]
                    }
                  },
                  "english_translation_resources": {
                    "summary": "English translation resources",
                    "value": {
                      "translations": [
                        {
                          "id": 131,
                          "name": "Dr. Mustafa Khattab, the Clear Quran",
                          "author_name": "Dr. Mustafa Khattab",
                          "slug": "clearquran-with-tafsir",
                          "language_name": "english",
                          "translated_name": {
                            "name": "Dr. Mustafa Khattab",
                            "language_name": "english"
                          }
                        }
                      ]
                    }
                  },
                  "urdu_translation_resources": {
                    "summary": "Non-English translation resources",
                    "value": {
                      "translations": [
                        {
                          "id": 97,
                          "name": "Taqi Usmani",
                          "author_name": "Mufti Taqi Usmani",
                          "slug": "taqi-usmani",
                          "language_name": "urdu",
                          "translated_name": {
                            "name": "Taqi Usmani",
                            "language_name": "english"
                          }
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Translations\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(options = {}) {\n  const response = await axios.get(\n    `${API_BASE_URL}/resources/translations`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      },\n      params: options\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi({\"language\":\"en\"})\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Translations\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(language=None):\n    params = {k: v for k, v in {'language': language}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/resources/translations',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(language=\"en\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Translations\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(params map[string]string) (string, error) {\n  path := \"/resources/translations\"\n  endpoint := API_BASE_URL + path\n  if params != nil && len(params) > 0 {\n    values := url.Values{}\n    for k, v := range params {\n      values.Set(k, v)\n    }\n    endpoint = endpoint + \"?\" + values.Encode()\n  }\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  params := map[string]string{\"language\": \"en\"}\n  data, err := callApi(params)\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Translations\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(params = {})\n  path = \"/resources/translations\"\n  uri = URI(API_BASE_URL + path)\n  uri.query = URI.encode_www_form(params) if params && !params.empty?\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\nparams = { \"language\" => \"en\" }\ndata = call_api(params)\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Translations\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(Dictionary<string, string> query = null)\n{\n    var path = $@\"/resources/translations\";\n    var url = API_BASE_URL + path;\n    if (query != null && query.Count > 0)\n    {\n        var queryString = string.Join(\"&\", query.Select(kvp =>\n            $\"{Uri.EscapeDataString(kvp.Key)}={Uri.EscapeDataString(kvp.Value)}\"));\n        url = $\"{url}?{queryString}\";\n    }\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar query = new Dictionary<string, string> { {\"language\", \"en\"} };\nvar data = await CallApiAsync(query);\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Translations\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($params = []) {\n  $path = \"/resources/translations\";\n  $url = API_BASE_URL . $path;\n  if (!empty($params)) {\n    $url .= '?' . http_build_query($params);\n  }\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$params = ['language' => 'en'];\n$data = callApi($params);\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Translations\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(Map<String, String> params) throws IOException {\n    String path = \"/resources/translations\";\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    if (params != null) {\n      for (Map.Entry<String, String> entry : params.entrySet()) {\n        urlBuilder.addQueryParameter(entry.getKey(), entry.getValue());\n      }\n    }\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    Map<String, String> params = new HashMap<>();\n    params.put(\"language\", \"en\");\n    String data = callApi(params);\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Translations\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([hashtable]$params = @{}) {\n  $path = \"/resources/translations\"\n  $url = \"$API_BASE_URL$path\"\n  if ($params.Count -gt 0) {\n    $query = ($params.GetEnumerator() | ForEach-Object {\n      \"$($_.Key)=$([System.Uri]::EscapeDataString([string]$_.Value))\"\n    }) -join \"&\"\n    $url = \"$url?$query\"\n  }\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$params = @{ language = \"en\" }\n$data = Call-Api($params)\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Translations\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/resources/translations?language=en' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to translations using the Quran Foundation API.\n\nEndpoint: GET /resources/translations\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nOptional Query Parameters:\n  language: ISO language code to return translated names in that language when available; defaults to English otherwise.\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/resources/translations?{queryParams}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/resources/tafsirs": {
      "get": {
        "tags": ["Resources"],
        "summary": "Tafsirs",
        "description": "Get list of available tafsirs.",
        "operationId": "tafsirs",
        "parameters": [
          {
            "name": "language",
            "in": "query",
            "description": "ISO language code to return translated names in that language when available; defaults to English otherwise.",
            "schema": {
              "type": "string",
              "default": "en"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tafsirs": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/resource"
                      }
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "tafsirs": [
                        {
                          "id": 169,
                          "name": "Tafsir Ibn Kathir",
                          "author_name": "Hafiz Ibn Kathir",
                          "slug": "en-tafsir-ibn-kathir",
                          "language_name": "english",
                          "translated_name": {
                            "name": "Tafsir Ibn Kathir",
                            "language_name": "english"
                          }
                        }
                      ]
                    }
                  },
                  "english_tafsir_resources": {
                    "summary": "English tafsir resources",
                    "value": {
                      "tafsirs": [
                        {
                          "id": 169,
                          "name": "Tafsir Ibn Kathir",
                          "author_name": "Hafiz Ibn Kathir",
                          "slug": "en-tafsir-ibn-kathir",
                          "language_name": "english",
                          "translated_name": {
                            "name": "Tafsir Ibn Kathir",
                            "language_name": "english"
                          }
                        }
                      ]
                    }
                  },
                  "arabic_tafsir_resources": {
                    "summary": "Arabic tafsir resources",
                    "value": {
                      "tafsirs": [
                        {
                          "id": 16,
                          "name": "Tafsir al-Tabari",
                          "author_name": "Imam al-Tabari",
                          "slug": "tafsir-tabari",
                          "language_name": "arabic",
                          "translated_name": {
                            "name": "Tafsir al-Tabari",
                            "language_name": "english"
                          }
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Tafsirs\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(options = {}) {\n  const response = await axios.get(\n    `${API_BASE_URL}/resources/tafsirs`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      },\n      params: options\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi({\"language\":\"en\"})\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Tafsirs\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(language=None):\n    params = {k: v for k, v in {'language': language}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/resources/tafsirs',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(language=\"en\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Tafsirs\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(params map[string]string) (string, error) {\n  path := \"/resources/tafsirs\"\n  endpoint := API_BASE_URL + path\n  if params != nil && len(params) > 0 {\n    values := url.Values{}\n    for k, v := range params {\n      values.Set(k, v)\n    }\n    endpoint = endpoint + \"?\" + values.Encode()\n  }\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  params := map[string]string{\"language\": \"en\"}\n  data, err := callApi(params)\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Tafsirs\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(params = {})\n  path = \"/resources/tafsirs\"\n  uri = URI(API_BASE_URL + path)\n  uri.query = URI.encode_www_form(params) if params && !params.empty?\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\nparams = { \"language\" => \"en\" }\ndata = call_api(params)\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Tafsirs\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(Dictionary<string, string> query = null)\n{\n    var path = $@\"/resources/tafsirs\";\n    var url = API_BASE_URL + path;\n    if (query != null && query.Count > 0)\n    {\n        var queryString = string.Join(\"&\", query.Select(kvp =>\n            $\"{Uri.EscapeDataString(kvp.Key)}={Uri.EscapeDataString(kvp.Value)}\"));\n        url = $\"{url}?{queryString}\";\n    }\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar query = new Dictionary<string, string> { {\"language\", \"en\"} };\nvar data = await CallApiAsync(query);\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Tafsirs\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($params = []) {\n  $path = \"/resources/tafsirs\";\n  $url = API_BASE_URL . $path;\n  if (!empty($params)) {\n    $url .= '?' . http_build_query($params);\n  }\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$params = ['language' => 'en'];\n$data = callApi($params);\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Tafsirs\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(Map<String, String> params) throws IOException {\n    String path = \"/resources/tafsirs\";\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    if (params != null) {\n      for (Map.Entry<String, String> entry : params.entrySet()) {\n        urlBuilder.addQueryParameter(entry.getKey(), entry.getValue());\n      }\n    }\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    Map<String, String> params = new HashMap<>();\n    params.put(\"language\", \"en\");\n    String data = callApi(params);\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Tafsirs\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([hashtable]$params = @{}) {\n  $path = \"/resources/tafsirs\"\n  $url = \"$API_BASE_URL$path\"\n  if ($params.Count -gt 0) {\n    $query = ($params.GetEnumerator() | ForEach-Object {\n      \"$($_.Key)=$([System.Uri]::EscapeDataString([string]$_.Value))\"\n    }) -join \"&\"\n    $url = \"$url?$query\"\n  }\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$params = @{ language = \"en\" }\n$data = Call-Api($params)\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Tafsirs\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/resources/tafsirs?language=en' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to tafsirs using the Quran Foundation API.\n\nEndpoint: GET /resources/tafsirs\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nOptional Query Parameters:\n  language: ISO language code to return translated names in that language when available; defaults to English otherwise.\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/resources/tafsirs?{queryParams}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/resources/tafsirs/{tafsir_id}/info": {
      "get": {
        "tags": ["Resources"],
        "summary": "Tafsir Info",
        "description": "Get the information of a specific tafsir. Could include information about the author, when it was published etc.",
        "operationId": "tafsir-info",
        "parameters": [
          {
            "name": "tafsir_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["info"],
                  "properties": {
                    "info": {
                      "type": "object",
                      "required": ["id", "info"],
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "info": {
                          "type": "string",
                          "description": "Markdown or HTML text describing the tafsir resource."
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "info": {
                        "id": 169,
                        "info": "<p>Tafsir Ibn Kathir is one of the most comprehensive classical commentaries, compiled in the 14th century by the Damascene scholar Ibn Kathir. It combines narration, legal analysis, and linguistic insights while cross-referencing Prophetic traditions.</p>"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Tafsir Info\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(tafsir_id) {\n  const response = await axios.get(\n    `${API_BASE_URL}/resources/tafsirs/${tafsir_id}/info`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      }\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(\"169\")\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Tafsir Info\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(tafsir_id):\n    params = {k: v for k, v in {}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/resources/tafsirs/{tafsir_id}/info',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(\"169\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Tafsir Info\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(tafsir_id string) (string, error) {\n  path := fmt.Sprintf(\"/resources/tafsirs/%s/info\", tafsir_id)\n  endpoint := API_BASE_URL + path\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  data, err := callApi(\"169\")\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Tafsir Info\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(tafsir_id)\n  path = \"/resources/tafsirs/#{tafsir_id}/info\"\n  uri = URI(API_BASE_URL + path)\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\ndata = call_api(\"169\")\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Tafsir Info\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string tafsir_id)\n{\n    var path = $@\"/resources/tafsirs/{tafsir_id}/info\";\n    var url = API_BASE_URL + path;\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar data = await CallApiAsync(\"169\");\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Tafsir Info\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($tafsir_id) {\n  $path = sprintf(\"/resources/tafsirs/%s/info\", $tafsir_id);\n  $url = API_BASE_URL . $path;\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$data = callApi(\"169\");\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Tafsir Info\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String tafsir_id) throws IOException {\n    String path = String.format(\"/resources/tafsirs/%s/info\", tafsir_id);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    String data = callApi(\"169\");\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Tafsir Info\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$tafsir_id) {\n  $path = \"/resources/tafsirs/$tafsir_id/info\"\n  $url = \"$API_BASE_URL$path\"\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$data = Call-Api(\"169\")\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Tafsir Info\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/resources/tafsirs/169/info' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to tafsir info using the Quran Foundation API.\n\nEndpoint: GET /resources/tafsirs/{tafsir_id}/info\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  tafsir_id: Required parameter (e.g., \"169\")\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/resources/tafsirs/{tafsir_id}/info\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts tafsir_id and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/resources/recitation_styles": {
      "get": {
        "tags": ["Resources"],
        "summary": "Recitation Styles",
        "description": "Get the available recitation styles.",
        "operationId": "recitation-styles",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["recitation_styles"],
                  "properties": {
                    "recitation_styles": {
                      "type": "object",
                      "required": ["mujawwad", "murattal", "muallim"],
                      "properties": {
                        "mujawwad": {
                          "type": "string"
                        },
                        "murattal": {
                          "type": "string"
                        },
                        "muallim": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "recitation_styles": {
                        "mujawwad": "Mujawwad is a melodic style of Holy Quran recitation",
                        "murattal": "Murattal is at a slower pace, used for study and practice",
                        "muallim": "Muallim is teaching style recitation of Holy Quran"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Recitation Styles\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi() {\n  const response = await axios.get(\n    `${API_BASE_URL}/resources/recitation_styles`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      }\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi()\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Recitation Styles\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api():\n    params = {k: v for k, v in {}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/resources/recitation_styles',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api()\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Recitation Styles\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi() (string, error) {\n  path := \"/resources/recitation_styles\"\n  endpoint := API_BASE_URL + path\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  data, err := callApi()\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Recitation Styles\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api()\n  path = \"/resources/recitation_styles\"\n  uri = URI(API_BASE_URL + path)\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\ndata = call_api()\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Recitation Styles\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync()\n{\n    var path = $@\"/resources/recitation_styles\";\n    var url = API_BASE_URL + path;\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar data = await CallApiAsync();\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Recitation Styles\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi() {\n  $path = \"/resources/recitation_styles\";\n  $url = API_BASE_URL . $path;\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$data = callApi();\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Recitation Styles\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi() throws IOException {\n    String path = \"/resources/recitation_styles\";\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    String data = callApi();\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Recitation Styles\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api() {\n  $path = \"/resources/recitation_styles\"\n  $url = \"$API_BASE_URL$path\"\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$data = Call-Api()\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Recitation Styles\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/resources/recitation_styles' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to recitation styles using the Quran Foundation API.\n\nEndpoint: GET /resources/recitation_styles\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/resources/recitation_styles\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/resources/languages": {
      "get": {
        "tags": ["Resources"],
        "summary": "Languages",
        "description": "Get all languages. You can get translated names of languages in specific language using `language` query parameter. For example \n\n  ```\n  /resources/languages?language=ur\n  ```\n  \nwill return language names translated into Urdu",
        "operationId": "languages",
        "parameters": [
          {
            "name": "language",
            "in": "query",
            "description": "ISO language code to return language names in that language when available; defaults to English otherwise.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["languages"],
                  "properties": {
                    "languages": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/language"
                      }
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "languages": [
                        {
                          "id": 38,
                          "name": "English",
                          "native_name": "English",
                          "iso_code": "en",
                          "direction": "ltr",
                          "translations_count": 100,
                          "translated_name": {
                            "name": "English",
                            "language_name": "english"
                          }
                        }
                      ]
                    }
                  },
                  "supported_languages": {
                    "summary": "Supported content languages",
                    "value": {
                      "languages": [
                        {
                          "id": 38,
                          "name": "English",
                          "iso_code": "en",
                          "native_name": "English",
                          "direction": "ltr"
                        },
                        {
                          "id": 174,
                          "name": "Arabic",
                          "iso_code": "ar",
                          "native_name": "Arabic",
                          "direction": "rtl"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Languages\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(options = {}) {\n  const response = await axios.get(\n    `${API_BASE_URL}/resources/languages`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      },\n      params: options\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi({\"language\":\"en\"})\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Languages\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(language=None):\n    params = {k: v for k, v in {'language': language}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/resources/languages',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(language=\"en\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Languages\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(params map[string]string) (string, error) {\n  path := \"/resources/languages\"\n  endpoint := API_BASE_URL + path\n  if params != nil && len(params) > 0 {\n    values := url.Values{}\n    for k, v := range params {\n      values.Set(k, v)\n    }\n    endpoint = endpoint + \"?\" + values.Encode()\n  }\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  params := map[string]string{\"language\": \"en\"}\n  data, err := callApi(params)\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Languages\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(params = {})\n  path = \"/resources/languages\"\n  uri = URI(API_BASE_URL + path)\n  uri.query = URI.encode_www_form(params) if params && !params.empty?\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\nparams = { \"language\" => \"en\" }\ndata = call_api(params)\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Languages\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(Dictionary<string, string> query = null)\n{\n    var path = $@\"/resources/languages\";\n    var url = API_BASE_URL + path;\n    if (query != null && query.Count > 0)\n    {\n        var queryString = string.Join(\"&\", query.Select(kvp =>\n            $\"{Uri.EscapeDataString(kvp.Key)}={Uri.EscapeDataString(kvp.Value)}\"));\n        url = $\"{url}?{queryString}\";\n    }\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar query = new Dictionary<string, string> { {\"language\", \"en\"} };\nvar data = await CallApiAsync(query);\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Languages\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($params = []) {\n  $path = \"/resources/languages\";\n  $url = API_BASE_URL . $path;\n  if (!empty($params)) {\n    $url .= '?' . http_build_query($params);\n  }\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$params = ['language' => 'en'];\n$data = callApi($params);\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Languages\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(Map<String, String> params) throws IOException {\n    String path = \"/resources/languages\";\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    if (params != null) {\n      for (Map.Entry<String, String> entry : params.entrySet()) {\n        urlBuilder.addQueryParameter(entry.getKey(), entry.getValue());\n      }\n    }\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    Map<String, String> params = new HashMap<>();\n    params.put(\"language\", \"en\");\n    String data = callApi(params);\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Languages\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([hashtable]$params = @{}) {\n  $path = \"/resources/languages\"\n  $url = \"$API_BASE_URL$path\"\n  if ($params.Count -gt 0) {\n    $query = ($params.GetEnumerator() | ForEach-Object {\n      \"$($_.Key)=$([System.Uri]::EscapeDataString([string]$_.Value))\"\n    }) -join \"&\"\n    $url = \"$url?$query\"\n  }\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$params = @{ language = \"en\" }\n$data = Call-Api($params)\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Languages\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/resources/languages?language=en' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to languages using the Quran Foundation API.\n\nEndpoint: GET /resources/languages\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nOptional Query Parameters:\n  language: ISO language code to return language names in that language when available; defaults to English otherwise.\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/resources/languages?{queryParams}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/resources/chapter_infos": {
      "get": {
        "tags": ["Resources"],
        "summary": "Chapter Infos",
        "description": "Get the global catalog of chapter info resources in different languages. This endpoint lists resource definitions and is not filtered by chapter, so some returned ids may not have chapter-info content for a specific surah.",
        "operationId": "chapter-info",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "chapter_infos": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "name": {
                            "type": "string"
                          },
                          "author_name": {
                            "type": "string"
                          },
                          "language_name": {
                            "type": "string"
                          },
                          "translated_name": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "language_name": {
                                "type": "string"
                              }
                            }
                          },
                          "slug": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "chapter_infos": [
                        {
                          "id": 155,
                          "name": "Hamza Roberto Piccardo",
                          "author_name": "Hamza Roberto Piccardo",
                          "slug": "hamza-roberto-piccardo-info",
                          "language_name": "italian",
                          "translated_name": {
                            "name": "Hamza Roberto Piccardo",
                            "language_name": "english"
                          }
                        },
                        {
                          "id": 63,
                          "name": "Chapter Info",
                          "author_name": "Sayyid Abul Ala Maududi",
                          "slug": null,
                          "language_name": "malayalam",
                          "translated_name": {
                            "name": "Chapter Info",
                            "language_name": "english"
                          }
                        },
                        {
                          "id": 62,
                          "name": "Chapter Info",
                          "author_name": "Sayyid Abul Ala Maududi",
                          "slug": null,
                          "language_name": "tamil",
                          "translated_name": {
                            "name": "Chapter Info",
                            "language_name": "english"
                          }
                        },
                        {
                          "id": 61,
                          "name": "Chapter Info",
                          "author_name": "Sayyid Abul Ala Maududi",
                          "slug": null,
                          "language_name": "urdu",
                          "translated_name": {
                            "name": "Chapter Info",
                            "language_name": "english"
                          }
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Chapter Infos\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi() {\n  const response = await axios.get(\n    `${API_BASE_URL}/resources/chapter_infos`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      }\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi()\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Chapter Infos\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api():\n    params = {k: v for k, v in {}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/resources/chapter_infos',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api()\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Chapter Infos\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi() (string, error) {\n  path := \"/resources/chapter_infos\"\n  endpoint := API_BASE_URL + path\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  data, err := callApi()\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Chapter Infos\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api()\n  path = \"/resources/chapter_infos\"\n  uri = URI(API_BASE_URL + path)\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\ndata = call_api()\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Chapter Infos\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync()\n{\n    var path = $@\"/resources/chapter_infos\";\n    var url = API_BASE_URL + path;\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar data = await CallApiAsync();\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Chapter Infos\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi() {\n  $path = \"/resources/chapter_infos\";\n  $url = API_BASE_URL . $path;\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$data = callApi();\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Chapter Infos\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi() throws IOException {\n    String path = \"/resources/chapter_infos\";\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    String data = callApi();\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Chapter Infos\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api() {\n  $path = \"/resources/chapter_infos\"\n  $url = \"$API_BASE_URL$path\"\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$data = Call-Api()\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Chapter Infos\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/resources/chapter_infos' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to chapter infos using the Quran Foundation API.\n\nEndpoint: GET /resources/chapter_infos\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/resources/chapter_infos\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/resources/verse_media": {
      "get": {
        "tags": ["Resources"],
        "summary": "Verse Media",
        "description": "Get media related to the verse.",
        "operationId": "verse-media",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["verse_media"],
                  "properties": {
                    "verse_media": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "name",
                          "author_name",
                          "slug",
                          "language_name",
                          "translated_name"
                        ],
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "name": {
                            "type": "string"
                          },
                          "author_name": {
                            "type": "string"
                          },
                          "slug": {
                            "type": "string"
                          },
                          "language_name": {
                            "type": "string"
                          },
                          "translated_name": {
                            "type": "object",
                            "required": ["name", "language_name"],
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "language_name": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "verse_media": [
                        {
                          "id": 12,
                          "name": "Quranic Audio Lessons",
                          "author_name": "Quran Foundation",
                          "slug": "quranic-audio-lessons",
                          "language_name": "english",
                          "translated_name": {
                            "name": "Quranic Audio Lessons",
                            "language_name": "english"
                          }
                        }
                      ]
                    }
                  },
                  "verse_media_catalog": {
                    "summary": "Verse media resource catalog",
                    "value": {
                      "verse_media": [
                        {
                          "id": 1,
                          "name": "Verse images",
                          "author_name": "Quran.Foundation",
                          "slug": "verse-images",
                          "language_name": "english",
                          "translated_name": {
                            "name": "Verse images",
                            "language_name": "english"
                          }
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Verse Media\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi() {\n  const response = await axios.get(\n    `${API_BASE_URL}/resources/verse_media`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      }\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi()\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Verse Media\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api():\n    params = {k: v for k, v in {}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/resources/verse_media',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api()\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Verse Media\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi() (string, error) {\n  path := \"/resources/verse_media\"\n  endpoint := API_BASE_URL + path\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  data, err := callApi()\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Verse Media\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api()\n  path = \"/resources/verse_media\"\n  uri = URI(API_BASE_URL + path)\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\ndata = call_api()\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Verse Media\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync()\n{\n    var path = $@\"/resources/verse_media\";\n    var url = API_BASE_URL + path;\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar data = await CallApiAsync();\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Verse Media\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi() {\n  $path = \"/resources/verse_media\";\n  $url = API_BASE_URL . $path;\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$data = callApi();\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Verse Media\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi() throws IOException {\n    String path = \"/resources/verse_media\";\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    String data = callApi();\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Verse Media\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api() {\n  $path = \"/resources/verse_media\"\n  $url = \"$API_BASE_URL$path\"\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$data = Call-Api()\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Verse Media\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/resources/verse_media' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to verse media using the Quran Foundation API.\n\nEndpoint: GET /resources/verse_media\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/resources/verse_media\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/recitations/{recitation_id}/by_manzil/{manzil_number}": {
      "get": {
        "tags": ["Audio"],
        "summary": "Get Ayah recitations for specific Manzil",
        "description": "Get list of ayah recitations for a Manzil.",
        "operationId": "list-manzil-recitation",
        "parameters": [
          {
            "name": "recitation_id",
            "in": "path",
            "description": "Ayah-by-ayah recitation ID from [/resources/recitations](/docs/content_apis_versioned/recitations). Do not use chapter-reciter IDs from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters) here.",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "manzil_number",
            "in": "path",
            "required": true,
            "schema": {
              "maximum": 7,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated list of extra audio file fields to include. Supported values: chapter_id, verse_number, verse_key, juz_number, hizb_number, rub_el_hizb_number, page_number, ruku_number, manzil_number, format, url, segments, duration, id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "For paginating within the result",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "records per api call, you can get maximum 50 records.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "required": ["audio_files", "pagination"],
                  "type": "object",
                  "properties": {
                    "audio_files": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/audiofile"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/pagination"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "audio_files": [
                        {
                          "verse_key": "1:1",
                          "url": "AbdulBaset/Mujawwad/mp3/001001.mp3"
                        }
                      ],
                      "pagination": {
                        "per_page": 10,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 15,
                        "total_records": 148
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get Ayah recitations for specific Manzil\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(recitation_id, manzil_number) {\n  const response = await axios.get(\n    `${API_BASE_URL}/recitations/${recitation_id}/by_manzil/${manzil_number}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      }\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(1, \"1\")\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get Ayah recitations for specific Manzil\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(recitation_id, manzil_number):\n    params = {k: v for k, v in {}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/recitations/{recitation_id}/by_manzil/{manzil_number}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(1, \"1\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get Ayah recitations for specific Manzil\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(recitation_id string, manzil_number string) (string, error) {\n  path := fmt.Sprintf(\"/recitations/%s/by_manzil/%s\", recitation_id, manzil_number)\n  endpoint := API_BASE_URL + path\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  data, err := callApi(1, \"1\")\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get Ayah recitations for specific Manzil\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(recitation_id, manzil_number)\n  path = \"/recitations/#{recitation_id}/by_manzil/#{manzil_number}\"\n  uri = URI(API_BASE_URL + path)\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\ndata = call_api(1, \"1\")\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get Ayah recitations for specific Manzil\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string recitation_id, string manzil_number)\n{\n    var path = $@\"/recitations/{recitation_id}/by_manzil/{manzil_number}\";\n    var url = API_BASE_URL + path;\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar data = await CallApiAsync(1, \"1\");\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get Ayah recitations for specific Manzil\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($recitation_id, $manzil_number) {\n  $path = sprintf(\"/recitations/%s/by_manzil/%s\", $recitation_id, $manzil_number);\n  $url = API_BASE_URL . $path;\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$data = callApi(1, \"1\");\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get Ayah recitations for specific Manzil\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String recitation_id, String manzil_number) throws IOException {\n    String path = String.format(\"/recitations/%s/by_manzil/%s\", recitation_id, manzil_number);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    String data = callApi(1, \"1\");\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get Ayah recitations for specific Manzil\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$recitation_id, [string]$manzil_number) {\n  $path = \"/recitations/$recitation_id/by_manzil/$manzil_number\"\n  $url = \"$API_BASE_URL$path\"\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$data = Call-Api(1, \"1\")\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get Ayah recitations for specific Manzil\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/recitations/1/by_manzil/1' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get ayah recitations for specific manzil using the Quran Foundation API.\n\nEndpoint: GET /recitations/{recitation_id}/by_manzil/{manzil_number}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  recitation_id: Ayah-by-ayah recitation ID from [/resources/recitations](/docs/content_apis_versioned/recitations). Do not use chapter-reciter IDs from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters) here. (e.g., \"1\")\n  manzil_number: Required parameter (e.g., \"1\")\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/recitations/{recitation_id}/by_manzil/{manzil_number}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts recitation_id, manzil_number and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/recitations/{recitation_id}/by_ruku/{ruku_number}": {
      "get": {
        "tags": ["Audio"],
        "summary": "Get Ayah recitations for specific Ruku",
        "description": "Get list of ayah recitations for a Ruku.",
        "operationId": "list-ruku-recitation",
        "parameters": [
          {
            "name": "recitation_id",
            "in": "path",
            "description": "Ayah-by-ayah recitation ID from [/resources/recitations](/docs/content_apis_versioned/recitations). Do not use chapter-reciter IDs from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters) here.",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "ruku_number",
            "in": "path",
            "required": true,
            "schema": {
              "maximum": 558,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated list of extra audio file fields to include. Supported values: chapter_id, verse_number, verse_key, juz_number, hizb_number, rub_el_hizb_number, page_number, ruku_number, manzil_number, format, url, segments, duration, id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "For paginating within the result",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "records per api call, you can get maximum 50 records.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "required": ["audio_files", "pagination"],
                  "type": "object",
                  "properties": {
                    "audio_files": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/audiofile"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/pagination"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "audio_files": [
                        {
                          "verse_key": "1:1",
                          "url": "AbdulBaset/Mujawwad/mp3/001001.mp3"
                        }
                      ],
                      "pagination": {
                        "per_page": 10,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 15,
                        "total_records": 148
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get Ayah recitations for specific Ruku\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(recitation_id, ruku_number) {\n  const response = await axios.get(\n    `${API_BASE_URL}/recitations/${recitation_id}/by_ruku/${ruku_number}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      }\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(1, \"1\")\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get Ayah recitations for specific Ruku\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(recitation_id, ruku_number):\n    params = {k: v for k, v in {}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/recitations/{recitation_id}/by_ruku/{ruku_number}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(1, \"1\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get Ayah recitations for specific Ruku\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(recitation_id string, ruku_number string) (string, error) {\n  path := fmt.Sprintf(\"/recitations/%s/by_ruku/%s\", recitation_id, ruku_number)\n  endpoint := API_BASE_URL + path\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  data, err := callApi(1, \"1\")\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get Ayah recitations for specific Ruku\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(recitation_id, ruku_number)\n  path = \"/recitations/#{recitation_id}/by_ruku/#{ruku_number}\"\n  uri = URI(API_BASE_URL + path)\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\ndata = call_api(1, \"1\")\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get Ayah recitations for specific Ruku\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string recitation_id, string ruku_number)\n{\n    var path = $@\"/recitations/{recitation_id}/by_ruku/{ruku_number}\";\n    var url = API_BASE_URL + path;\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar data = await CallApiAsync(1, \"1\");\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get Ayah recitations for specific Ruku\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($recitation_id, $ruku_number) {\n  $path = sprintf(\"/recitations/%s/by_ruku/%s\", $recitation_id, $ruku_number);\n  $url = API_BASE_URL . $path;\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$data = callApi(1, \"1\");\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get Ayah recitations for specific Ruku\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String recitation_id, String ruku_number) throws IOException {\n    String path = String.format(\"/recitations/%s/by_ruku/%s\", recitation_id, ruku_number);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    String data = callApi(1, \"1\");\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get Ayah recitations for specific Ruku\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$recitation_id, [string]$ruku_number) {\n  $path = \"/recitations/$recitation_id/by_ruku/$ruku_number\"\n  $url = \"$API_BASE_URL$path\"\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$data = Call-Api(1, \"1\")\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get Ayah recitations for specific Ruku\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/recitations/1/by_ruku/1' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get ayah recitations for specific ruku using the Quran Foundation API.\n\nEndpoint: GET /recitations/{recitation_id}/by_ruku/{ruku_number}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  recitation_id: Ayah-by-ayah recitation ID from [/resources/recitations](/docs/content_apis_versioned/recitations). Do not use chapter-reciter IDs from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters) here. (e.g., \"1\")\n  ruku_number: Required parameter (e.g., \"1\")\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/recitations/{recitation_id}/by_ruku/{ruku_number}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts recitation_id, ruku_number and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/translations/{resource_id}/by_chapter/{chapter_number}": {
      "get": {
        "tags": ["Translations"],
        "summary": "Get translations for specific Surah",
        "description": "Get list of translations for a specific Surah.",
        "operationId": "list-surah-translations",
        "parameters": [
          {
            "name": "resource_id",
            "in": "path",
            "description": "Translation resource ID, you can get list of all available translations using the [/resources/translations](/docs/content_apis_versioned/translations) endpoint",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "chapter_number",
            "in": "path",
            "required": true,
            "schema": {
              "maximum": 114,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated list of extra translation fields to include. Supported values: chapter_id, verse_number, verse_key, juz_number, hizb_number, rub_el_hizb_number, page_number, ruku_number, manzil_number, resource_name, language_name, language_id, id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "For paginating within the result",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "records per api call, you can get maximum 50 records.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "translations": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/translation"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/pagination"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "translations": [
                        {
                          "resource_id": 131,
                          "text": "In the Name of Allah—the Most Compassionate, Most Merciful.",
                          "verse_key": "1:1"
                        }
                      ],
                      "pagination": {
                        "per_page": 10,
                        "current_page": 1,
                        "next_page": null,
                        "total_pages": 1,
                        "total_records": 1
                      }
                    }
                  },
                  "paginated_translation_rows": {
                    "summary": "Paginated translation rows",
                    "value": {
                      "translations": [
                        {
                          "resource_id": 131,
                          "resource_name": "Dr. Mustafa Khattab, the Clear Quran",
                          "id": 903958,
                          "text": "In the Name of Allah?the Most Compassionate, Most Merciful.",
                          "verse_id": 1,
                          "language_id": 38,
                          "language_name": "english",
                          "verse_key": "1:1",
                          "chapter_id": 1,
                          "verse_number": 1,
                          "juz_number": 1,
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "page_number": 1,
                          "ruku_number": 1,
                          "manzil_number": 1,
                          "foot_notes": {
                            "1": "Some editions include a translator footnote here."
                          }
                        }
                      ],
                      "pagination": {
                        "per_page": 1,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 7,
                        "total_records": 7
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get translations for specific Surah\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(resource_id, chapter_number) {\n  const response = await axios.get(\n    `${API_BASE_URL}/translations/${resource_id}/by_chapter/${chapter_number}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      }\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(1, \"1\")\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get translations for specific Surah\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(resource_id, chapter_number):\n    params = {k: v for k, v in {}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/translations/{resource_id}/by_chapter/{chapter_number}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(1, \"1\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get translations for specific Surah\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(resource_id string, chapter_number string) (string, error) {\n  path := fmt.Sprintf(\"/translations/%s/by_chapter/%s\", resource_id, chapter_number)\n  endpoint := API_BASE_URL + path\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  data, err := callApi(1, \"1\")\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get translations for specific Surah\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(resource_id, chapter_number)\n  path = \"/translations/#{resource_id}/by_chapter/#{chapter_number}\"\n  uri = URI(API_BASE_URL + path)\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\ndata = call_api(1, \"1\")\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get translations for specific Surah\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string resource_id, string chapter_number)\n{\n    var path = $@\"/translations/{resource_id}/by_chapter/{chapter_number}\";\n    var url = API_BASE_URL + path;\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar data = await CallApiAsync(1, \"1\");\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get translations for specific Surah\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($resource_id, $chapter_number) {\n  $path = sprintf(\"/translations/%s/by_chapter/%s\", $resource_id, $chapter_number);\n  $url = API_BASE_URL . $path;\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$data = callApi(1, \"1\");\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get translations for specific Surah\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String resource_id, String chapter_number) throws IOException {\n    String path = String.format(\"/translations/%s/by_chapter/%s\", resource_id, chapter_number);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    String data = callApi(1, \"1\");\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get translations for specific Surah\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$resource_id, [string]$chapter_number) {\n  $path = \"/translations/$resource_id/by_chapter/$chapter_number\"\n  $url = \"$API_BASE_URL$path\"\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$data = Call-Api(1, \"1\")\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get translations for specific Surah\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/translations/1/by_chapter/1' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get translations for specific surah using the Quran Foundation API.\n\nEndpoint: GET /translations/{resource_id}/by_chapter/{chapter_number}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  resource_id: Translation resource ID, you can get list of all available translations using the [/resources/translations](/docs/content_apis_versioned/translations) endpoint (e.g., \"1\")\n  chapter_number: Required parameter (e.g., \"1\")\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/translations/{resource_id}/by_chapter/{chapter_number}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts resource_id, chapter_number and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/translations/{resource_id}/by_page/{page_number}": {
      "get": {
        "tags": ["Translations"],
        "summary": "Get translations for specific Madani Mushaf page",
        "description": "Get list of translations for a specific Madani Mushaf page.",
        "operationId": "list-page-translations",
        "parameters": [
          {
            "name": "resource_id",
            "in": "path",
            "description": "Translation resource ID",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page_number",
            "in": "path",
            "required": true,
            "schema": {
              "maximum": 604,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated list of extra translation fields to include. Supported values: chapter_id, verse_number, verse_key, juz_number, hizb_number, rub_el_hizb_number, page_number, ruku_number, manzil_number, resource_name, language_name, language_id, id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "For paginating within the result",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "records per api call, you can get maximum 50 records.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "translations": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/translation"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/pagination"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "translations": [
                        {
                          "id": 215001,
                          "resource_id": 20,
                          "text": "In the Name of Allah-the Most Compassionate, Most Merciful."
                        },
                        {
                          "id": 215002,
                          "resource_id": 20,
                          "text": "All praise is for Allah, Lord of all worlds."
                        }
                      ],
                      "pagination": {
                        "per_page": 50,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 12,
                        "total_records": 600
                      }
                    }
                  },
                  "paginated_translation_rows": {
                    "summary": "Paginated translation rows",
                    "value": {
                      "translations": [
                        {
                          "resource_id": 131,
                          "resource_name": "Dr. Mustafa Khattab, the Clear Quran",
                          "id": 903958,
                          "text": "In the Name of Allah?the Most Compassionate, Most Merciful.",
                          "verse_id": 1,
                          "language_id": 38,
                          "language_name": "english",
                          "verse_key": "1:1",
                          "chapter_id": 1,
                          "verse_number": 1,
                          "juz_number": 1,
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "page_number": 1,
                          "ruku_number": 1,
                          "manzil_number": 1,
                          "foot_notes": {
                            "1": "Some editions include a translator footnote here."
                          }
                        }
                      ],
                      "pagination": {
                        "per_page": 1,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 7,
                        "total_records": 7
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get translations for specific Madani Mushaf page\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(resource_id, page_number) {\n  const response = await axios.get(\n    `${API_BASE_URL}/translations/${resource_id}/by_page/${page_number}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      }\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(1, \"1\")\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get translations for specific Madani Mushaf page\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(resource_id, page_number):\n    params = {k: v for k, v in {}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/translations/{resource_id}/by_page/{page_number}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(1, \"1\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get translations for specific Madani Mushaf page\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(resource_id string, page_number string) (string, error) {\n  path := fmt.Sprintf(\"/translations/%s/by_page/%s\", resource_id, page_number)\n  endpoint := API_BASE_URL + path\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  data, err := callApi(1, \"1\")\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get translations for specific Madani Mushaf page\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(resource_id, page_number)\n  path = \"/translations/#{resource_id}/by_page/#{page_number}\"\n  uri = URI(API_BASE_URL + path)\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\ndata = call_api(1, \"1\")\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get translations for specific Madani Mushaf page\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string resource_id, string page_number)\n{\n    var path = $@\"/translations/{resource_id}/by_page/{page_number}\";\n    var url = API_BASE_URL + path;\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar data = await CallApiAsync(1, \"1\");\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get translations for specific Madani Mushaf page\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($resource_id, $page_number) {\n  $path = sprintf(\"/translations/%s/by_page/%s\", $resource_id, $page_number);\n  $url = API_BASE_URL . $path;\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$data = callApi(1, \"1\");\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get translations for specific Madani Mushaf page\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String resource_id, String page_number) throws IOException {\n    String path = String.format(\"/translations/%s/by_page/%s\", resource_id, page_number);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    String data = callApi(1, \"1\");\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get translations for specific Madani Mushaf page\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$resource_id, [string]$page_number) {\n  $path = \"/translations/$resource_id/by_page/$page_number\"\n  $url = \"$API_BASE_URL$path\"\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$data = Call-Api(1, \"1\")\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get translations for specific Madani Mushaf page\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/translations/1/by_page/1' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get translations for specific madani mushaf page using the Quran Foundation API.\n\nEndpoint: GET /translations/{resource_id}/by_page/{page_number}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  resource_id: Translation resource ID (e.g., \"1\")\n  page_number: Required parameter (e.g., \"1\")\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/translations/{resource_id}/by_page/{page_number}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts resource_id, page_number and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/translations/{resource_id}/by_juz/{juz_number}": {
      "get": {
        "tags": ["Translations"],
        "summary": "Get translations for specific Juz",
        "description": "Get list of translations for a specific Juz.",
        "operationId": "list-juz-translations",
        "parameters": [
          {
            "name": "resource_id",
            "in": "path",
            "description": "Translation resource ID",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "juz_number",
            "in": "path",
            "required": true,
            "schema": {
              "maximum": 30,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated list of extra translation fields to include. Supported values: chapter_id, verse_number, verse_key, juz_number, hizb_number, rub_el_hizb_number, page_number, ruku_number, manzil_number, resource_name, language_name, language_id, id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "For paginating within the result",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "records per api call, you can get maximum 50 records.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "translations": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/translation"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/pagination"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "translations": [
                        {
                          "id": 215101,
                          "resource_id": 20,
                          "text": "In the Name of Allah-the Most Compassionate, Most Merciful."
                        },
                        {
                          "id": 215102,
                          "resource_id": 20,
                          "text": "All praise is for Allah, Lord of all worlds."
                        }
                      ],
                      "pagination": {
                        "per_page": 50,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 12,
                        "total_records": 600
                      }
                    }
                  },
                  "paginated_translation_rows": {
                    "summary": "Paginated translation rows",
                    "value": {
                      "translations": [
                        {
                          "resource_id": 131,
                          "resource_name": "Dr. Mustafa Khattab, the Clear Quran",
                          "id": 903958,
                          "text": "In the Name of Allah?the Most Compassionate, Most Merciful.",
                          "verse_id": 1,
                          "language_id": 38,
                          "language_name": "english",
                          "verse_key": "1:1",
                          "chapter_id": 1,
                          "verse_number": 1,
                          "juz_number": 1,
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "page_number": 1,
                          "ruku_number": 1,
                          "manzil_number": 1,
                          "foot_notes": {
                            "1": "Some editions include a translator footnote here."
                          }
                        }
                      ],
                      "pagination": {
                        "per_page": 1,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 7,
                        "total_records": 7
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get translations for specific Juz\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(resource_id, juz_number) {\n  const response = await axios.get(\n    `${API_BASE_URL}/translations/${resource_id}/by_juz/${juz_number}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      }\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(1, \"1\")\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get translations for specific Juz\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(resource_id, juz_number):\n    params = {k: v for k, v in {}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/translations/{resource_id}/by_juz/{juz_number}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(1, \"1\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get translations for specific Juz\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(resource_id string, juz_number string) (string, error) {\n  path := fmt.Sprintf(\"/translations/%s/by_juz/%s\", resource_id, juz_number)\n  endpoint := API_BASE_URL + path\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  data, err := callApi(1, \"1\")\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get translations for specific Juz\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(resource_id, juz_number)\n  path = \"/translations/#{resource_id}/by_juz/#{juz_number}\"\n  uri = URI(API_BASE_URL + path)\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\ndata = call_api(1, \"1\")\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get translations for specific Juz\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string resource_id, string juz_number)\n{\n    var path = $@\"/translations/{resource_id}/by_juz/{juz_number}\";\n    var url = API_BASE_URL + path;\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar data = await CallApiAsync(1, \"1\");\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get translations for specific Juz\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($resource_id, $juz_number) {\n  $path = sprintf(\"/translations/%s/by_juz/%s\", $resource_id, $juz_number);\n  $url = API_BASE_URL . $path;\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$data = callApi(1, \"1\");\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get translations for specific Juz\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String resource_id, String juz_number) throws IOException {\n    String path = String.format(\"/translations/%s/by_juz/%s\", resource_id, juz_number);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    String data = callApi(1, \"1\");\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get translations for specific Juz\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$resource_id, [string]$juz_number) {\n  $path = \"/translations/$resource_id/by_juz/$juz_number\"\n  $url = \"$API_BASE_URL$path\"\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$data = Call-Api(1, \"1\")\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get translations for specific Juz\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/translations/1/by_juz/1' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get translations for specific juz using the Quran Foundation API.\n\nEndpoint: GET /translations/{resource_id}/by_juz/{juz_number}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  resource_id: Translation resource ID (e.g., \"1\")\n  juz_number: Required parameter (e.g., \"1\")\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/translations/{resource_id}/by_juz/{juz_number}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts resource_id, juz_number and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/translations/{resource_id}/by_rub_el_hizb/{rub_el_hizb_number}": {
      "get": {
        "tags": ["Translations"],
        "summary": "Get translations for specific Rub el Hizb",
        "description": "Get list of translations for a specific Rub el Hizb.",
        "operationId": "list-rub-el-hizb-translations",
        "parameters": [
          {
            "name": "resource_id",
            "in": "path",
            "description": "Translation resource ID",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "rub_el_hizb_number",
            "in": "path",
            "required": true,
            "schema": {
              "maximum": 240,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated list of extra translation fields to include. Supported values: chapter_id, verse_number, verse_key, juz_number, hizb_number, rub_el_hizb_number, page_number, ruku_number, manzil_number, resource_name, language_name, language_id, id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "For paginating within the result",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "records per api call, you can get maximum 50 records.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "translations": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/translation"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/pagination"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "translations": [
                        {
                          "id": 215201,
                          "resource_id": 20,
                          "text": "In the Name of Allah-the Most Compassionate, Most Merciful."
                        },
                        {
                          "id": 215202,
                          "resource_id": 20,
                          "text": "All praise is for Allah, Lord of all worlds."
                        }
                      ],
                      "pagination": {
                        "per_page": 50,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 12,
                        "total_records": 600
                      }
                    }
                  },
                  "paginated_translation_rows": {
                    "summary": "Paginated translation rows",
                    "value": {
                      "translations": [
                        {
                          "resource_id": 131,
                          "resource_name": "Dr. Mustafa Khattab, the Clear Quran",
                          "id": 903958,
                          "text": "In the Name of Allah?the Most Compassionate, Most Merciful.",
                          "verse_id": 1,
                          "language_id": 38,
                          "language_name": "english",
                          "verse_key": "1:1",
                          "chapter_id": 1,
                          "verse_number": 1,
                          "juz_number": 1,
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "page_number": 1,
                          "ruku_number": 1,
                          "manzil_number": 1,
                          "foot_notes": {
                            "1": "Some editions include a translator footnote here."
                          }
                        }
                      ],
                      "pagination": {
                        "per_page": 1,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 7,
                        "total_records": 7
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get translations for specific Rub el Hizb\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(resource_id, rub_el_hizb_number) {\n  const response = await axios.get(\n    `${API_BASE_URL}/translations/${resource_id}/by_rub_el_hizb/${rub_el_hizb_number}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      }\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(1, \"1\")\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get translations for specific Rub el Hizb\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(resource_id, rub_el_hizb_number):\n    params = {k: v for k, v in {}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/translations/{resource_id}/by_rub_el_hizb/{rub_el_hizb_number}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(1, \"1\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get translations for specific Rub el Hizb\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(resource_id string, rub_el_hizb_number string) (string, error) {\n  path := fmt.Sprintf(\"/translations/%s/by_rub_el_hizb/%s\", resource_id, rub_el_hizb_number)\n  endpoint := API_BASE_URL + path\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  data, err := callApi(1, \"1\")\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get translations for specific Rub el Hizb\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(resource_id, rub_el_hizb_number)\n  path = \"/translations/#{resource_id}/by_rub_el_hizb/#{rub_el_hizb_number}\"\n  uri = URI(API_BASE_URL + path)\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\ndata = call_api(1, \"1\")\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get translations for specific Rub el Hizb\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string resource_id, string rub_el_hizb_number)\n{\n    var path = $@\"/translations/{resource_id}/by_rub_el_hizb/{rub_el_hizb_number}\";\n    var url = API_BASE_URL + path;\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar data = await CallApiAsync(1, \"1\");\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get translations for specific Rub el Hizb\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($resource_id, $rub_el_hizb_number) {\n  $path = sprintf(\"/translations/%s/by_rub_el_hizb/%s\", $resource_id, $rub_el_hizb_number);\n  $url = API_BASE_URL . $path;\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$data = callApi(1, \"1\");\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get translations for specific Rub el Hizb\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String resource_id, String rub_el_hizb_number) throws IOException {\n    String path = String.format(\"/translations/%s/by_rub_el_hizb/%s\", resource_id, rub_el_hizb_number);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    String data = callApi(1, \"1\");\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get translations for specific Rub el Hizb\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$resource_id, [string]$rub_el_hizb_number) {\n  $path = \"/translations/$resource_id/by_rub_el_hizb/$rub_el_hizb_number\"\n  $url = \"$API_BASE_URL$path\"\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$data = Call-Api(1, \"1\")\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get translations for specific Rub el Hizb\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/translations/1/by_rub_el_hizb/1' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get translations for specific rub el hizb using the Quran Foundation API.\n\nEndpoint: GET /translations/{resource_id}/by_rub_el_hizb/{rub_el_hizb_number}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  resource_id: Translation resource ID (e.g., \"1\")\n  rub_el_hizb_number: Required parameter (e.g., \"1\")\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/translations/{resource_id}/by_rub_el_hizb/{rub_el_hizb_number}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts resource_id, rub_el_hizb_number and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/translations/{resource_id}/by_hizb/{hizb_number}": {
      "get": {
        "tags": ["Translations"],
        "summary": "Get translations for specific Hizb",
        "description": "Get list of translations for a specific Hizb.",
        "operationId": "list-hizb-translations",
        "parameters": [
          {
            "name": "resource_id",
            "in": "path",
            "description": "Translation resource ID",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "hizb_number",
            "in": "path",
            "required": true,
            "schema": {
              "maximum": 60,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated list of extra translation fields to include. Supported values: chapter_id, verse_number, verse_key, juz_number, hizb_number, rub_el_hizb_number, page_number, ruku_number, manzil_number, resource_name, language_name, language_id, id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "For paginating within the result",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "records per api call, you can get maximum 50 records.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "translations": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/translation"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/pagination"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "translations": [
                        {
                          "id": 215301,
                          "resource_id": 20,
                          "text": "In the Name of Allah-the Most Compassionate, Most Merciful."
                        },
                        {
                          "id": 215302,
                          "resource_id": 20,
                          "text": "All praise is for Allah, Lord of all worlds."
                        }
                      ],
                      "pagination": {
                        "per_page": 50,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 12,
                        "total_records": 600
                      }
                    }
                  },
                  "paginated_translation_rows": {
                    "summary": "Paginated translation rows",
                    "value": {
                      "translations": [
                        {
                          "resource_id": 131,
                          "resource_name": "Dr. Mustafa Khattab, the Clear Quran",
                          "id": 903958,
                          "text": "In the Name of Allah?the Most Compassionate, Most Merciful.",
                          "verse_id": 1,
                          "language_id": 38,
                          "language_name": "english",
                          "verse_key": "1:1",
                          "chapter_id": 1,
                          "verse_number": 1,
                          "juz_number": 1,
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "page_number": 1,
                          "ruku_number": 1,
                          "manzil_number": 1,
                          "foot_notes": {
                            "1": "Some editions include a translator footnote here."
                          }
                        }
                      ],
                      "pagination": {
                        "per_page": 1,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 7,
                        "total_records": 7
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get translations for specific Hizb\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(resource_id, hizb_number) {\n  const response = await axios.get(\n    `${API_BASE_URL}/translations/${resource_id}/by_hizb/${hizb_number}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      }\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(1, \"1\")\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get translations for specific Hizb\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(resource_id, hizb_number):\n    params = {k: v for k, v in {}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/translations/{resource_id}/by_hizb/{hizb_number}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(1, \"1\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get translations for specific Hizb\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(resource_id string, hizb_number string) (string, error) {\n  path := fmt.Sprintf(\"/translations/%s/by_hizb/%s\", resource_id, hizb_number)\n  endpoint := API_BASE_URL + path\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  data, err := callApi(1, \"1\")\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get translations for specific Hizb\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(resource_id, hizb_number)\n  path = \"/translations/#{resource_id}/by_hizb/#{hizb_number}\"\n  uri = URI(API_BASE_URL + path)\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\ndata = call_api(1, \"1\")\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get translations for specific Hizb\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string resource_id, string hizb_number)\n{\n    var path = $@\"/translations/{resource_id}/by_hizb/{hizb_number}\";\n    var url = API_BASE_URL + path;\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar data = await CallApiAsync(1, \"1\");\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get translations for specific Hizb\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($resource_id, $hizb_number) {\n  $path = sprintf(\"/translations/%s/by_hizb/%s\", $resource_id, $hizb_number);\n  $url = API_BASE_URL . $path;\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$data = callApi(1, \"1\");\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get translations for specific Hizb\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String resource_id, String hizb_number) throws IOException {\n    String path = String.format(\"/translations/%s/by_hizb/%s\", resource_id, hizb_number);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    String data = callApi(1, \"1\");\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get translations for specific Hizb\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$resource_id, [string]$hizb_number) {\n  $path = \"/translations/$resource_id/by_hizb/$hizb_number\"\n  $url = \"$API_BASE_URL$path\"\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$data = Call-Api(1, \"1\")\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get translations for specific Hizb\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/translations/1/by_hizb/1' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get translations for specific hizb using the Quran Foundation API.\n\nEndpoint: GET /translations/{resource_id}/by_hizb/{hizb_number}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  resource_id: Translation resource ID (e.g., \"1\")\n  hizb_number: Required parameter (e.g., \"1\")\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/translations/{resource_id}/by_hizb/{hizb_number}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts resource_id, hizb_number and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/translations/{resource_id}/by_manzil/{manzil_number}": {
      "get": {
        "tags": ["Translations"],
        "summary": "Get translations for specific Manzil",
        "description": "Get list of translations for a specific Manzil.",
        "operationId": "list-manzil-translations",
        "parameters": [
          {
            "name": "resource_id",
            "in": "path",
            "description": "Translation resource ID",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "manzil_number",
            "in": "path",
            "required": true,
            "schema": {
              "maximum": 7,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated list of extra translation fields to include. Supported values: chapter_id, verse_number, verse_key, juz_number, hizb_number, rub_el_hizb_number, page_number, ruku_number, manzil_number, resource_name, language_name, language_id, id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "For paginating within the result",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "records per api call, you can get maximum 50 records.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "translations": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/translation"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/pagination"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "translations": [
                        {
                          "id": 215401,
                          "resource_id": 20,
                          "text": "In the Name of Allah-the Most Compassionate, Most Merciful."
                        },
                        {
                          "id": 215402,
                          "resource_id": 20,
                          "text": "All praise is for Allah, Lord of all worlds."
                        }
                      ],
                      "pagination": {
                        "per_page": 50,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 12,
                        "total_records": 600
                      }
                    }
                  },
                  "paginated_translation_rows": {
                    "summary": "Paginated translation rows",
                    "value": {
                      "translations": [
                        {
                          "resource_id": 131,
                          "resource_name": "Dr. Mustafa Khattab, the Clear Quran",
                          "id": 903958,
                          "text": "In the Name of Allah?the Most Compassionate, Most Merciful.",
                          "verse_id": 1,
                          "language_id": 38,
                          "language_name": "english",
                          "verse_key": "1:1",
                          "chapter_id": 1,
                          "verse_number": 1,
                          "juz_number": 1,
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "page_number": 1,
                          "ruku_number": 1,
                          "manzil_number": 1,
                          "foot_notes": {
                            "1": "Some editions include a translator footnote here."
                          }
                        }
                      ],
                      "pagination": {
                        "per_page": 1,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 7,
                        "total_records": 7
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get translations for specific Manzil\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(resource_id, manzil_number) {\n  const response = await axios.get(\n    `${API_BASE_URL}/translations/${resource_id}/by_manzil/${manzil_number}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      }\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(1, \"1\")\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get translations for specific Manzil\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(resource_id, manzil_number):\n    params = {k: v for k, v in {}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/translations/{resource_id}/by_manzil/{manzil_number}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(1, \"1\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get translations for specific Manzil\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(resource_id string, manzil_number string) (string, error) {\n  path := fmt.Sprintf(\"/translations/%s/by_manzil/%s\", resource_id, manzil_number)\n  endpoint := API_BASE_URL + path\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  data, err := callApi(1, \"1\")\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get translations for specific Manzil\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(resource_id, manzil_number)\n  path = \"/translations/#{resource_id}/by_manzil/#{manzil_number}\"\n  uri = URI(API_BASE_URL + path)\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\ndata = call_api(1, \"1\")\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get translations for specific Manzil\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string resource_id, string manzil_number)\n{\n    var path = $@\"/translations/{resource_id}/by_manzil/{manzil_number}\";\n    var url = API_BASE_URL + path;\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar data = await CallApiAsync(1, \"1\");\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get translations for specific Manzil\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($resource_id, $manzil_number) {\n  $path = sprintf(\"/translations/%s/by_manzil/%s\", $resource_id, $manzil_number);\n  $url = API_BASE_URL . $path;\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$data = callApi(1, \"1\");\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get translations for specific Manzil\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String resource_id, String manzil_number) throws IOException {\n    String path = String.format(\"/translations/%s/by_manzil/%s\", resource_id, manzil_number);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    String data = callApi(1, \"1\");\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get translations for specific Manzil\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$resource_id, [string]$manzil_number) {\n  $path = \"/translations/$resource_id/by_manzil/$manzil_number\"\n  $url = \"$API_BASE_URL$path\"\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$data = Call-Api(1, \"1\")\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get translations for specific Manzil\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/translations/1/by_manzil/1' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get translations for specific manzil using the Quran Foundation API.\n\nEndpoint: GET /translations/{resource_id}/by_manzil/{manzil_number}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  resource_id: Translation resource ID (e.g., \"1\")\n  manzil_number: Required parameter (e.g., \"1\")\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/translations/{resource_id}/by_manzil/{manzil_number}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts resource_id, manzil_number and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/translations/{resource_id}/by_ruku/{ruku_number}": {
      "get": {
        "tags": ["Translations"],
        "summary": "Get translations for specific Ruku",
        "description": "Get list of translations for a specific Ruku.",
        "operationId": "list-ruku-translations",
        "parameters": [
          {
            "name": "resource_id",
            "in": "path",
            "description": "Translation resource ID",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "ruku_number",
            "in": "path",
            "required": true,
            "schema": {
              "maximum": 558,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated list of extra translation fields to include. Supported values: chapter_id, verse_number, verse_key, juz_number, hizb_number, rub_el_hizb_number, page_number, ruku_number, manzil_number, resource_name, language_name, language_id, id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "For paginating within the result",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "records per api call, you can get maximum 50 records.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "translations": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/translation"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/pagination"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "translations": [
                        {
                          "id": 215501,
                          "resource_id": 20,
                          "text": "In the Name of Allah-the Most Compassionate, Most Merciful."
                        },
                        {
                          "id": 215502,
                          "resource_id": 20,
                          "text": "All praise is for Allah, Lord of all worlds."
                        }
                      ],
                      "pagination": {
                        "per_page": 50,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 12,
                        "total_records": 600
                      }
                    }
                  },
                  "paginated_translation_rows": {
                    "summary": "Paginated translation rows",
                    "value": {
                      "translations": [
                        {
                          "resource_id": 131,
                          "resource_name": "Dr. Mustafa Khattab, the Clear Quran",
                          "id": 903958,
                          "text": "In the Name of Allah?the Most Compassionate, Most Merciful.",
                          "verse_id": 1,
                          "language_id": 38,
                          "language_name": "english",
                          "verse_key": "1:1",
                          "chapter_id": 1,
                          "verse_number": 1,
                          "juz_number": 1,
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "page_number": 1,
                          "ruku_number": 1,
                          "manzil_number": 1,
                          "foot_notes": {
                            "1": "Some editions include a translator footnote here."
                          }
                        }
                      ],
                      "pagination": {
                        "per_page": 1,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 7,
                        "total_records": 7
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get translations for specific Ruku\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(resource_id, ruku_number) {\n  const response = await axios.get(\n    `${API_BASE_URL}/translations/${resource_id}/by_ruku/${ruku_number}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      }\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(1, \"1\")\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get translations for specific Ruku\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(resource_id, ruku_number):\n    params = {k: v for k, v in {}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/translations/{resource_id}/by_ruku/{ruku_number}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(1, \"1\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get translations for specific Ruku\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(resource_id string, ruku_number string) (string, error) {\n  path := fmt.Sprintf(\"/translations/%s/by_ruku/%s\", resource_id, ruku_number)\n  endpoint := API_BASE_URL + path\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  data, err := callApi(1, \"1\")\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get translations for specific Ruku\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(resource_id, ruku_number)\n  path = \"/translations/#{resource_id}/by_ruku/#{ruku_number}\"\n  uri = URI(API_BASE_URL + path)\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\ndata = call_api(1, \"1\")\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get translations for specific Ruku\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string resource_id, string ruku_number)\n{\n    var path = $@\"/translations/{resource_id}/by_ruku/{ruku_number}\";\n    var url = API_BASE_URL + path;\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar data = await CallApiAsync(1, \"1\");\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get translations for specific Ruku\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($resource_id, $ruku_number) {\n  $path = sprintf(\"/translations/%s/by_ruku/%s\", $resource_id, $ruku_number);\n  $url = API_BASE_URL . $path;\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$data = callApi(1, \"1\");\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get translations for specific Ruku\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String resource_id, String ruku_number) throws IOException {\n    String path = String.format(\"/translations/%s/by_ruku/%s\", resource_id, ruku_number);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    String data = callApi(1, \"1\");\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get translations for specific Ruku\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$resource_id, [string]$ruku_number) {\n  $path = \"/translations/$resource_id/by_ruku/$ruku_number\"\n  $url = \"$API_BASE_URL$path\"\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$data = Call-Api(1, \"1\")\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get translations for specific Ruku\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/translations/1/by_ruku/1' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get translations for specific ruku using the Quran Foundation API.\n\nEndpoint: GET /translations/{resource_id}/by_ruku/{ruku_number}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  resource_id: Translation resource ID (e.g., \"1\")\n  ruku_number: Required parameter (e.g., \"1\")\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/translations/{resource_id}/by_ruku/{ruku_number}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts resource_id, ruku_number and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/translations/{resource_id}/by_ayah/{ayah_key}": {
      "get": {
        "tags": ["Translations"],
        "summary": "Get translations for specific Ayah",
        "description": "Get list of translations for a specific Ayah.",
        "operationId": "list-ayah-translations",
        "parameters": [
          {
            "name": "resource_id",
            "in": "path",
            "description": "Translation resource ID",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "ayah_key",
            "in": "path",
            "description": "Ayah key is combination of surah number and ayah number. e.g 1:1 will be first Ayah of first Surah",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated list of extra translation fields to include. Supported values: chapter_id, verse_number, verse_key, juz_number, hizb_number, rub_el_hizb_number, page_number, ruku_number, manzil_number, resource_name, language_name, language_id, id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "For paginating within the result",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "records per api call, you can get maximum 50 records.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "translations": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/translation"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/pagination"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "translations": [
                        {
                          "id": 215601,
                          "resource_id": 20,
                          "text": "In the Name of Allah-the Most Compassionate, Most Merciful."
                        }
                      ],
                      "pagination": {
                        "per_page": 10,
                        "current_page": 1,
                        "next_page": null,
                        "total_pages": 1,
                        "total_records": 1
                      }
                    }
                  },
                  "single_ayah_translation": {
                    "summary": "Translation rows for one ayah",
                    "value": {
                      "translations": [
                        {
                          "resource_id": 131,
                          "resource_name": "Dr. Mustafa Khattab, the Clear Quran",
                          "id": 904212,
                          "text": "Allah! There is no god except Him, the Ever-Living, All-Sustaining.",
                          "verse_id": 255,
                          "language_id": 38,
                          "language_name": "english",
                          "verse_key": "2:255",
                          "chapter_id": 2,
                          "verse_number": 255,
                          "juz_number": 3,
                          "hizb_number": 5,
                          "rub_el_hizb_number": 19,
                          "page_number": 42,
                          "ruku_number": 35,
                          "manzil_number": 1
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get translations for specific Ayah\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(resource_id, ayah_key) {\n  const response = await axios.get(\n    `${API_BASE_URL}/translations/${resource_id}/by_ayah/${ayah_key}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      }\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(1, \"value\")\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get translations for specific Ayah\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(resource_id, ayah_key):\n    params = {k: v for k, v in {}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/translations/{resource_id}/by_ayah/{ayah_key}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(1, \"value\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get translations for specific Ayah\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(resource_id string, ayah_key string) (string, error) {\n  path := fmt.Sprintf(\"/translations/%s/by_ayah/%s\", resource_id, ayah_key)\n  endpoint := API_BASE_URL + path\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  data, err := callApi(1, \"value\")\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get translations for specific Ayah\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(resource_id, ayah_key)\n  path = \"/translations/#{resource_id}/by_ayah/#{ayah_key}\"\n  uri = URI(API_BASE_URL + path)\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\ndata = call_api(1, \"value\")\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get translations for specific Ayah\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string resource_id, string ayah_key)\n{\n    var path = $@\"/translations/{resource_id}/by_ayah/{ayah_key}\";\n    var url = API_BASE_URL + path;\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar data = await CallApiAsync(1, \"value\");\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get translations for specific Ayah\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($resource_id, $ayah_key) {\n  $path = sprintf(\"/translations/%s/by_ayah/%s\", $resource_id, $ayah_key);\n  $url = API_BASE_URL . $path;\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$data = callApi(1, \"value\");\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get translations for specific Ayah\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String resource_id, String ayah_key) throws IOException {\n    String path = String.format(\"/translations/%s/by_ayah/%s\", resource_id, ayah_key);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    String data = callApi(1, \"value\");\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get translations for specific Ayah\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$resource_id, [string]$ayah_key) {\n  $path = \"/translations/$resource_id/by_ayah/$ayah_key\"\n  $url = \"$API_BASE_URL$path\"\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$data = Call-Api(1, \"value\")\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get translations for specific Ayah\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/translations/1/by_ayah/value' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get translations for specific ayah using the Quran Foundation API.\n\nEndpoint: GET /translations/{resource_id}/by_ayah/{ayah_key}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  resource_id: Translation resource ID (e.g., \"1\")\n  ayah_key: Ayah key is combination of surah number and ayah number. e.g 1:1 will be first Ayah of first Surah (e.g., \"value\")\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/translations/{resource_id}/by_ayah/{ayah_key}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts resource_id, ayah_key and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/tafsirs/{resource_id}/by_chapter/{chapter_number}": {
      "get": {
        "tags": ["Tafsirs"],
        "summary": "Get tafsirs for specific Surah",
        "description": "Get list of tafsirs for a specific Surah.",
        "operationId": "list-surah-tafsirs",
        "parameters": [
          {
            "name": "resource_id",
            "in": "path",
            "description": "Tafsir resource ID, you can get list of all available tafsirs using the [/resources/tafsirs](/docs/content_apis_versioned/tafsirs) endpoint",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "chapter_number",
            "in": "path",
            "required": true,
            "schema": {
              "maximum": 114,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated list of extra tafsir fields to include. Supported values: chapter_id, verse_number, verse_key, juz_number, hizb_number, rub_el_hizb_number, page_number, ruku_number, manzil_number, resource_name, language_name, language_id, id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "For paginating within the result",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "records per api call, you can get maximum 50 records.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tafsirs": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/tafsir"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/pagination"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "tafsirs": [
                        {
                          "resource_id": 169,
                          "text": "Bismillah بِسْمِ اللَّـهِ is a verse of the Holy Qur'an",
                          "verse_key": "1:1"
                        }
                      ],
                      "pagination": {
                        "per_page": 10,
                        "current_page": 1,
                        "next_page": null,
                        "total_pages": 1,
                        "total_records": 1
                      }
                    }
                  },
                  "paginated_tafsir_rows": {
                    "summary": "Paginated tafsir rows",
                    "value": {
                      "tafsirs": [
                        {
                          "id": 82641,
                          "resource_id": 169,
                          "verse_id": 1,
                          "language_id": 38,
                          "text": "<p>Bismillah is a verse of the Holy Qur'an.</p>",
                          "language_name": "english",
                          "resource_name": "Tafsir Ibn Kathir",
                          "verse_key": "1:1",
                          "chapter_id": 1,
                          "verse_number": 1,
                          "juz_number": 1,
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "page_number": 1,
                          "ruku_number": 1,
                          "manzil_number": 1,
                          "slug": "tafsir-ibn-kathir"
                        }
                      ],
                      "pagination": {
                        "per_page": 1,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 7,
                        "total_records": 7
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get tafsirs for specific Surah\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(resource_id, chapter_number) {\n  const response = await axios.get(\n    `${API_BASE_URL}/tafsirs/${resource_id}/by_chapter/${chapter_number}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      }\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(1, \"1\")\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get tafsirs for specific Surah\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(resource_id, chapter_number):\n    params = {k: v for k, v in {}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/tafsirs/{resource_id}/by_chapter/{chapter_number}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(1, \"1\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get tafsirs for specific Surah\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(resource_id string, chapter_number string) (string, error) {\n  path := fmt.Sprintf(\"/tafsirs/%s/by_chapter/%s\", resource_id, chapter_number)\n  endpoint := API_BASE_URL + path\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  data, err := callApi(1, \"1\")\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get tafsirs for specific Surah\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(resource_id, chapter_number)\n  path = \"/tafsirs/#{resource_id}/by_chapter/#{chapter_number}\"\n  uri = URI(API_BASE_URL + path)\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\ndata = call_api(1, \"1\")\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get tafsirs for specific Surah\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string resource_id, string chapter_number)\n{\n    var path = $@\"/tafsirs/{resource_id}/by_chapter/{chapter_number}\";\n    var url = API_BASE_URL + path;\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar data = await CallApiAsync(1, \"1\");\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get tafsirs for specific Surah\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($resource_id, $chapter_number) {\n  $path = sprintf(\"/tafsirs/%s/by_chapter/%s\", $resource_id, $chapter_number);\n  $url = API_BASE_URL . $path;\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$data = callApi(1, \"1\");\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get tafsirs for specific Surah\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String resource_id, String chapter_number) throws IOException {\n    String path = String.format(\"/tafsirs/%s/by_chapter/%s\", resource_id, chapter_number);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    String data = callApi(1, \"1\");\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get tafsirs for specific Surah\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$resource_id, [string]$chapter_number) {\n  $path = \"/tafsirs/$resource_id/by_chapter/$chapter_number\"\n  $url = \"$API_BASE_URL$path\"\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$data = Call-Api(1, \"1\")\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get tafsirs for specific Surah\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/tafsirs/1/by_chapter/1' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get tafsirs for specific surah using the Quran Foundation API.\n\nEndpoint: GET /tafsirs/{resource_id}/by_chapter/{chapter_number}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  resource_id: Tafsir resource ID, you can get list of all available tafsirs using the [/resources/tafsirs](/docs/content_apis_versioned/tafsirs) endpoint (e.g., \"1\")\n  chapter_number: Required parameter (e.g., \"1\")\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/tafsirs/{resource_id}/by_chapter/{chapter_number}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts resource_id, chapter_number and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/tafsirs/{resource_id}/by_page/{page_number}": {
      "get": {
        "tags": ["Tafsirs"],
        "summary": "Get tafsirs for specific Madani Mushaf page",
        "description": "Get list of tafsirs for a specific Madani Mushaf page.",
        "operationId": "list-page-tafsirs",
        "parameters": [
          {
            "name": "resource_id",
            "in": "path",
            "description": "Tafsir resource ID",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page_number",
            "in": "path",
            "required": true,
            "schema": {
              "maximum": 604,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated list of extra tafsir fields to include. Supported values: chapter_id, verse_number, verse_key, juz_number, hizb_number, rub_el_hizb_number, page_number, ruku_number, manzil_number, resource_name, language_name, language_id, id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "For paginating within the result",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "records per api call, you can get maximum 50 records.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tafsirs": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/tafsir"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/pagination"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "tafsirs": [
                        {
                          "id": 82641,
                          "resource_id": 169,
                          "verse_key": "1:1",
                          "language_id": 38,
                          "text": "<h2 class=\"title\">Which was revealed in Makkah</h2><h2 class=\"title\">The Meaning of Al-Fatihah and its Various Names</h2>",
                          "slug": "tafsir-ibn-kathir"
                        }
                      ],
                      "pagination": {
                        "per_page": 50,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 12,
                        "total_records": 600
                      }
                    }
                  },
                  "paginated_tafsir_rows": {
                    "summary": "Paginated tafsir rows",
                    "value": {
                      "tafsirs": [
                        {
                          "id": 82641,
                          "resource_id": 169,
                          "verse_id": 1,
                          "language_id": 38,
                          "text": "<p>Bismillah is a verse of the Holy Qur'an.</p>",
                          "language_name": "english",
                          "resource_name": "Tafsir Ibn Kathir",
                          "verse_key": "1:1",
                          "chapter_id": 1,
                          "verse_number": 1,
                          "juz_number": 1,
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "page_number": 1,
                          "ruku_number": 1,
                          "manzil_number": 1,
                          "slug": "tafsir-ibn-kathir"
                        }
                      ],
                      "pagination": {
                        "per_page": 1,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 7,
                        "total_records": 7
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get tafsirs for specific Madani Mushaf page\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(resource_id, page_number) {\n  const response = await axios.get(\n    `${API_BASE_URL}/tafsirs/${resource_id}/by_page/${page_number}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      }\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(1, \"1\")\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get tafsirs for specific Madani Mushaf page\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(resource_id, page_number):\n    params = {k: v for k, v in {}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/tafsirs/{resource_id}/by_page/{page_number}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(1, \"1\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get tafsirs for specific Madani Mushaf page\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(resource_id string, page_number string) (string, error) {\n  path := fmt.Sprintf(\"/tafsirs/%s/by_page/%s\", resource_id, page_number)\n  endpoint := API_BASE_URL + path\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  data, err := callApi(1, \"1\")\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get tafsirs for specific Madani Mushaf page\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(resource_id, page_number)\n  path = \"/tafsirs/#{resource_id}/by_page/#{page_number}\"\n  uri = URI(API_BASE_URL + path)\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\ndata = call_api(1, \"1\")\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get tafsirs for specific Madani Mushaf page\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string resource_id, string page_number)\n{\n    var path = $@\"/tafsirs/{resource_id}/by_page/{page_number}\";\n    var url = API_BASE_URL + path;\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar data = await CallApiAsync(1, \"1\");\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get tafsirs for specific Madani Mushaf page\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($resource_id, $page_number) {\n  $path = sprintf(\"/tafsirs/%s/by_page/%s\", $resource_id, $page_number);\n  $url = API_BASE_URL . $path;\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$data = callApi(1, \"1\");\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get tafsirs for specific Madani Mushaf page\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String resource_id, String page_number) throws IOException {\n    String path = String.format(\"/tafsirs/%s/by_page/%s\", resource_id, page_number);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    String data = callApi(1, \"1\");\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get tafsirs for specific Madani Mushaf page\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$resource_id, [string]$page_number) {\n  $path = \"/tafsirs/$resource_id/by_page/$page_number\"\n  $url = \"$API_BASE_URL$path\"\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$data = Call-Api(1, \"1\")\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get tafsirs for specific Madani Mushaf page\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/tafsirs/1/by_page/1' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get tafsirs for specific madani mushaf page using the Quran Foundation API.\n\nEndpoint: GET /tafsirs/{resource_id}/by_page/{page_number}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  resource_id: Tafsir resource ID (e.g., \"1\")\n  page_number: Required parameter (e.g., \"1\")\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/tafsirs/{resource_id}/by_page/{page_number}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts resource_id, page_number and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/tafsirs/{resource_id}/by_juz/{juz_number}": {
      "get": {
        "tags": ["Tafsirs"],
        "summary": "Get tafsirs for specific Juz",
        "description": "Get list of tafsirs for a specific Juz.",
        "operationId": "list-juz-tafsirs",
        "parameters": [
          {
            "name": "resource_id",
            "in": "path",
            "description": "Tafsir resource ID",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "juz_number",
            "in": "path",
            "required": true,
            "schema": {
              "maximum": 30,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated list of extra tafsir fields to include. Supported values: chapter_id, verse_number, verse_key, juz_number, hizb_number, rub_el_hizb_number, page_number, ruku_number, manzil_number, resource_name, language_name, language_id, id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "For paginating within the result",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "records per api call, you can get maximum 50 records.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tafsirs": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/tafsir"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/pagination"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "tafsirs": [
                        {
                          "id": 82641,
                          "resource_id": 169,
                          "verse_key": "1:1",
                          "language_id": 38,
                          "text": "<h2 class=\"title\">Which was revealed in Makkah</h2><h2 class=\"title\">The Meaning of Al-Fatihah and its Various Names</h2>",
                          "slug": "tafsir-ibn-kathir"
                        }
                      ],
                      "pagination": {
                        "per_page": 50,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 12,
                        "total_records": 600
                      }
                    }
                  },
                  "paginated_tafsir_rows": {
                    "summary": "Paginated tafsir rows",
                    "value": {
                      "tafsirs": [
                        {
                          "id": 82641,
                          "resource_id": 169,
                          "verse_id": 1,
                          "language_id": 38,
                          "text": "<p>Bismillah is a verse of the Holy Qur'an.</p>",
                          "language_name": "english",
                          "resource_name": "Tafsir Ibn Kathir",
                          "verse_key": "1:1",
                          "chapter_id": 1,
                          "verse_number": 1,
                          "juz_number": 1,
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "page_number": 1,
                          "ruku_number": 1,
                          "manzil_number": 1,
                          "slug": "tafsir-ibn-kathir"
                        }
                      ],
                      "pagination": {
                        "per_page": 1,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 7,
                        "total_records": 7
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get tafsirs for specific Juz\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(resource_id, juz_number) {\n  const response = await axios.get(\n    `${API_BASE_URL}/tafsirs/${resource_id}/by_juz/${juz_number}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      }\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(1, \"1\")\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get tafsirs for specific Juz\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(resource_id, juz_number):\n    params = {k: v for k, v in {}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/tafsirs/{resource_id}/by_juz/{juz_number}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(1, \"1\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get tafsirs for specific Juz\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(resource_id string, juz_number string) (string, error) {\n  path := fmt.Sprintf(\"/tafsirs/%s/by_juz/%s\", resource_id, juz_number)\n  endpoint := API_BASE_URL + path\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  data, err := callApi(1, \"1\")\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get tafsirs for specific Juz\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(resource_id, juz_number)\n  path = \"/tafsirs/#{resource_id}/by_juz/#{juz_number}\"\n  uri = URI(API_BASE_URL + path)\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\ndata = call_api(1, \"1\")\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get tafsirs for specific Juz\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string resource_id, string juz_number)\n{\n    var path = $@\"/tafsirs/{resource_id}/by_juz/{juz_number}\";\n    var url = API_BASE_URL + path;\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar data = await CallApiAsync(1, \"1\");\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get tafsirs for specific Juz\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($resource_id, $juz_number) {\n  $path = sprintf(\"/tafsirs/%s/by_juz/%s\", $resource_id, $juz_number);\n  $url = API_BASE_URL . $path;\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$data = callApi(1, \"1\");\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get tafsirs for specific Juz\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String resource_id, String juz_number) throws IOException {\n    String path = String.format(\"/tafsirs/%s/by_juz/%s\", resource_id, juz_number);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    String data = callApi(1, \"1\");\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get tafsirs for specific Juz\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$resource_id, [string]$juz_number) {\n  $path = \"/tafsirs/$resource_id/by_juz/$juz_number\"\n  $url = \"$API_BASE_URL$path\"\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$data = Call-Api(1, \"1\")\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get tafsirs for specific Juz\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/tafsirs/1/by_juz/1' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get tafsirs for specific juz using the Quran Foundation API.\n\nEndpoint: GET /tafsirs/{resource_id}/by_juz/{juz_number}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  resource_id: Tafsir resource ID (e.g., \"1\")\n  juz_number: Required parameter (e.g., \"1\")\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/tafsirs/{resource_id}/by_juz/{juz_number}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts resource_id, juz_number and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/tafsirs/{resource_id}/by_rub_el_hizb/{rub_el_hizb_number}": {
      "get": {
        "tags": ["Tafsirs"],
        "summary": "Get tafsirs for specific Rub el Hizb",
        "description": "Get list of tafsirs for a specific Rub el Hizb.",
        "operationId": "list-rub-el-hizb-tafsirs",
        "parameters": [
          {
            "name": "resource_id",
            "in": "path",
            "description": "Tafsir resource ID",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "rub_el_hizb_number",
            "in": "path",
            "required": true,
            "schema": {
              "maximum": 240,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated list of extra tafsir fields to include. Supported values: chapter_id, verse_number, verse_key, juz_number, hizb_number, rub_el_hizb_number, page_number, ruku_number, manzil_number, resource_name, language_name, language_id, id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "For paginating within the result",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "records per api call, you can get maximum 50 records.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tafsirs": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/tafsir"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/pagination"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "tafsirs": [
                        {
                          "id": 82641,
                          "resource_id": 169,
                          "verse_key": "1:1",
                          "language_id": 38,
                          "text": "<h2 class=\"title\">Which was revealed in Makkah</h2><h2 class=\"title\">The Meaning of Al-Fatihah and its Various Names</h2>",
                          "slug": "tafsir-ibn-kathir"
                        }
                      ],
                      "pagination": {
                        "per_page": 50,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 12,
                        "total_records": 600
                      }
                    }
                  },
                  "paginated_tafsir_rows": {
                    "summary": "Paginated tafsir rows",
                    "value": {
                      "tafsirs": [
                        {
                          "id": 82641,
                          "resource_id": 169,
                          "verse_id": 1,
                          "language_id": 38,
                          "text": "<p>Bismillah is a verse of the Holy Qur'an.</p>",
                          "language_name": "english",
                          "resource_name": "Tafsir Ibn Kathir",
                          "verse_key": "1:1",
                          "chapter_id": 1,
                          "verse_number": 1,
                          "juz_number": 1,
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "page_number": 1,
                          "ruku_number": 1,
                          "manzil_number": 1,
                          "slug": "tafsir-ibn-kathir"
                        }
                      ],
                      "pagination": {
                        "per_page": 1,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 7,
                        "total_records": 7
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get tafsirs for specific Rub el Hizb\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(resource_id, rub_el_hizb_number) {\n  const response = await axios.get(\n    `${API_BASE_URL}/tafsirs/${resource_id}/by_rub_el_hizb/${rub_el_hizb_number}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      }\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(1, \"1\")\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get tafsirs for specific Rub el Hizb\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(resource_id, rub_el_hizb_number):\n    params = {k: v for k, v in {}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/tafsirs/{resource_id}/by_rub_el_hizb/{rub_el_hizb_number}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(1, \"1\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get tafsirs for specific Rub el Hizb\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(resource_id string, rub_el_hizb_number string) (string, error) {\n  path := fmt.Sprintf(\"/tafsirs/%s/by_rub_el_hizb/%s\", resource_id, rub_el_hizb_number)\n  endpoint := API_BASE_URL + path\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  data, err := callApi(1, \"1\")\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get tafsirs for specific Rub el Hizb\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(resource_id, rub_el_hizb_number)\n  path = \"/tafsirs/#{resource_id}/by_rub_el_hizb/#{rub_el_hizb_number}\"\n  uri = URI(API_BASE_URL + path)\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\ndata = call_api(1, \"1\")\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get tafsirs for specific Rub el Hizb\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string resource_id, string rub_el_hizb_number)\n{\n    var path = $@\"/tafsirs/{resource_id}/by_rub_el_hizb/{rub_el_hizb_number}\";\n    var url = API_BASE_URL + path;\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar data = await CallApiAsync(1, \"1\");\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get tafsirs for specific Rub el Hizb\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($resource_id, $rub_el_hizb_number) {\n  $path = sprintf(\"/tafsirs/%s/by_rub_el_hizb/%s\", $resource_id, $rub_el_hizb_number);\n  $url = API_BASE_URL . $path;\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$data = callApi(1, \"1\");\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get tafsirs for specific Rub el Hizb\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String resource_id, String rub_el_hizb_number) throws IOException {\n    String path = String.format(\"/tafsirs/%s/by_rub_el_hizb/%s\", resource_id, rub_el_hizb_number);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    String data = callApi(1, \"1\");\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get tafsirs for specific Rub el Hizb\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$resource_id, [string]$rub_el_hizb_number) {\n  $path = \"/tafsirs/$resource_id/by_rub_el_hizb/$rub_el_hizb_number\"\n  $url = \"$API_BASE_URL$path\"\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$data = Call-Api(1, \"1\")\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get tafsirs for specific Rub el Hizb\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/tafsirs/1/by_rub_el_hizb/1' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get tafsirs for specific rub el hizb using the Quran Foundation API.\n\nEndpoint: GET /tafsirs/{resource_id}/by_rub_el_hizb/{rub_el_hizb_number}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  resource_id: Tafsir resource ID (e.g., \"1\")\n  rub_el_hizb_number: Required parameter (e.g., \"1\")\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/tafsirs/{resource_id}/by_rub_el_hizb/{rub_el_hizb_number}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts resource_id, rub_el_hizb_number and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/tafsirs/{resource_id}/by_hizb/{hizb_number}": {
      "get": {
        "tags": ["Tafsirs"],
        "summary": "Get tafsirs for specific Hizb",
        "description": "Get list of tafsirs for a specific Hizb.",
        "operationId": "list-hizb-tafsirs",
        "parameters": [
          {
            "name": "resource_id",
            "in": "path",
            "description": "Tafsir resource ID",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "hizb_number",
            "in": "path",
            "required": true,
            "schema": {
              "maximum": 60,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated list of extra tafsir fields to include. Supported values: chapter_id, verse_number, verse_key, juz_number, hizb_number, rub_el_hizb_number, page_number, ruku_number, manzil_number, resource_name, language_name, language_id, id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "For paginating within the result",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "records per api call, you can get maximum 50 records.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tafsirs": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/tafsir"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/pagination"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "tafsirs": [
                        {
                          "id": 82641,
                          "resource_id": 169,
                          "verse_key": "1:1",
                          "language_id": 38,
                          "text": "<h2 class=\"title\">Which was revealed in Makkah</h2><h2 class=\"title\">The Meaning of Al-Fatihah and its Various Names</h2>",
                          "slug": "tafsir-ibn-kathir"
                        }
                      ],
                      "pagination": {
                        "per_page": 50,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 12,
                        "total_records": 600
                      }
                    }
                  },
                  "paginated_tafsir_rows": {
                    "summary": "Paginated tafsir rows",
                    "value": {
                      "tafsirs": [
                        {
                          "id": 82641,
                          "resource_id": 169,
                          "verse_id": 1,
                          "language_id": 38,
                          "text": "<p>Bismillah is a verse of the Holy Qur'an.</p>",
                          "language_name": "english",
                          "resource_name": "Tafsir Ibn Kathir",
                          "verse_key": "1:1",
                          "chapter_id": 1,
                          "verse_number": 1,
                          "juz_number": 1,
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "page_number": 1,
                          "ruku_number": 1,
                          "manzil_number": 1,
                          "slug": "tafsir-ibn-kathir"
                        }
                      ],
                      "pagination": {
                        "per_page": 1,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 7,
                        "total_records": 7
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get tafsirs for specific Hizb\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(resource_id, hizb_number) {\n  const response = await axios.get(\n    `${API_BASE_URL}/tafsirs/${resource_id}/by_hizb/${hizb_number}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      }\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(1, \"1\")\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get tafsirs for specific Hizb\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(resource_id, hizb_number):\n    params = {k: v for k, v in {}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/tafsirs/{resource_id}/by_hizb/{hizb_number}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(1, \"1\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get tafsirs for specific Hizb\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(resource_id string, hizb_number string) (string, error) {\n  path := fmt.Sprintf(\"/tafsirs/%s/by_hizb/%s\", resource_id, hizb_number)\n  endpoint := API_BASE_URL + path\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  data, err := callApi(1, \"1\")\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get tafsirs for specific Hizb\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(resource_id, hizb_number)\n  path = \"/tafsirs/#{resource_id}/by_hizb/#{hizb_number}\"\n  uri = URI(API_BASE_URL + path)\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\ndata = call_api(1, \"1\")\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get tafsirs for specific Hizb\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string resource_id, string hizb_number)\n{\n    var path = $@\"/tafsirs/{resource_id}/by_hizb/{hizb_number}\";\n    var url = API_BASE_URL + path;\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar data = await CallApiAsync(1, \"1\");\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get tafsirs for specific Hizb\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($resource_id, $hizb_number) {\n  $path = sprintf(\"/tafsirs/%s/by_hizb/%s\", $resource_id, $hizb_number);\n  $url = API_BASE_URL . $path;\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$data = callApi(1, \"1\");\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get tafsirs for specific Hizb\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String resource_id, String hizb_number) throws IOException {\n    String path = String.format(\"/tafsirs/%s/by_hizb/%s\", resource_id, hizb_number);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    String data = callApi(1, \"1\");\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get tafsirs for specific Hizb\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$resource_id, [string]$hizb_number) {\n  $path = \"/tafsirs/$resource_id/by_hizb/$hizb_number\"\n  $url = \"$API_BASE_URL$path\"\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$data = Call-Api(1, \"1\")\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get tafsirs for specific Hizb\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/tafsirs/1/by_hizb/1' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get tafsirs for specific hizb using the Quran Foundation API.\n\nEndpoint: GET /tafsirs/{resource_id}/by_hizb/{hizb_number}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  resource_id: Tafsir resource ID (e.g., \"1\")\n  hizb_number: Required parameter (e.g., \"1\")\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/tafsirs/{resource_id}/by_hizb/{hizb_number}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts resource_id, hizb_number and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/tafsirs/{resource_id}/by_manzil/{manzil_number}": {
      "get": {
        "tags": ["Tafsirs"],
        "summary": "Get tafsirs for specific Manzil",
        "description": "Get list of tafsirs for a specific Manzil.",
        "operationId": "list-manzil-tafsirs",
        "parameters": [
          {
            "name": "resource_id",
            "in": "path",
            "description": "Tafsir resource ID",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "manzil_number",
            "in": "path",
            "required": true,
            "schema": {
              "maximum": 7,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated list of extra tafsir fields to include. Supported values: chapter_id, verse_number, verse_key, juz_number, hizb_number, rub_el_hizb_number, page_number, ruku_number, manzil_number, resource_name, language_name, language_id, id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "For paginating within the result",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "records per api call, you can get maximum 50 records.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tafsirs": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/tafsir"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/pagination"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "tafsirs": [
                        {
                          "id": 82641,
                          "resource_id": 169,
                          "verse_key": "1:1",
                          "language_id": 38,
                          "text": "<h2 class=\"title\">Which was revealed in Makkah</h2><h2 class=\"title\">The Meaning of Al-Fatihah and its Various Names</h2>",
                          "slug": "tafsir-ibn-kathir"
                        }
                      ],
                      "pagination": {
                        "per_page": 50,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 12,
                        "total_records": 600
                      }
                    }
                  },
                  "paginated_tafsir_rows": {
                    "summary": "Paginated tafsir rows",
                    "value": {
                      "tafsirs": [
                        {
                          "id": 82641,
                          "resource_id": 169,
                          "verse_id": 1,
                          "language_id": 38,
                          "text": "<p>Bismillah is a verse of the Holy Qur'an.</p>",
                          "language_name": "english",
                          "resource_name": "Tafsir Ibn Kathir",
                          "verse_key": "1:1",
                          "chapter_id": 1,
                          "verse_number": 1,
                          "juz_number": 1,
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "page_number": 1,
                          "ruku_number": 1,
                          "manzil_number": 1,
                          "slug": "tafsir-ibn-kathir"
                        }
                      ],
                      "pagination": {
                        "per_page": 1,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 7,
                        "total_records": 7
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get tafsirs for specific Manzil\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(resource_id, manzil_number) {\n  const response = await axios.get(\n    `${API_BASE_URL}/tafsirs/${resource_id}/by_manzil/${manzil_number}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      }\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(1, \"1\")\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get tafsirs for specific Manzil\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(resource_id, manzil_number):\n    params = {k: v for k, v in {}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/tafsirs/{resource_id}/by_manzil/{manzil_number}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(1, \"1\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get tafsirs for specific Manzil\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(resource_id string, manzil_number string) (string, error) {\n  path := fmt.Sprintf(\"/tafsirs/%s/by_manzil/%s\", resource_id, manzil_number)\n  endpoint := API_BASE_URL + path\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  data, err := callApi(1, \"1\")\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get tafsirs for specific Manzil\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(resource_id, manzil_number)\n  path = \"/tafsirs/#{resource_id}/by_manzil/#{manzil_number}\"\n  uri = URI(API_BASE_URL + path)\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\ndata = call_api(1, \"1\")\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get tafsirs for specific Manzil\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string resource_id, string manzil_number)\n{\n    var path = $@\"/tafsirs/{resource_id}/by_manzil/{manzil_number}\";\n    var url = API_BASE_URL + path;\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar data = await CallApiAsync(1, \"1\");\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get tafsirs for specific Manzil\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($resource_id, $manzil_number) {\n  $path = sprintf(\"/tafsirs/%s/by_manzil/%s\", $resource_id, $manzil_number);\n  $url = API_BASE_URL . $path;\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$data = callApi(1, \"1\");\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get tafsirs for specific Manzil\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String resource_id, String manzil_number) throws IOException {\n    String path = String.format(\"/tafsirs/%s/by_manzil/%s\", resource_id, manzil_number);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    String data = callApi(1, \"1\");\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get tafsirs for specific Manzil\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$resource_id, [string]$manzil_number) {\n  $path = \"/tafsirs/$resource_id/by_manzil/$manzil_number\"\n  $url = \"$API_BASE_URL$path\"\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$data = Call-Api(1, \"1\")\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get tafsirs for specific Manzil\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/tafsirs/1/by_manzil/1' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get tafsirs for specific manzil using the Quran Foundation API.\n\nEndpoint: GET /tafsirs/{resource_id}/by_manzil/{manzil_number}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  resource_id: Tafsir resource ID (e.g., \"1\")\n  manzil_number: Required parameter (e.g., \"1\")\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/tafsirs/{resource_id}/by_manzil/{manzil_number}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts resource_id, manzil_number and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/tafsirs/{resource_id}/by_ruku/{ruku_number}": {
      "get": {
        "tags": ["Tafsirs"],
        "summary": "Get tafsirs for specific Ruku",
        "description": "Get list of tafsirs for a specific Ruku.",
        "operationId": "list-ruku-tafsirs",
        "parameters": [
          {
            "name": "resource_id",
            "in": "path",
            "description": "Tafsir resource ID",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "ruku_number",
            "in": "path",
            "required": true,
            "schema": {
              "maximum": 558,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated list of extra tafsir fields to include. Supported values: chapter_id, verse_number, verse_key, juz_number, hizb_number, rub_el_hizb_number, page_number, ruku_number, manzil_number, resource_name, language_name, language_id, id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "For paginating within the result",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "records per api call, you can get maximum 50 records.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tafsirs": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/tafsir"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/pagination"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "tafsirs": [
                        {
                          "id": 82641,
                          "resource_id": 169,
                          "verse_key": "1:1",
                          "language_id": 38,
                          "text": "<h2 class=\"title\">Which was revealed in Makkah</h2><h2 class=\"title\">The Meaning of Al-Fatihah and its Various Names</h2>",
                          "slug": "tafsir-ibn-kathir"
                        }
                      ],
                      "pagination": {
                        "per_page": 50,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 12,
                        "total_records": 600
                      }
                    }
                  },
                  "paginated_tafsir_rows": {
                    "summary": "Paginated tafsir rows",
                    "value": {
                      "tafsirs": [
                        {
                          "id": 82641,
                          "resource_id": 169,
                          "verse_id": 1,
                          "language_id": 38,
                          "text": "<p>Bismillah is a verse of the Holy Qur'an.</p>",
                          "language_name": "english",
                          "resource_name": "Tafsir Ibn Kathir",
                          "verse_key": "1:1",
                          "chapter_id": 1,
                          "verse_number": 1,
                          "juz_number": 1,
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "page_number": 1,
                          "ruku_number": 1,
                          "manzil_number": 1,
                          "slug": "tafsir-ibn-kathir"
                        }
                      ],
                      "pagination": {
                        "per_page": 1,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 7,
                        "total_records": 7
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get tafsirs for specific Ruku\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(resource_id, ruku_number) {\n  const response = await axios.get(\n    `${API_BASE_URL}/tafsirs/${resource_id}/by_ruku/${ruku_number}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      }\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(1, \"1\")\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get tafsirs for specific Ruku\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(resource_id, ruku_number):\n    params = {k: v for k, v in {}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/tafsirs/{resource_id}/by_ruku/{ruku_number}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(1, \"1\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get tafsirs for specific Ruku\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(resource_id string, ruku_number string) (string, error) {\n  path := fmt.Sprintf(\"/tafsirs/%s/by_ruku/%s\", resource_id, ruku_number)\n  endpoint := API_BASE_URL + path\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  data, err := callApi(1, \"1\")\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get tafsirs for specific Ruku\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(resource_id, ruku_number)\n  path = \"/tafsirs/#{resource_id}/by_ruku/#{ruku_number}\"\n  uri = URI(API_BASE_URL + path)\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\ndata = call_api(1, \"1\")\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get tafsirs for specific Ruku\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string resource_id, string ruku_number)\n{\n    var path = $@\"/tafsirs/{resource_id}/by_ruku/{ruku_number}\";\n    var url = API_BASE_URL + path;\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar data = await CallApiAsync(1, \"1\");\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get tafsirs for specific Ruku\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($resource_id, $ruku_number) {\n  $path = sprintf(\"/tafsirs/%s/by_ruku/%s\", $resource_id, $ruku_number);\n  $url = API_BASE_URL . $path;\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$data = callApi(1, \"1\");\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get tafsirs for specific Ruku\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String resource_id, String ruku_number) throws IOException {\n    String path = String.format(\"/tafsirs/%s/by_ruku/%s\", resource_id, ruku_number);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    String data = callApi(1, \"1\");\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get tafsirs for specific Ruku\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$resource_id, [string]$ruku_number) {\n  $path = \"/tafsirs/$resource_id/by_ruku/$ruku_number\"\n  $url = \"$API_BASE_URL$path\"\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$data = Call-Api(1, \"1\")\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get tafsirs for specific Ruku\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/tafsirs/1/by_ruku/1' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get tafsirs for specific ruku using the Quran Foundation API.\n\nEndpoint: GET /tafsirs/{resource_id}/by_ruku/{ruku_number}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  resource_id: Tafsir resource ID (e.g., \"1\")\n  ruku_number: Required parameter (e.g., \"1\")\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/tafsirs/{resource_id}/by_ruku/{ruku_number}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts resource_id, ruku_number and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/tafsirs/{resource_id}/by_ayah/{ayah_key}": {
      "get": {
        "tags": ["Tafsirs"],
        "summary": "Get tafsirs for specific Ayah",
        "description": "Get list of tafsirs for a specific Ayah.",
        "operationId": "list-ayah-tafsirs",
        "parameters": [
          {
            "name": "resource_id",
            "in": "path",
            "description": "Tafsir resource ID",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "ayah_key",
            "in": "path",
            "description": "Ayah key is combination of surah number and ayah number. e.g 1:1 will be first Ayah of first Surah",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated list of extra tafsir fields to include. Supported values: chapter_id, verse_number, verse_key, juz_number, hizb_number, rub_el_hizb_number, page_number, ruku_number, manzil_number, resource_name, language_name, language_id, id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tafsir": {
                      "type": "object",
                      "required": [
                        "verses",
                        "resource_id",
                        "resource_name",
                        "language_id",
                        "slug",
                        "translated_name",
                        "text"
                      ],
                      "properties": {
                        "verses": {
                          "type": "object",
                          "description": "Hash map of ayah_key → tafsir-record",
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "integer"
                              }
                            },
                            "required": ["id"]
                          }
                        },
                        "resource_id": {
                          "type": "integer"
                        },
                        "resource_name": {
                          "type": "string"
                        },
                        "language_id": {
                          "type": "integer"
                        },
                        "slug": {
                          "type": "string"
                        },
                        "translated_name": {
                          "type": "object",
                          "required": ["name", "language_name"],
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "language_name": {
                              "type": "string"
                            }
                          }
                        },
                        "text": {
                          "type": "string",
                          "description": "HTML-formatted tafsir body"
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "tafsir": {
                        "verses": {
                          "2:111": {
                            "id": 118
                          },
                          "2:112": {
                            "id": 119
                          },
                          "2:113": {
                            "id": 120
                          }
                        },
                        "resource_id": 168,
                        "resource_name": "Ma'arif al-Qur'an",
                        "language_id": 38,
                        "slug": "en-tafsir-maarif-ul-quran",
                        "translated_name": {
                          "name": "Ma'arif al-Qur'an",
                          "language_name": "english"
                        },
                        "text": "<p>…HTML tafsīr…</p>"
                      }
                    }
                  },
                  "single_ayah_tafsir": {
                    "summary": "Tafsir for one ayah",
                    "value": {
                      "tafsir": {
                        "verses": {
                          "1:1": {
                            "id": 82641
                          }
                        },
                        "resource_id": 169,
                        "resource_name": "Tafsir Ibn Kathir",
                        "language_id": 38,
                        "slug": "tafsir-ibn-kathir",
                        "translated_name": {
                          "name": "Tafsir Ibn Kathir",
                          "language_name": "english"
                        },
                        "text": "<p>Bismillah is a verse of the Holy Qur'an.</p>"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get tafsirs for specific Ayah\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(resource_id, ayah_key) {\n  const response = await axios.get(\n    `${API_BASE_URL}/tafsirs/${resource_id}/by_ayah/${ayah_key}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      }\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(1, \"value\")\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get tafsirs for specific Ayah\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(resource_id, ayah_key):\n    params = {k: v for k, v in {}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/tafsirs/{resource_id}/by_ayah/{ayah_key}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(1, \"value\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get tafsirs for specific Ayah\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(resource_id string, ayah_key string) (string, error) {\n  path := fmt.Sprintf(\"/tafsirs/%s/by_ayah/%s\", resource_id, ayah_key)\n  endpoint := API_BASE_URL + path\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  data, err := callApi(1, \"value\")\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get tafsirs for specific Ayah\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(resource_id, ayah_key)\n  path = \"/tafsirs/#{resource_id}/by_ayah/#{ayah_key}\"\n  uri = URI(API_BASE_URL + path)\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\ndata = call_api(1, \"value\")\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get tafsirs for specific Ayah\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string resource_id, string ayah_key)\n{\n    var path = $@\"/tafsirs/{resource_id}/by_ayah/{ayah_key}\";\n    var url = API_BASE_URL + path;\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar data = await CallApiAsync(1, \"value\");\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get tafsirs for specific Ayah\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($resource_id, $ayah_key) {\n  $path = sprintf(\"/tafsirs/%s/by_ayah/%s\", $resource_id, $ayah_key);\n  $url = API_BASE_URL . $path;\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$data = callApi(1, \"value\");\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get tafsirs for specific Ayah\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String resource_id, String ayah_key) throws IOException {\n    String path = String.format(\"/tafsirs/%s/by_ayah/%s\", resource_id, ayah_key);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    String data = callApi(1, \"value\");\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get tafsirs for specific Ayah\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$resource_id, [string]$ayah_key) {\n  $path = \"/tafsirs/$resource_id/by_ayah/$ayah_key\"\n  $url = \"$API_BASE_URL$path\"\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$data = Call-Api(1, \"value\")\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get tafsirs for specific Ayah\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/tafsirs/1/by_ayah/value' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get tafsirs for specific ayah using the Quran Foundation API.\n\nEndpoint: GET /tafsirs/{resource_id}/by_ayah/{ayah_key}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  resource_id: Tafsir resource ID (e.g., \"1\")\n  ayah_key: Ayah key is combination of surah number and ayah number. e.g 1:1 will be first Ayah of first Surah (e.g., \"value\")\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/tafsirs/{resource_id}/by_ayah/{ayah_key}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts resource_id, ayah_key and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/juzs/{id}": {
      "get": {
        "tags": ["Juz"],
        "summary": "Get Juz",
        "description": "Get details for a single Juz.",
        "operationId": "get-juz",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Juz number (1-30)",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 30
            }
          },
          {
            "name": "mushaf",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "Optional mushaf identifier (alias: mushaf_id) to select the verse mapping set."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "juz": {
                      "$ref": "#/components/schemas/juz"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "juz": {
                        "id": 1,
                        "juz_number": 1,
                        "verse_mapping": {
                          "1": "1-7",
                          "2": "1-141"
                        },
                        "first_verse_id": 1,
                        "last_verse_id": 148,
                        "verses_count": 148
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get Juz\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(id, options = {}) {\n  const response = await axios.get(\n    `${API_BASE_URL}/juzs/${id}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      },\n      params: options\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(\"1\", {\"mushaf\":1})\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get Juz\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(id, mushaf=None):\n    params = {k: v for k, v in {'mushaf': mushaf}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/juzs/{id}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(\"1\", mushaf=1)\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get Juz\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(id string, params map[string]string) (string, error) {\n  path := fmt.Sprintf(\"/juzs/%s\", id)\n  endpoint := API_BASE_URL + path\n  if params != nil && len(params) > 0 {\n    values := url.Values{}\n    for k, v := range params {\n      values.Set(k, v)\n    }\n    endpoint = endpoint + \"?\" + values.Encode()\n  }\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  params := map[string]string{\"mushaf\": \"1\"}\n  data, err := callApi(\"1\", params)\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get Juz\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(id, params = {})\n  path = \"/juzs/#{id}\"\n  uri = URI(API_BASE_URL + path)\n  uri.query = URI.encode_www_form(params) if params && !params.empty?\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\nparams = { \"mushaf\" => \"1\" }\ndata = call_api(\"1\", params)\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get Juz\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string id, Dictionary<string, string> query = null)\n{\n    var path = $@\"/juzs/{id}\";\n    var url = API_BASE_URL + path;\n    if (query != null && query.Count > 0)\n    {\n        var queryString = string.Join(\"&\", query.Select(kvp =>\n            $\"{Uri.EscapeDataString(kvp.Key)}={Uri.EscapeDataString(kvp.Value)}\"));\n        url = $\"{url}?{queryString}\";\n    }\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar query = new Dictionary<string, string> { {\"mushaf\", \"1\"} };\nvar data = await CallApiAsync(\"1\", query);\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get Juz\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($id, $params = []) {\n  $path = sprintf(\"/juzs/%s\", $id);\n  $url = API_BASE_URL . $path;\n  if (!empty($params)) {\n    $url .= '?' . http_build_query($params);\n  }\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$params = ['mushaf' => '1'];\n$data = callApi(\"1\", $params);\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get Juz\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String id, Map<String, String> params) throws IOException {\n    String path = String.format(\"/juzs/%s\", id);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    if (params != null) {\n      for (Map.Entry<String, String> entry : params.entrySet()) {\n        urlBuilder.addQueryParameter(entry.getKey(), entry.getValue());\n      }\n    }\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    Map<String, String> params = new HashMap<>();\n    params.put(\"mushaf\", \"1\");\n    String data = callApi(\"1\", params);\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get Juz\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$id, [hashtable]$params = @{}) {\n  $path = \"/juzs/$id\"\n  $url = \"$API_BASE_URL$path\"\n  if ($params.Count -gt 0) {\n    $query = ($params.GetEnumerator() | ForEach-Object {\n      \"$($_.Key)=$([System.Uri]::EscapeDataString([string]$_.Value))\"\n    }) -join \"&\"\n    $url = \"$url?$query\"\n  }\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$params = @{ mushaf = \"1\" }\n$data = Call-Api(\"1\", $params)\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get Juz\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/juzs/1?mushaf=1' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get juz using the Quran Foundation API.\n\nEndpoint: GET /juzs/{id}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  id: Juz number (1-30) (e.g., \"1\")\nOptional Query Parameters:\n  mushaf: Optional mushaf identifier (alias: mushaf_id) to select the verse mapping set.\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/juzs/{id}?{queryParams}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts id and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/hizbs": {
      "get": {
        "tags": ["Hizb"],
        "summary": "List Hizbs",
        "description": "Get list of all Hizbs with verse boundaries.",
        "operationId": "list-hizbs",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["hizbs"],
                  "properties": {
                    "hizbs": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/hizb"
                      }
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "hizbs": [
                        {
                          "id": 1,
                          "hizb_number": 1,
                          "verse_mapping": {
                            "1": "1-77",
                            "2": "78-141",
                            "3": "142-176",
                            "4": "177-286"
                          },
                          "first_verse_id": 1,
                          "last_verse_id": 286,
                          "verses_count": 286
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// List Hizbs\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi() {\n  const response = await axios.get(\n    `${API_BASE_URL}/hizbs`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      }\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi()\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# List Hizbs\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api():\n    params = {k: v for k, v in {}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/hizbs',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api()\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// List Hizbs\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi() (string, error) {\n  path := \"/hizbs\"\n  endpoint := API_BASE_URL + path\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  data, err := callApi()\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# List Hizbs\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api()\n  path = \"/hizbs\"\n  uri = URI(API_BASE_URL + path)\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\ndata = call_api()\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// List Hizbs\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync()\n{\n    var path = $@\"/hizbs\";\n    var url = API_BASE_URL + path;\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar data = await CallApiAsync();\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# List Hizbs\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi() {\n  $path = \"/hizbs\";\n  $url = API_BASE_URL . $path;\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$data = callApi();\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// List Hizbs\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi() throws IOException {\n    String path = \"/hizbs\";\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    String data = callApi();\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# List Hizbs\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api() {\n  $path = \"/hizbs\"\n  $url = \"$API_BASE_URL$path\"\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$data = Call-Api()\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# List Hizbs\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/hizbs' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to list hizbs using the Quran Foundation API.\n\nEndpoint: GET /hizbs\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/hizbs\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/hizbs/{id}": {
      "get": {
        "tags": ["Hizb"],
        "summary": "Get Hizb",
        "description": "Get details for a single Hizb.",
        "operationId": "get-hizb",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Hizb number (1-60)",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 60
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "hizb": {
                      "$ref": "#/components/schemas/hizb"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "hizb": {
                        "id": 1,
                        "hizb_number": 1,
                        "verse_mapping": {
                          "1": "1-77",
                          "2": "78-141",
                          "3": "142-176",
                          "4": "177-286"
                        },
                        "first_verse_id": 1,
                        "last_verse_id": 286,
                        "verses_count": 286
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get Hizb\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(id) {\n  const response = await axios.get(\n    `${API_BASE_URL}/hizbs/${id}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      }\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(\"1\")\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get Hizb\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(id):\n    params = {k: v for k, v in {}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/hizbs/{id}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(\"1\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get Hizb\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(id string) (string, error) {\n  path := fmt.Sprintf(\"/hizbs/%s\", id)\n  endpoint := API_BASE_URL + path\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  data, err := callApi(\"1\")\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get Hizb\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(id)\n  path = \"/hizbs/#{id}\"\n  uri = URI(API_BASE_URL + path)\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\ndata = call_api(\"1\")\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get Hizb\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string id)\n{\n    var path = $@\"/hizbs/{id}\";\n    var url = API_BASE_URL + path;\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar data = await CallApiAsync(\"1\");\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get Hizb\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($id) {\n  $path = sprintf(\"/hizbs/%s\", $id);\n  $url = API_BASE_URL . $path;\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$data = callApi(\"1\");\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get Hizb\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String id) throws IOException {\n    String path = String.format(\"/hizbs/%s\", id);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    String data = callApi(\"1\");\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get Hizb\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$id) {\n  $path = \"/hizbs/$id\"\n  $url = \"$API_BASE_URL$path\"\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$data = Call-Api(\"1\")\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get Hizb\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/hizbs/1' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get hizb using the Quran Foundation API.\n\nEndpoint: GET /hizbs/{id}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  id: Hizb number (1-60) (e.g., \"1\")\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/hizbs/{id}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts id and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/rub_el_hizbs": {
      "get": {
        "tags": ["Rub El Hizb"],
        "summary": "List Rubʿ al-Ḥizb",
        "description": "Get list of all Rubʿ al-Ḥizb segments.",
        "operationId": "list-rub-el-hizbs",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["rub_el_hizbs"],
                  "properties": {
                    "rub_el_hizbs": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/rub-el-hizb"
                      }
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "rub_el_hizbs": [
                        {
                          "id": 1,
                          "rub_el_hizb_number": 1,
                          "verse_mapping": {
                            "1": "1-26",
                            "2": "27-43"
                          },
                          "first_verse_id": 1,
                          "last_verse_id": 43,
                          "verses_count": 43
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// List Rubʿ al-Ḥizb\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi() {\n  const response = await axios.get(\n    `${API_BASE_URL}/rub_el_hizbs`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      }\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi()\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# List Rubʿ al-Ḥizb\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api():\n    params = {k: v for k, v in {}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/rub_el_hizbs',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api()\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// List Rubʿ al-Ḥizb\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi() (string, error) {\n  path := \"/rub_el_hizbs\"\n  endpoint := API_BASE_URL + path\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  data, err := callApi()\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# List Rubʿ al-Ḥizb\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api()\n  path = \"/rub_el_hizbs\"\n  uri = URI(API_BASE_URL + path)\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\ndata = call_api()\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// List Rubʿ al-Ḥizb\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync()\n{\n    var path = $@\"/rub_el_hizbs\";\n    var url = API_BASE_URL + path;\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar data = await CallApiAsync();\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# List Rubʿ al-Ḥizb\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi() {\n  $path = \"/rub_el_hizbs\";\n  $url = API_BASE_URL . $path;\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$data = callApi();\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// List Rubʿ al-Ḥizb\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi() throws IOException {\n    String path = \"/rub_el_hizbs\";\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    String data = callApi();\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# List Rubʿ al-Ḥizb\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api() {\n  $path = \"/rub_el_hizbs\"\n  $url = \"$API_BASE_URL$path\"\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$data = Call-Api()\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# List Rubʿ al-Ḥizb\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/rub_el_hizbs' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to list rubʿ al-ḥizb using the Quran Foundation API.\n\nEndpoint: GET /rub_el_hizbs\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/rub_el_hizbs\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/rub_el_hizbs/{id}": {
      "get": {
        "tags": ["Rub El Hizb"],
        "summary": "Get Rubʿ al-Ḥizb",
        "description": "Get details for a single Rubʿ al-Ḥizb segment.",
        "operationId": "get-rub-el-hizb",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Rubʿ al-Ḥizb number (1-240)",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 240
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "rub_el_hizb": {
                      "$ref": "#/components/schemas/rub-el-hizb"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "rub_el_hizb": {
                        "id": 1,
                        "rub_el_hizb_number": 1,
                        "verse_mapping": {
                          "1": "1-26",
                          "2": "27-43"
                        },
                        "first_verse_id": 1,
                        "last_verse_id": 43,
                        "verses_count": 43
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get Rubʿ al-Ḥizb\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(id) {\n  const response = await axios.get(\n    `${API_BASE_URL}/rub_el_hizbs/${id}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      }\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(\"1\")\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get Rubʿ al-Ḥizb\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(id):\n    params = {k: v for k, v in {}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/rub_el_hizbs/{id}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(\"1\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get Rubʿ al-Ḥizb\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(id string) (string, error) {\n  path := fmt.Sprintf(\"/rub_el_hizbs/%s\", id)\n  endpoint := API_BASE_URL + path\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  data, err := callApi(\"1\")\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get Rubʿ al-Ḥizb\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(id)\n  path = \"/rub_el_hizbs/#{id}\"\n  uri = URI(API_BASE_URL + path)\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\ndata = call_api(\"1\")\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get Rubʿ al-Ḥizb\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string id)\n{\n    var path = $@\"/rub_el_hizbs/{id}\";\n    var url = API_BASE_URL + path;\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar data = await CallApiAsync(\"1\");\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get Rubʿ al-Ḥizb\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($id) {\n  $path = sprintf(\"/rub_el_hizbs/%s\", $id);\n  $url = API_BASE_URL . $path;\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$data = callApi(\"1\");\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get Rubʿ al-Ḥizb\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String id) throws IOException {\n    String path = String.format(\"/rub_el_hizbs/%s\", id);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    String data = callApi(\"1\");\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get Rubʿ al-Ḥizb\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$id) {\n  $path = \"/rub_el_hizbs/$id\"\n  $url = \"$API_BASE_URL$path\"\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$data = Call-Api(\"1\")\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get Rubʿ al-Ḥizb\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/rub_el_hizbs/1' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get rubʿ al-ḥizb using the Quran Foundation API.\n\nEndpoint: GET /rub_el_hizbs/{id}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  id: Rubʿ al-Ḥizb number (1-240) (e.g., \"1\")\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/rub_el_hizbs/{id}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts id and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/rukus": {
      "get": {
        "tags": ["Ruku"],
        "summary": "List Rukus",
        "description": "Get list of all Rukus.",
        "operationId": "list-rukus",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["rukus"],
                  "properties": {
                    "rukus": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ruku"
                      }
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "rukus": [
                        {
                          "id": 1,
                          "ruku_number": 1,
                          "surah_ruku_number": 1,
                          "verse_mapping": {
                            "1": "1-7"
                          },
                          "first_verse_id": 1,
                          "last_verse_id": 7,
                          "verses_count": 7
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// List Rukus\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi() {\n  const response = await axios.get(\n    `${API_BASE_URL}/rukus`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      }\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi()\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# List Rukus\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api():\n    params = {k: v for k, v in {}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/rukus',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api()\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// List Rukus\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi() (string, error) {\n  path := \"/rukus\"\n  endpoint := API_BASE_URL + path\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  data, err := callApi()\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# List Rukus\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api()\n  path = \"/rukus\"\n  uri = URI(API_BASE_URL + path)\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\ndata = call_api()\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// List Rukus\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync()\n{\n    var path = $@\"/rukus\";\n    var url = API_BASE_URL + path;\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar data = await CallApiAsync();\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# List Rukus\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi() {\n  $path = \"/rukus\";\n  $url = API_BASE_URL . $path;\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$data = callApi();\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// List Rukus\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi() throws IOException {\n    String path = \"/rukus\";\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    String data = callApi();\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# List Rukus\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api() {\n  $path = \"/rukus\"\n  $url = \"$API_BASE_URL$path\"\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$data = Call-Api()\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# List Rukus\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/rukus' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to list rukus using the Quran Foundation API.\n\nEndpoint: GET /rukus\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/rukus\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/rukus/{id}": {
      "get": {
        "tags": ["Ruku"],
        "summary": "Get Ruku",
        "description": "Get details for a single Ruku.",
        "operationId": "get-ruku",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Ruku number (1-558)",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 558
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ruku": {
                      "$ref": "#/components/schemas/ruku"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "ruku": {
                        "id": 1,
                        "ruku_number": 1,
                        "surah_ruku_number": 1,
                        "verse_mapping": {
                          "1": "1-7"
                        },
                        "first_verse_id": 1,
                        "last_verse_id": 7,
                        "verses_count": 7
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get Ruku\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(id) {\n  const response = await axios.get(\n    `${API_BASE_URL}/rukus/${id}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      }\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(\"1\")\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get Ruku\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(id):\n    params = {k: v for k, v in {}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/rukus/{id}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(\"1\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get Ruku\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(id string) (string, error) {\n  path := fmt.Sprintf(\"/rukus/%s\", id)\n  endpoint := API_BASE_URL + path\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  data, err := callApi(\"1\")\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get Ruku\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(id)\n  path = \"/rukus/#{id}\"\n  uri = URI(API_BASE_URL + path)\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\ndata = call_api(\"1\")\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get Ruku\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string id)\n{\n    var path = $@\"/rukus/{id}\";\n    var url = API_BASE_URL + path;\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar data = await CallApiAsync(\"1\");\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get Ruku\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($id) {\n  $path = sprintf(\"/rukus/%s\", $id);\n  $url = API_BASE_URL . $path;\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$data = callApi(\"1\");\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get Ruku\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String id) throws IOException {\n    String path = String.format(\"/rukus/%s\", id);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    String data = callApi(\"1\");\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get Ruku\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$id) {\n  $path = \"/rukus/$id\"\n  $url = \"$API_BASE_URL$path\"\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$data = Call-Api(\"1\")\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get Ruku\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/rukus/1' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get ruku using the Quran Foundation API.\n\nEndpoint: GET /rukus/{id}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  id: Ruku number (1-558) (e.g., \"1\")\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/rukus/{id}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts id and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/manzils": {
      "get": {
        "tags": ["Manzil"],
        "summary": "List Manzils",
        "description": "Get list of all Manzils.",
        "operationId": "list-manzils",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["manzils"],
                  "properties": {
                    "manzils": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/manzil"
                      }
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "manzils": [
                        {
                          "id": 1,
                          "manzil_number": 1,
                          "verse_mapping": {
                            "1": "1-148",
                            "2": "1-152"
                          },
                          "first_verse_id": 1,
                          "last_verse_id": 260,
                          "verses_count": 260
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// List Manzils\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi() {\n  const response = await axios.get(\n    `${API_BASE_URL}/manzils`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      }\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi()\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# List Manzils\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api():\n    params = {k: v for k, v in {}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/manzils',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api()\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// List Manzils\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi() (string, error) {\n  path := \"/manzils\"\n  endpoint := API_BASE_URL + path\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  data, err := callApi()\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# List Manzils\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api()\n  path = \"/manzils\"\n  uri = URI(API_BASE_URL + path)\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\ndata = call_api()\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// List Manzils\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync()\n{\n    var path = $@\"/manzils\";\n    var url = API_BASE_URL + path;\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar data = await CallApiAsync();\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# List Manzils\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi() {\n  $path = \"/manzils\";\n  $url = API_BASE_URL . $path;\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$data = callApi();\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// List Manzils\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi() throws IOException {\n    String path = \"/manzils\";\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    String data = callApi();\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# List Manzils\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api() {\n  $path = \"/manzils\"\n  $url = \"$API_BASE_URL$path\"\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$data = Call-Api()\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# List Manzils\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/manzils' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to list manzils using the Quran Foundation API.\n\nEndpoint: GET /manzils\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/manzils\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/manzils/{id}": {
      "get": {
        "tags": ["Manzil"],
        "summary": "Get Manzil",
        "description": "Get details for a single Manzil.",
        "operationId": "get-manzil",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Manzil number (1-7)",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 7
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "manzil": {
                      "$ref": "#/components/schemas/manzil"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "manzil": {
                        "id": 1,
                        "manzil_number": 1,
                        "verse_mapping": {
                          "1": "1-148",
                          "2": "1-152"
                        },
                        "first_verse_id": 1,
                        "last_verse_id": 260,
                        "verses_count": 260
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get Manzil\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(id) {\n  const response = await axios.get(\n    `${API_BASE_URL}/manzils/${id}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      }\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(\"1\")\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get Manzil\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(id):\n    params = {k: v for k, v in {}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/manzils/{id}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(\"1\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get Manzil\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(id string) (string, error) {\n  path := fmt.Sprintf(\"/manzils/%s\", id)\n  endpoint := API_BASE_URL + path\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  data, err := callApi(\"1\")\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get Manzil\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(id)\n  path = \"/manzils/#{id}\"\n  uri = URI(API_BASE_URL + path)\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\ndata = call_api(\"1\")\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get Manzil\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string id)\n{\n    var path = $@\"/manzils/{id}\";\n    var url = API_BASE_URL + path;\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar data = await CallApiAsync(\"1\");\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get Manzil\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($id) {\n  $path = sprintf(\"/manzils/%s\", $id);\n  $url = API_BASE_URL . $path;\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$data = callApi(\"1\");\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get Manzil\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String id) throws IOException {\n    String path = String.format(\"/manzils/%s\", id);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    String data = callApi(\"1\");\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get Manzil\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$id) {\n  $path = \"/manzils/$id\"\n  $url = \"$API_BASE_URL$path\"\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$data = Call-Api(\"1\")\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get Manzil\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/manzils/1' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get manzil using the Quran Foundation API.\n\nEndpoint: GET /manzils/{id}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  id: Manzil number (1-7) (e.g., \"1\")\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/manzils/{id}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts id and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/foot_notes/{id}": {
      "get": {
        "tags": ["Foot Note"],
        "summary": "Get Footnote",
        "description": "Retrieve a single footnote.",
        "operationId": "get-foot-note",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Footnote ID",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "foot_note": {
                      "$ref": "#/components/schemas/foot-note"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "foot_note": {
                        "id": 1,
                        "text": "Some manuscripts record an additional marginal explanation for this verse.",
                        "language_name": "english"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        },
        "x-code-samples": [
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "// Get Foot Note\nconst axios = require('axios');\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nasync function callApi(id) {\n  const response = await axios.get(\n    `${API_BASE_URL}/foot_notes/${id}`,\n    {\n      headers: {\n        'x-auth-token': ACCESS_TOKEN,\n        'x-client-id': CLIENT_ID\n      }\n    }\n  );\n  return response.data;\n}\n\n// Example usage\ncallApi(\"1\")\n  .then(data => console.log(data))\n  .catch(err => console.error(err.response?.status, err.message));"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "# Get Foot Note\nimport requests\n\nAPI_BASE_URL = 'https://apis.quran.foundation/content/api/v4'\nACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>'\nCLIENT_ID = '<YOUR_CLIENT_ID>'\n\ndef call_api(id):\n    params = {k: v for k, v in {}.items() if v is not None}\n    \n    response = requests.get(\n        f'{API_BASE_URL}/foot_notes/{id}',\n        headers={\n            'x-auth-token': ACCESS_TOKEN,\n            'x-client-id': CLIENT_ID\n        },\n        params=params\n    )\n    response.raise_for_status()\n    return response.json()\n\n# Example usage\ntry:\n    data = call_api(\"1\")\n    print(data)\nexcept requests.HTTPError as e:\n    print(f'Error {e.response.status_code}: {e}')"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "// Get Foot Note\npackage main\n\nimport (\n  \"fmt\"\n  \"io\"\n  \"net/http\"\n  \"net/url\"\n)\n\nconst API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nconst ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nconst CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunc callApi(id string) (string, error) {\n  path := fmt.Sprintf(\"/foot_notes/%s\", id)\n  endpoint := API_BASE_URL + path\n\n  req, err := http.NewRequest(\"GET\", endpoint, nil)\n  if err != nil {\n    return \"\", err\n  }\n  req.Header.Set(\"x-auth-token\", ACCESS_TOKEN)\n  req.Header.Set(\"x-client-id\", CLIENT_ID)\n\n  resp, err := http.DefaultClient.Do(req)\n  if err != nil {\n    return \"\", err\n  }\n  defer resp.Body.Close()\n\n  body, err := io.ReadAll(resp.Body)\n  if err != nil {\n    return \"\", err\n  }\n  return string(body), nil\n}\n\n// Example usage\nfunc main() {\n  data, err := callApi(\"1\")\n  if err != nil {\n    fmt.Println(\"Error:\", err)\n    return\n  }\n  fmt.Println(data)\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "# Get Foot Note\nrequire \"net/http\"\nrequire \"uri\"\n\nAPI_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\nACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\nCLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\ndef call_api(id)\n  path = \"/foot_notes/#{id}\"\n  uri = URI(API_BASE_URL + path)\n  request_class = Net::HTTP.const_get(\"Get\")\n  request = request_class.new(uri)\n  request[\"x-auth-token\"] = ACCESS_TOKEN\n  request[\"x-client-id\"] = CLIENT_ID\n\n  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n    http.request(request)\n  end\n\n  response.body\nend\n\n# Example usage\ndata = call_api(\"1\")\nputs data"
          },
          {
            "lang": "csharp",
            "label": "C#",
            "source": "// Get Foot Note\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nconst string API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\nconst string ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\nconst string CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\nstatic async Task<string> CallApiAsync(string id)\n{\n    var path = $@\"/foot_notes/{id}\";\n    var url = API_BASE_URL + path;\n    using var client = new HttpClient();\n    using var request = new HttpRequestMessage(new HttpMethod(\"GET\"), url);\n    request.Headers.Add(\"x-auth-token\", ACCESS_TOKEN);\n    request.Headers.Add(\"x-client-id\", CLIENT_ID);\n\n    using var response = await client.SendAsync(request);\n    response.EnsureSuccessStatusCode();\n    return await response.Content.ReadAsStringAsync();\n}\n\n// Example usage\nvar data = await CallApiAsync(\"1\");\nConsole.WriteLine(data);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "# Get Foot Note\n<?php\n\nconst API_BASE_URL = 'https://apis.quran.foundation/content/api/v4';\nconst ACCESS_TOKEN = '<YOUR_ACCESS_TOKEN>';\nconst CLIENT_ID = '<YOUR_CLIENT_ID>';\n\nfunction callApi($id) {\n  $path = sprintf(\"/foot_notes/%s\", $id);\n  $url = API_BASE_URL . $path;\n  $ch = curl_init($url);\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n  curl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'x-auth-token: ' . ACCESS_TOKEN,\n    'x-client-id: ' . CLIENT_ID\n  ]);\n\n  $response = curl_exec($ch);\n  if ($response === false) {\n    throw new Exception(curl_error($ch));\n  }\n  curl_close($ch);\n  return $response;\n}\n\n// Example usage\n$data = callApi(\"1\");\necho $data;\n?>"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "// Get Foot Note\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport okhttp3.HttpUrl;\nimport okhttp3.OkHttpClient;\nimport okhttp3.Request;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\n\npublic class Main {\n  private static final String API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\";\n  private static final String ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\";\n  private static final String CLIENT_ID = \"<YOUR_CLIENT_ID>\";\n\n  public static String callApi(String id) throws IOException {\n    String path = String.format(\"/foot_notes/%s\", id);\n    HttpUrl.Builder urlBuilder = HttpUrl.parse(API_BASE_URL + path).newBuilder();\n    String method = \"GET\";\n    RequestBody requestBody = method.equals(\"GET\") ? null : RequestBody.create(new byte[0]);\n    Request request = new Request.Builder()\n      .url(urlBuilder.build())\n      .addHeader(\"x-auth-token\", ACCESS_TOKEN)\n      .addHeader(\"x-client-id\", CLIENT_ID)\n      .method(method, requestBody)\n      .build();\n\n    OkHttpClient client = new OkHttpClient();\n    Response response = client.newCall(request).execute();\n    return response.body().string();\n  }\n\n  public static void main(String[] args) throws Exception {\n    String data = callApi(\"1\");\n    System.out.println(data);\n  }\n}"
          },
          {
            "lang": "powershell",
            "label": "PowerShell",
            "source": "# Get Foot Note\n$API_BASE_URL = \"https://apis.quran.foundation/content/api/v4\"\n$ACCESS_TOKEN = \"<YOUR_ACCESS_TOKEN>\"\n$CLIENT_ID = \"<YOUR_CLIENT_ID>\"\n\nfunction Call-Api([string]$id) {\n  $path = \"/foot_notes/$id\"\n  $url = \"$API_BASE_URL$path\"\n  $headers = @{\n    \"x-auth-token\" = $ACCESS_TOKEN\n    \"x-client-id\" = $CLIENT_ID\n  }\n\n  Invoke-RestMethod -Method GET -Uri $url -Headers $headers\n}\n\n# Example usage\n$data = Call-Api(\"1\")\nWrite-Output $data"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "# Get Foot Note\ncurl -X GET \\\n  'https://apis.quran.foundation/content/api/v4/foot_notes/1' \\\n  -H 'x-auth-token: <YOUR_ACCESS_TOKEN>' \\\n  -H 'x-client-id: <YOUR_CLIENT_ID>'"
          },
          {
            "lang": "text",
            "label": "🤖 AI Prompt",
            "source": "Implement a function to get foot note using the Quran Foundation API.\n\nEndpoint: GET /foot_notes/{id}\nBase URL: https://apis.quran.foundation/content/api/v4\n\nRequired Headers (copy exactly):\n  x-auth-token: <YOUR_ACCESS_TOKEN>\n  x-client-id: <YOUR_CLIENT_ID>\nPath Parameters:\n  id: Footnote ID (e.g., \"1\")\n\nImplementation Requirements:\n1. Build the request URL: {baseUrl}/foot_notes/{id}\n2. Inject both required headers on every request\n3. Handle errors safely:\n   - 401: Token expired → re-request token and retry once\n   - 403: Access denied → check client credentials\n   - 429: Rate limited → implement exponential backoff\n\nAcceptance Checklist:\n- [ ] Function accepts id and optional parameters\n- [ ] Headers x-auth-token and x-client-id are sent\n- [ ] 401/403/429 errors are handled gracefully"
          }
        ]
      }
    },
    "/quran-reflect/v1/posts/feed": {
      "get": {
        "operationId": "PostsController_feed",
        "summary": "Quran Reflect Lessons and Reflections Feed",
        "description": "Retrieve the Quran Reflect lessons and reflections feed, a paginated stream of searchable lesson posts and reflection posts. Use this endpoint to browse lesson and reflection content across the main feed, trending, following, latest, newest, public, and popular views, with filters for authors, tags, Quran references, groups, pages, languages, verified content, and post types. Response items include engagement metadata such as `likesCount`, `commentsCount`, and `recentComment` when available. Use the dedicated comment endpoints to retrieve comment objects and totals. For ayah-by-ayah reads, use `filter[references][0][chapterId]`, `filter[references][0][from]`, and `filter[references][0][to]`, and use `filter[postTypeIds]=1` for reflections or `filter[postTypeIds]=2` for lessons. `/quran-reflect/v1/posts/by-verse/{verseKey}` is user-bound and is not part of the public `client_credentials` read subset. Full gateway path is `/quran-reflect/v1/posts/feed`; this is not a `/content/api/v4` endpoint. This Quran Reflect endpoint is compatible with the `client_credentials` grant and requires `x-auth-token` and `x-client-id` with the `post.read` scope. When called with a user-bound token, language preferences may personalize the response; client_credentials callers receive non-user-personalized results.",
        "parameters": [
          {
            "name": "tab",
            "required": false,
            "in": "query",
            "description": "Feed view for Quran Reflect lessons and reflections. `feed` shows the personalized main feed, `trending` shows explore, `following` shows posts from followed users, and the remaining enum values select alternate listing views supported by the API.",
            "schema": {
              "enum": [
                "newest",
                "latest",
                "following",
                "draft",
                "favorite",
                "most_popular",
                "only_room_members",
                "public",
                "feed",
                "trending",
                "popular"
              ],
              "type": "string"
            }
          },
          {
            "name": "languages",
            "required": false,
            "in": "query",
            "description": "Comma-separated list of language IDs used to filter Quran Reflect lessons and reflections by content language, for example `languages=1,2`.",
            "style": "form",
            "explode": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "number"
              }
            }
          },
          {
            "name": "page",
            "required": false,
            "in": "query",
            "description": "Page number for lessons and reflections feed pagination (default: 1).",
            "schema": {
              "minimum": 1,
              "default": 1,
              "type": "number"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Number of lessons or reflections to return per page (default: 20).",
            "schema": {
              "minimum": 1,
              "default": 20,
              "type": "number"
            }
          },
          {
            "name": "filter[authors]",
            "required": false,
            "in": "query",
            "style": "form",
            "explode": false,
            "description": "Comma-separated list of Quran Reflect author identifiers to include in the lessons and reflections feed.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "filter[tags]",
            "required": false,
            "in": "query",
            "style": "form",
            "explode": false,
            "description": "Comma-separated list of Quran Reflect tag values to include in the lessons and reflections feed.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "filter[references][0][chapterId]",
            "required": false,
            "in": "query",
            "description": "Chapter number for Quran reference filter index `0`. Use matching `from` and `to` values to target a specific ayah or passage.",
            "schema": {
              "type": "number",
              "minimum": 1,
              "example": 2
            }
          },
          {
            "name": "filter[references][0][from]",
            "required": false,
            "in": "query",
            "description": "Starting ayah number for Quran reference filter index `0`. Pair this with the matching `chapterId` and `to` values.",
            "schema": {
              "type": "number",
              "minimum": 1,
              "example": 255
            }
          },
          {
            "name": "filter[references][0][to]",
            "required": false,
            "in": "query",
            "description": "Ending ayah number for Quran reference filter index `0`. For a single ayah, use the same value as `from`.",
            "schema": {
              "type": "number",
              "minimum": 1,
              "example": 255
            }
          },
          {
            "name": "filter[groups]",
            "required": false,
            "in": "query",
            "style": "form",
            "explode": false,
            "description": "Comma-separated list of Quran Reflect group URLs to include in the lessons and reflections feed.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "filter[pages]",
            "required": false,
            "in": "query",
            "style": "form",
            "explode": false,
            "description": "Comma-separated list of Quran Reflect page subdomains to include in the lessons and reflections feed.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "filter[postTypeIds]",
            "required": false,
            "in": "query",
            "style": "form",
            "explode": false,
            "description": "Comma-separated Quran Reflect post type IDs. Use `1` to return reflections, `2` to return lessons, or include both values to search both content types. `1` means Reflection, a personal and heart-centered response to an ayah; see https://quranreflect.com/faq. `2` means Lesson, a knowledge-based takeaway from an ayah focused on explaining a benefit or point of understanding.",
            "schema": {
              "type": "array",
              "items": {
                "type": "number"
              }
            }
          },
          {
            "name": "filter[tagsOperator]",
            "required": false,
            "in": "query",
            "description": "How multiple tag filters are matched when searching lessons and reflections: `OR` matches any selected tag and `AND` requires all selected tags.",
            "schema": {
              "enum": ["OR", "AND"],
              "type": "string"
            }
          },
          {
            "name": "filter[referencesOperator]",
            "required": false,
            "in": "query",
            "description": "How multiple Quran reference filters are matched when searching lessons and reflections: `OR` matches any reference and `AND` requires all references.",
            "schema": {
              "enum": ["OR", "AND"],
              "type": "string"
            }
          },
          {
            "name": "filter[verifiedOnly]",
            "required": false,
            "in": "query",
            "description": "When `true`, return only verified Quran Reflect content in the lessons and reflections feed. Public ayah-by-ayah reads typically combine this with the documented Quran reference filters.",
            "schema": {
              "default": false,
              "type": "boolean",
              "example": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Quran Reflect lessons and reflections feed retrieved successfully with pagination",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedResponseDto"
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "total": 1,
                      "currentPage": 1,
                      "limit": 20,
                      "pages": 1,
                      "data": [
                        {
                          "id": 101,
                          "authorId": "user-123",
                          "body": "Reflection text",
                          "createdAt": "2026-04-01T12:00:00.000Z",
                          "updatedAt": "2026-04-01T12:00:00.000Z",
                          "publishedAt": "2026-04-01T12:00:00.000Z",
                          "commentsCount": 2,
                          "likesCount": 5,
                          "viewsCount": 20,
                          "languageName": "english",
                          "roomId": 1,
                          "postTypeId": 1,
                          "postTypeName": "reflection"
                        }
                      ]
                    }
                  },
                  "feed_with_posts": {
                    "summary": "Feed page with reflection posts",
                    "value": {
                      "total": 1,
                      "currentPage": 1,
                      "limit": 20,
                      "pages": 1,
                      "data": [
                        {
                          "id": 101,
                          "authorId": "user-123",
                          "body": "Reflection text",
                          "createdAt": "2026-04-01T12:00:00.000Z",
                          "updatedAt": "2026-04-01T12:00:00.000Z",
                          "publishedAt": "2026-04-01T12:00:00.000Z",
                          "commentsCount": 2,
                          "likesCount": 5,
                          "viewsCount": 20,
                          "languageName": "english",
                          "roomId": 1,
                          "postTypeId": 1,
                          "postTypeName": "reflection"
                        }
                      ]
                    }
                  },
                  "empty_feed_page": {
                    "summary": "Feed page with no matching posts",
                    "value": {
                      "total": 0,
                      "currentPage": 1,
                      "limit": 20,
                      "pages": 0,
                      "data": []
                    }
                  }
                }
              }
            }
          }
        },
        "tags": ["Quran Reflect Lessons and Reflections"],
        "servers": [
          {
            "url": "https://apis-prelive.quran.foundation",
            "description": "Pre-production Server"
          },
          {
            "url": "https://apis.quran.foundation",
            "description": "Production Server"
          }
        ],
        "security": [
          {
            "x-auth-token": [],
            "x-client-id": []
          }
        ]
      }
    },
    "/quran-reflect/v1/posts/{id}": {
      "get": {
        "operationId": "PostsController_findOne",
        "summary": "Get Quran Reflect Lesson or Reflection by ID",
        "description": "Retrieve a specific Quran Reflect lesson or reflection post by its unique numeric ID. Returns the full lesson or reflection with author details, tags, references, room information, and engagement metadata such as `likesCount`, `commentsCount`, and `recentComment` when available. Use the dedicated comment endpoints to retrieve comment objects and totals. Admins can view additional moderation details. Full gateway path is `/quran-reflect/v1/posts/{id}`; this is not a `/content/api/v4` endpoint. This Quran Reflect endpoint is compatible with the `client_credentials` grant and requires `x-auth-token` and `x-client-id` with the `post.read` scope.",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Unique numeric Quran Reflect lesson or reflection post ID.",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Quran Reflect lesson or reflection returned with all associated data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostSerialized"
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "id": 101,
                      "authorId": "user-123",
                      "body": "Reflection text",
                      "createdAt": "2026-04-01T12:00:00.000Z",
                      "updatedAt": "2026-04-01T12:00:00.000Z",
                      "publishedAt": "2026-04-01T12:00:00.000Z",
                      "commentsCount": 2,
                      "likesCount": 5,
                      "viewsCount": 20,
                      "languageName": "english",
                      "roomId": 1,
                      "postTypeId": 1,
                      "postTypeName": "reflection"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Quran Reflect lesson or reflection not found or has been deleted"
          }
        },
        "tags": ["Quran Reflect Lessons and Reflections"],
        "servers": [
          {
            "url": "https://apis-prelive.quran.foundation",
            "description": "Pre-production Server"
          },
          {
            "url": "https://apis.quran.foundation",
            "description": "Production Server"
          }
        ],
        "security": [
          {
            "x-auth-token": [],
            "x-client-id": []
          }
        ]
      }
    },
    "/quran-reflect/v1/posts/user-posts/{id}": {
      "get": {
        "operationId": "PostsController_getUserPost",
        "summary": "Get Quran Reflect Lessons and Reflections by User",
        "description": "Retrieve a paginated list of Quran Reflect lessons and reflections created by a specific user. Use this endpoint to browse a user's public lesson posts and reflection posts, optionally filtered by post type and ordered by latest or popular. Response items include engagement metadata such as `likesCount`, `commentsCount`, and `recentComment` when available. Use the dedicated comment endpoints to retrieve comment objects and totals. If called with a user-bound token for the same user, the response can include that user's drafts. Full gateway path is `/quran-reflect/v1/posts/user-posts/{id}`; this is not a `/content/api/v4` endpoint. This Quran Reflect endpoint is compatible with the `client_credentials` grant and requires `x-auth-token` and `x-client-id` with the `post.read` scope. Client_credentials callers receive the public view.",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "UUID of the user whose Quran Reflect lessons and reflections to retrieve.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sortBy",
            "required": false,
            "in": "query",
            "description": "Sort a user's Quran Reflect lessons and reflections by `latest` or `popular` (default: `latest`).",
            "schema": {
              "enum": ["latest", "popular"],
              "type": "string"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Number of lesson or reflection posts to return per page (default: 20, max: 20).",
            "schema": {
              "minimum": 1,
              "maximum": 20,
              "default": 20,
              "type": "number"
            }
          },
          {
            "name": "page",
            "required": false,
            "in": "query",
            "description": "Page number for the user's lessons and reflections pagination (default: 1).",
            "schema": {
              "minimum": 1,
              "default": 1,
              "type": "number"
            }
          },
          {
            "name": "postTypeIds",
            "required": false,
            "in": "query",
            "description": "Filter a user's Quran Reflect lessons and reflections by post type. Use `1` to return reflections, `2` to return lessons, or include both values to return both content types.\n\n- `1` = Reflection: A personal, heart-centered response to an ayah, how it affects, reminds, or changes a person; it is broader and can come from any thoughtful contributor. To learn more, please visit [https://quranreflect.com/faq](https://quranreflect.com/faq).\n- `2` = Lesson: A knowledge-based takeaway from an ayah, closer to a scholarly insight, focused more on explaining a benefit or point of understanding.",
            "schema": {
              "type": "array",
              "items": {
                "type": "number"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "User Quran Reflect lessons and reflections retrieved with pagination metadata",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedResponseDto"
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "total": 1,
                      "currentPage": 1,
                      "limit": 20,
                      "pages": 1,
                      "data": [
                        {
                          "id": 101,
                          "authorId": "user-123",
                          "body": "Reflection text",
                          "createdAt": "2026-04-01T12:00:00.000Z",
                          "updatedAt": "2026-04-01T12:00:00.000Z",
                          "publishedAt": "2026-04-01T12:00:00.000Z",
                          "commentsCount": 2,
                          "likesCount": 5,
                          "viewsCount": 20,
                          "languageName": "english",
                          "roomId": 1,
                          "postTypeId": 1,
                          "postTypeName": "reflection"
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "tags": ["Quran Reflect Lessons and Reflections"],
        "servers": [
          {
            "url": "https://apis-prelive.quran.foundation",
            "description": "Pre-production Server"
          },
          {
            "url": "https://apis.quran.foundation",
            "description": "Production Server"
          }
        ],
        "security": [
          {
            "x-auth-token": [],
            "x-client-id": []
          }
        ]
      }
    },
    "/quran-reflect/v1/posts/{id}/comments": {
      "get": {
        "operationId": "PostsController_getComments",
        "summary": "Get Comments for a Quran Reflect Lesson or Reflection",
        "description": "Retrieve paginated top-level comments for a Quran Reflect lesson or reflection post. The response returns comment objects plus pagination metadata including `total`, `currentPage`, `limit`, and `pages`. Use the replies endpoint to get nested replies for specific comments. Full gateway path is `/quran-reflect/v1/posts/{id}/comments`; this is not a `/content/api/v4` endpoint. This Quran Reflect endpoint is compatible with the `client_credentials` grant and requires `x-auth-token` and `x-client-id` with the `comment.read` scope. User-bound tokens may still influence comment visibility.",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Unique numeric Quran Reflect lesson or reflection post ID.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Number of comments to return per page for the lesson or reflection post.",
            "schema": {
              "minimum": 1,
              "maximum": 20,
              "default": 20,
              "type": "number"
            }
          },
          {
            "name": "page",
            "required": false,
            "in": "query",
            "description": "Page number of comments for the lesson or reflection post.",
            "schema": {
              "minimum": 1,
              "default": 1,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Comments for the Quran Reflect lesson or reflection retrieved with pagination metadata",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostCommentsResponse"
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "total": 1,
                      "currentPage": 1,
                      "limit": 20,
                      "pages": 1,
                      "comments": [
                        {
                          "id": 501,
                          "postId": 101,
                          "authorId": "user-456",
                          "parentId": 0,
                          "isPrivate": false,
                          "body": "Comment text",
                          "createdAt": "2026-04-01T13:00:00.000Z",
                          "updatedAt": "2026-04-01T13:00:00.000Z"
                        }
                      ]
                    }
                  },
                  "comments_page": {
                    "summary": "Paginated comments for a post",
                    "value": {
                      "total": 1,
                      "currentPage": 1,
                      "limit": 20,
                      "pages": 1,
                      "comments": [
                        {
                          "id": 501,
                          "postId": 101,
                          "authorId": "user-456",
                          "parentId": 0,
                          "isPrivate": false,
                          "body": "Comment text",
                          "createdAt": "2026-04-01T13:00:00.000Z",
                          "updatedAt": "2026-04-01T13:00:00.000Z"
                        }
                      ]
                    }
                  },
                  "no_comments": {
                    "summary": "Post with no comments",
                    "value": {
                      "total": 0,
                      "currentPage": 1,
                      "limit": 20,
                      "pages": 0,
                      "comments": []
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Quran Reflect lesson or reflection not found"
          }
        },
        "tags": ["Quran Reflect Lessons and Reflections"],
        "servers": [
          {
            "url": "https://apis-prelive.quran.foundation",
            "description": "Pre-production Server"
          },
          {
            "url": "https://apis.quran.foundation",
            "description": "Production Server"
          }
        ],
        "security": [
          {
            "x-auth-token": [],
            "x-client-id": []
          }
        ]
      }
    },
    "/quran-reflect/v1/posts/{id}/all-comments": {
      "get": {
        "operationId": "PostsController_getAllComment",
        "summary": "Get All Comments for a Quran Reflect Lesson or Reflection",
        "description": "Retrieve all comments for a Quran Reflect lesson or reflection post in a single request without pagination. The response returns the full `comments` array and the `total` comment count. Useful for displaying complete lesson or reflection comment threads, exports, or offline indexing. Full gateway path is `/quran-reflect/v1/posts/{id}/all-comments`; this is not a `/content/api/v4` endpoint. This Quran Reflect endpoint is compatible with the `client_credentials` grant and requires `x-auth-token` and `x-client-id` with the `comment.read` scope. User-bound tokens may still influence comment visibility.",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Unique numeric Quran Reflect lesson or reflection post ID.",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "All comments for the Quran Reflect lesson or reflection returned with total count",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostAllCommentsResponse"
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "total": 1,
                      "comments": [
                        {
                          "id": 501,
                          "postId": 101,
                          "authorId": "user-456",
                          "parentId": 0,
                          "isPrivate": false,
                          "body": "Comment text",
                          "createdAt": "2026-04-01T13:00:00.000Z",
                          "updatedAt": "2026-04-01T13:00:00.000Z"
                        }
                      ]
                    }
                  },
                  "all_comments_flat_list": {
                    "summary": "All comments for a post",
                    "value": {
                      "total": 1,
                      "comments": [
                        {
                          "id": 501,
                          "postId": 101,
                          "authorId": "user-456",
                          "parentId": 0,
                          "isPrivate": false,
                          "body": "Comment text",
                          "createdAt": "2026-04-01T13:00:00.000Z",
                          "updatedAt": "2026-04-01T13:00:00.000Z"
                        }
                      ]
                    }
                  },
                  "no_comments": {
                    "summary": "Post with no comments",
                    "value": {
                      "total": 0,
                      "comments": []
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Quran Reflect lesson or reflection not found"
          }
        },
        "tags": ["Quran Reflect Lessons and Reflections"],
        "servers": [
          {
            "url": "https://apis-prelive.quran.foundation",
            "description": "Pre-production Server"
          },
          {
            "url": "https://apis.quran.foundation",
            "description": "Production Server"
          }
        ],
        "security": [
          {
            "x-auth-token": [],
            "x-client-id": []
          }
        ]
      }
    },
    "/chapter_recitations/{reciter_id}": {
      "get": {
        "tags": ["Audio"],
        "summary": "List of all chapter audio files of a reciter",
        "description": "Get list of chapters' audio files of a reciter.",
        "operationId": "chapter-reciter-audio-files",
        "parameters": [
          {
            "name": "reciter_id",
            "in": "path",
            "description": "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.",
            "required": true,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "required": ["audio_files"],
                  "type": "object",
                  "properties": {
                    "audio_files": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/chapter-recitation"
                      }
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "audio_files": [
                        {
                          "id": 43,
                          "chapter_id": 22,
                          "file_size": 19779712,
                          "format": "mp3",
                          "audio_url": "https://download.quranicaudio.com/quran/abdullaah_3awwaad_al-juhaynee//022.mp3"
                        },
                        {
                          "id": 87,
                          "chapter_id": 44,
                          "file_size": 6453376,
                          "format": "mp3",
                          "audio_url": "https://download.quranicaudio.com/quran/abdullaah_3awwaad_al-juhaynee//044.mp3"
                        }
                      ]
                    }
                  },
                  "available_chapter_files": {
                    "summary": "Chapter-level audio files for a reciter",
                    "value": {
                      "audio_files": [
                        {
                          "id": 43,
                          "chapter_id": 22,
                          "file_size": 19779712,
                          "format": "mp3",
                          "audio_url": "https://download.quranicaudio.com/quran/abdullaah_3awwaad_al-juhaynee/022.mp3"
                        },
                        {
                          "id": 87,
                          "chapter_id": 44,
                          "file_size": 6453376,
                          "format": "mp3",
                          "audio_url": "https://download.quranicaudio.com/quran/abdullaah_3awwaad_al-juhaynee/044.mp3"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        }
      }
    },
    "/chapter_recitations/{reciter_id}/{chapter_number}": {
      "get": {
        "tags": ["Audio"],
        "summary": "Get chapter's audio file of a reciter",
        "description": "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.",
        "operationId": "chapter-reciter-audio-file",
        "parameters": [
          {
            "name": "reciter_id",
            "in": "path",
            "description": "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.",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "chapter_number",
            "in": "path",
            "description": "The number of the chapter",
            "required": true,
            "schema": {
              "maximum": 114,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "name": "segments",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "If true, each verse timestamp includes a `segments` array of [word_index, start_ms, end_ms] triplets. Time values are in milliseconds."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChapterReciterAudioFileResponse"
                },
                "examples": {
                  "default_no_segments": {
                    "summary": "segments=false (default)",
                    "value": {
                      "audio_file": {
                        "id": 457,
                        "chapter_id": 1,
                        "file_size": 710784,
                        "format": "mp3",
                        "audio_url": "https://download.quranicaudio.com/qdc/abu_bakr_shatri/murattal/1.mp3"
                      }
                    }
                  },
                  "with_segments_true": {
                    "summary": "segments=true (includes timestamps + segments)",
                    "value": {
                      "audio_file": {
                        "id": 457,
                        "chapter_id": 1,
                        "file_size": 710784,
                        "format": "mp3",
                        "audio_url": "https://download.quranicaudio.com/qdc/abu_bakr_shatri/murattal/1.mp3",
                        "timestamps": [
                          {
                            "verse_key": "1:1",
                            "timestamp_from": 0,
                            "timestamp_to": 6493,
                            "duration": -6493,
                            "segments": [
                              [1, 0, 630],
                              [2, 650, 1570],
                              [3, 1570, 3110],
                              [4, 3110, 5590]
                            ]
                          },
                          {
                            "verse_key": "1:2",
                            "timestamp_from": 6493,
                            "timestamp_to": 11546,
                            "duration": -5053,
                            "segments": [
                              [1, 6493, 7243],
                              [2, 7243, 8123],
                              [3, 8143, 8723],
                              [4, 8723, 11193]
                            ]
                          },
                          {
                            "verse_key": "1:3",
                            "timestamp_from": 11546,
                            "timestamp_to": 15985,
                            "duration": -4439,
                            "segments": [
                              [1, 11546, 12806],
                              [2, 12916, 15366]
                            ]
                          },
                          {
                            "verse_key": "1:4",
                            "timestamp_from": 15985,
                            "timestamp_to": 21521,
                            "duration": -5536,
                            "segments": [
                              [1, 15985, 16505],
                              [2, 16705, 17235],
                              [3, 17265, 19155]
                            ]
                          },
                          {
                            "verse_key": "1:5",
                            "timestamp_from": 21521,
                            "timestamp_to": 27835,
                            "duration": -6314,
                            "segments": [
                              [1, 21521, 22591],
                              [2, 22591, 23471],
                              [3, 23631, 25001],
                              [4, 25001, 27391]
                            ]
                          },
                          {
                            "verse_key": "1:6",
                            "timestamp_from": 27835,
                            "timestamp_to": 33388,
                            "duration": -5553,
                            "segments": [
                              [1, 27835, 28265],
                              [2, 28265, 29405],
                              [3, 29405, 32545]
                            ]
                          },
                          {
                            "verse_key": "1:7",
                            "timestamp_from": 33388,
                            "timestamp_to": 53092,
                            "duration": -19704,
                            "segments": [
                              [1, 33388, 34338],
                              [2, 34338, 35448],
                              [3, 35518, 36698],
                              [4, 36718, 38678],
                              [5, 38678, 39608],
                              [6, 39628, 41638],
                              [7, 41638, 43778],
                              [8, 43778, 44218],
                              [9, 44338, 51818]
                            ]
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        }
      }
    },
    "/verses/by_rub_el_hizb/{rub_el_hizb_number}": {
      "get": {
        "tags": ["Verses"],
        "summary": "By Rub el Hizb number (alias: /by_rub_el_hizb)",
        "description": "Get all verses of a specific Rub el Hizb number(1-240). Alias route for the same rub el hizb filter.",
        "operationId": "verses-by_rub_el_hizb_number-rub-el-hizb",
        "parameters": [
          {
            "name": "rub_el_hizb_number",
            "in": "path",
            "description": "Rub el Hizb number(1-240)",
            "required": true,
            "schema": {
              "maximum": 240,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "language",
            "in": "query",
            "description": "Language to fetch word-by-word translation in a specific language.",
            "schema": {
              "type": "string",
              "default": "en"
            }
          },
          {
            "name": "words",
            "in": "query",
            "description": "Include words of each ayah? Use this to fetch word-by-word translation and transliteration.\n\n0 or false will not include words.\n\n1 or true will include the words.\n\nDefault is false.",
            "schema": {
              "type": "string",
              "default": "false",
              "enum": ["true", "false"]
            }
          },
          {
            "name": "translations",
            "in": "query",
            "description": "comma separated ids of translations to load for each ayah. See [/resources/translations](/docs/content_apis_versioned/translations) for available ids. Use translations=57 to include full-ayah transliteration.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "audio",
            "in": "query",
            "description": "Ayah-by-ayah recitation ID from [/resources/recitations](/docs/content_apis_versioned/recitations). Chapter-reciter IDs from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters) are not supported.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "tafsirs",
            "in": "query",
            "description": "Comma separated ids of tafsirs to load for each ayah if you want to load tafsirs. See [/resources/tafsirs](/docs/content_apis_versioned/tafsirs) for available ids.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "word_fields",
            "in": "query",
            "description": "Comma-separated list of word-level fields to include in response. [See full field reference](/docs/api/field-reference#word-level-fields).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "translation_fields",
            "in": "query",
            "description": "Comma separated list of translation fields if you want to add more fields for each translation. [See full field reference](/docs/api/field-reference#translation-fields).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tafsir_fields",
            "in": "query",
            "description": "Comma separated list of tafsir fields if you want to add more fields for each tafsir. [See full field reference](/docs/api/field-reference#tafsir-fields).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated list of verse-level fields to include in response. Use `fields=text_uthmani,text_indopak` to include Arabic text. [See full field reference](/docs/api/field-reference#verse-level-fields).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "verses": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/verse"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/pagination"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "verses": [
                        {
                          "id": 1,
                          "verse_number": 1,
                          "page_number": 1,
                          "verse_key": "1:1",
                          "juz_number": 1,
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "sajdah_type": null,
                          "sajdah_number": null,
                          "words": [
                            {
                              "id": 1,
                              "position": 1,
                              "audio_url": "wbw/001_001_001.mp3",
                              "char_type_name": "word",
                              "line_number": 2,
                              "page_number": 1,
                              "code_v1": "&#xfb51;",
                              "translation": {
                                "text": "In (the) name",
                                "language_name": "english"
                              },
                              "transliteration": {
                                "text": "bis'mi",
                                "language_name": "english"
                              }
                            }
                          ],
                          "translations": [
                            {
                              "resource_id": 131,
                              "text": "In the Name of Allah—the Most Compassionate, Most Merciful."
                            }
                          ],
                          "tafsirs": [
                            {
                              "id": 82641,
                              "language_name": "english",
                              "name": "Tafsir Ibn Kathir",
                              "text": "<h2 class=\"title\">Which was revealed in Makkah</h2><h2 class=\"title\">The Meaning of Al-Fatihah and its Various Names</h2>"
                            }
                          ]
                        }
                      ],
                      "pagination": {
                        "per_page": 1,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 7,
                        "total_records": 7
                      }
                    }
                  },
                  "compact_fields": {
                    "summary": "Compact verse fields for navigation views",
                    "value": {
                      "verses": [
                        {
                          "id": 255,
                          "chapter_id": 2,
                          "verse_number": 255,
                          "verse_key": "2:255",
                          "verse_index": 262,
                          "juz_number": 3,
                          "hizb_number": 5,
                          "rub_el_hizb_number": 19,
                          "page_number": 42
                        }
                      ],
                      "pagination": {
                        "per_page": 1,
                        "current_page": 1,
                        "next_page": null,
                        "total_pages": 1,
                        "total_records": 1
                      }
                    }
                  },
                  "with_words_translation_tafsir_audio": {
                    "summary": "Verse payload with words, translation, tafsir, and audio",
                    "value": {
                      "verses": [
                        {
                          "id": 1,
                          "chapter_id": 1,
                          "verse_number": 1,
                          "page_number": 1,
                          "verse_key": "1:1",
                          "juz_number": 1,
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "sajdah_type": null,
                          "sajdah_number": null,
                          "audio": {
                            "verse_key": "1:1",
                            "url": "https://verses.quran.foundation/Alafasy/mp3/001001.mp3"
                          },
                          "words": [
                            {
                              "id": 1,
                              "position": 1,
                              "audio_url": "wbw/001_001_001.mp3",
                              "char_type_name": "word",
                              "line_number": 2,
                              "page_number": 1,
                              "code_v1": "&#xfb51;",
                              "translation": {
                                "text": "In (the) name",
                                "language_name": "english"
                              },
                              "transliteration": {
                                "text": "bis'mi",
                                "language_name": "english"
                              }
                            }
                          ],
                          "translations": [
                            {
                              "resource_id": 131,
                              "resource_name": "Dr. Mustafa Khattab, the Clear Quran",
                              "text": "In the Name of Allah?the Most Compassionate, Most Merciful."
                            }
                          ],
                          "tafsirs": [
                            {
                              "id": 82641,
                              "resource_id": 169,
                              "language_name": "english",
                              "name": "Tafsir Ibn Kathir",
                              "text": "<h2 class=\"title\">The Meaning of Al-Fatihah and its Various Names</h2>"
                            }
                          ]
                        }
                      ],
                      "pagination": {
                        "per_page": 1,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 7,
                        "total_records": 7
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        }
      }
    },
    "/translations/{resource_id}/by_rub/{rub_el_hizb_number}": {
      "get": {
        "tags": ["Translations"],
        "summary": "Get translations for specific Rub el Hizb (alias: /by_rub)",
        "description": "Get list of translations for a specific Rub el Hizb. Alias route for the same rub el hizb filter.",
        "operationId": "list-rub-el-hizb-translations-rub",
        "parameters": [
          {
            "name": "resource_id",
            "in": "path",
            "description": "Translation resource ID",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "rub_el_hizb_number",
            "in": "path",
            "required": true,
            "schema": {
              "maximum": 240,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated list of extra translation fields to include. Supported values: chapter_id, verse_number, verse_key, juz_number, hizb_number, rub_el_hizb_number, page_number, ruku_number, manzil_number, resource_name, language_name, language_id, id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "For paginating within the result",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "records per api call, you can get maximum 50 records.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "translations": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/translation"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/pagination"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "translations": [
                        {
                          "id": 215201,
                          "resource_id": 20,
                          "text": "In the Name of Allah-the Most Compassionate, Most Merciful."
                        },
                        {
                          "id": 215202,
                          "resource_id": 20,
                          "text": "All praise is for Allah, Lord of all worlds."
                        }
                      ],
                      "pagination": {
                        "per_page": 50,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 12,
                        "total_records": 600
                      }
                    }
                  },
                  "paginated_translation_rows": {
                    "summary": "Paginated translation rows",
                    "value": {
                      "translations": [
                        {
                          "resource_id": 131,
                          "resource_name": "Dr. Mustafa Khattab, the Clear Quran",
                          "id": 903958,
                          "text": "In the Name of Allah?the Most Compassionate, Most Merciful.",
                          "verse_id": 1,
                          "language_id": 38,
                          "language_name": "english",
                          "verse_key": "1:1",
                          "chapter_id": 1,
                          "verse_number": 1,
                          "juz_number": 1,
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "page_number": 1,
                          "ruku_number": 1,
                          "manzil_number": 1,
                          "foot_notes": {
                            "1": "Some editions include a translator footnote here."
                          }
                        }
                      ],
                      "pagination": {
                        "per_page": 1,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 7,
                        "total_records": 7
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        }
      }
    },
    "/tafsirs/{resource_id}/by_rub/{rub_el_hizb_number}": {
      "get": {
        "tags": ["Tafsirs"],
        "summary": "Get tafsirs for specific Rub el Hizb (alias: /by_rub)",
        "description": "Get list of tafsirs for a specific Rub el Hizb. Alias route for the same rub el hizb filter.",
        "operationId": "list-rub-el-hizb-tafsirs-rub",
        "parameters": [
          {
            "name": "resource_id",
            "in": "path",
            "description": "Tafsir resource ID",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "rub_el_hizb_number",
            "in": "path",
            "required": true,
            "schema": {
              "maximum": 240,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated list of extra tafsir fields to include. Supported values: chapter_id, verse_number, verse_key, juz_number, hizb_number, rub_el_hizb_number, page_number, ruku_number, manzil_number, resource_name, language_name, language_id, id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "For paginating within the result",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "records per api call, you can get maximum 50 records.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tafsirs": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/tafsir"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/pagination"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "tafsirs": [
                        {
                          "id": 82641,
                          "resource_id": 169,
                          "verse_key": "1:1",
                          "language_id": 38,
                          "text": "<h2 class=\"title\">Which was revealed in Makkah</h2><h2 class=\"title\">The Meaning of Al-Fatihah and its Various Names</h2>",
                          "slug": "tafsir-ibn-kathir"
                        }
                      ],
                      "pagination": {
                        "per_page": 50,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 12,
                        "total_records": 600
                      }
                    }
                  },
                  "paginated_tafsir_rows": {
                    "summary": "Paginated tafsir rows",
                    "value": {
                      "tafsirs": [
                        {
                          "id": 82641,
                          "resource_id": 169,
                          "verse_id": 1,
                          "language_id": 38,
                          "text": "<p>Bismillah is a verse of the Holy Qur'an.</p>",
                          "language_name": "english",
                          "resource_name": "Tafsir Ibn Kathir",
                          "verse_key": "1:1",
                          "chapter_id": 1,
                          "verse_number": 1,
                          "juz_number": 1,
                          "hizb_number": 1,
                          "rub_el_hizb_number": 1,
                          "page_number": 1,
                          "ruku_number": 1,
                          "manzil_number": 1,
                          "slug": "tafsir-ibn-kathir"
                        }
                      ],
                      "pagination": {
                        "per_page": 1,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 7,
                        "total_records": 7
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        }
      }
    },
    "/recitations/{recitation_id}/by_rub_el_hizb/{rub_el_hizb_number}": {
      "get": {
        "tags": ["Audio"],
        "summary": "Get Ayah recitations for specific Rub el Hizb (alias: /by_rub_el_hizb)",
        "description": "Get list of ayah AudioFile for a Rub el Hizb. Alias route for the same rub el hizb filter.",
        "operationId": "list-rub-el-hizb-recitation-rub-el-hizb",
        "parameters": [
          {
            "name": "recitation_id",
            "in": "path",
            "description": "Ayah-by-ayah recitation ID from [/resources/recitations](/docs/content_apis_versioned/recitations). Do not use chapter-reciter IDs from [/resources/chapter_reciters](/docs/content_apis_versioned/chapter-reciters) here.",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "rub_el_hizb_number",
            "in": "path",
            "required": true,
            "schema": {
              "maximum": 240,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Comma-separated list of extra audio file fields to include. Supported values: chapter_id, verse_number, verse_key, juz_number, hizb_number, rub_el_hizb_number, page_number, ruku_number, manzil_number, format, url, segments, duration, id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "For paginating within the result",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "records per api call, you can get maximum 50 records.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "required": ["audio_files", "pagination"],
                  "type": "object",
                  "properties": {
                    "audio_files": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/audiofile"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/pagination"
                    }
                  }
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "audio_files": [
                        {
                          "verse_key": "1:1",
                          "url": "AbdulBaset/Mujawwad/mp3/001001.mp3"
                        },
                        {
                          "verse_key": "1:2",
                          "url": "AbdulBaset/Mujawwad/mp3/001002.mp3"
                        },
                        {
                          "verse_key": "1:3",
                          "url": "AbdulBaset/Mujawwad/mp3/001003.mp3"
                        }
                      ],
                      "pagination": {
                        "per_page": 10,
                        "current_page": 1,
                        "next_page": 2,
                        "total_pages": 15,
                        "total_records": 148
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        }
      }
    },
    "/answers/by_ayah/{ayah_key}": {
      "get": {
        "tags": ["Answers"],
        "summary": "Get answers for specific Ayah",
        "description": "Get the published questions and answers shown under a specific ayah. Non-Arabic languages resolve to English upstream. This upstream endpoint uses the query parameter name `pageSize` instead of the API-wide `per_page` convention. If `page` is omitted, pagination is not applied even when `pageSize` is provided.",
        "operationId": "list-ayah-answers",
        "parameters": [
          {
            "name": "ayah_key",
            "in": "path",
            "description": "Ayah key in `chapter:verse` format, for example `2:255`.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "1-based page number. When omitted, pagination is not applied.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Page size when `page` is provided. This upstream endpoint uses `pageSize` instead of the API-wide `per_page` convention. Maximum 10.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10
            }
          },
          {
            "name": "language",
            "in": "query",
            "description": "Requested language. `ar` returns Arabic; every other language resolves to English upstream.",
            "schema": {
              "type": "string",
              "default": "en"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnswersByAyahResponse"
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "questions": [
                        {
                          "id": "question-1",
                          "body": "What is the context of this ayah?",
                          "type": "CLARIFICATION",
                          "ranges": ["2:255"],
                          "surah": 2,
                          "theme": ["Faith"],
                          "references": ["Tafsir al-Tabari"],
                          "language": "en",
                          "status": "Published",
                          "answers": [
                            {
                              "id": "answer-1",
                              "body": "This ayah is known as Ayat al-Kursi.",
                              "answeredBy": "Scholar",
                              "status": "Published",
                              "language": "en"
                            }
                          ]
                        }
                      ],
                      "totalCount": 1
                    }
                  },
                  "questions_found": {
                    "summary": "Ayah with published answers",
                    "value": {
                      "questions": [
                        {
                          "id": "question-1",
                          "body": "What is the context of this ayah?",
                          "type": "CLARIFICATION",
                          "ranges": ["2:255"],
                          "surah": 2,
                          "theme": ["Faith"],
                          "references": ["Tafsir al-Tabari"],
                          "language": "en",
                          "status": "Published",
                          "answers": [
                            {
                              "id": "answer-1",
                              "body": "This ayah is known as Ayat al-Kursi.",
                              "answeredBy": "Scholar",
                              "status": "Published",
                              "language": "en"
                            }
                          ]
                        }
                      ],
                      "totalCount": 1
                    }
                  },
                  "no_questions": {
                    "summary": "Ayah with no answers",
                    "value": {
                      "questions": [],
                      "totalCount": 0
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/answersInvalidParameter"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        }
      }
    },
    "/answers/{question_id}": {
      "get": {
        "tags": ["Answers"],
        "summary": "Get answer thread by question ID",
        "description": "Get a single published question with its published answers. This endpoint does not accept a language filter and preserves the internal answers payload without extra language filtering.",
        "operationId": "get-answer-by-id",
        "parameters": [
          {
            "name": "question_id",
            "in": "path",
            "description": "Question identifier from the answers payload.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnswersQuestionDto"
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "id": "question-1",
                      "body": "What is the context of this ayah?",
                      "type": "CLARIFICATION",
                      "ranges": ["2:255"],
                      "surah": 2,
                      "theme": ["Faith"],
                      "references": ["Tafsir al-Tabari"],
                      "language": "en",
                      "status": "Published",
                      "answers": [
                        {
                          "id": "answer-1",
                          "body": "This ayah is known as Ayat al-Kursi.",
                          "answeredBy": "Scholar",
                          "status": "Published",
                          "language": "en"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/answersNotFound"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        }
      }
    },
    "/answers/count_within_range": {
      "get": {
        "tags": ["Answers"],
        "summary": "Count answers within a verse range",
        "description": "Get per-verse counts of published questions within a range. Non-Arabic languages resolve to English upstream. This endpoint preserves the internal range-limit behavior exactly: it rejects ranges where `to_index - from_index > 30`.",
        "operationId": "count-answers-within-range",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "description": "Starting ayah key in `chapter:verse` format.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "Ending ayah key in `chapter:verse` format.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "language",
            "in": "query",
            "description": "Requested language. `ar` returns Arabic; every other language resolves to English upstream.",
            "schema": {
              "type": "string",
              "default": "en"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnswersCountWithinRangeResponse"
                },
                "examples": {
                  "default_success": {
                    "summary": "Successful response",
                    "value": {
                      "2:255": {
                        "types": {
                          "CLARIFICATION": 1,
                          "TAFSIR": 1
                        },
                        "total": 2
                      },
                      "2:256": {
                        "types": {
                          "TAFSIR": 1
                        },
                        "total": 1
                      }
                    }
                  },
                  "range_with_answer_counts": {
                    "summary": "Answer counts grouped by ayah and type",
                    "value": {
                      "2:255": {
                        "types": {
                          "CLARIFICATION": 1,
                          "TAFSIR": 1
                        },
                        "total": 2
                      },
                      "2:256": {
                        "types": {
                          "TAFSIR": 1
                        },
                        "total": 1
                      }
                    }
                  },
                  "range_with_no_answers": {
                    "summary": "Verse range with no answers",
                    "value": {
                      "1:1": {
                        "types": {},
                        "total": 0
                      },
                      "1:2": {
                        "types": {},
                        "total": 0
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/answersInvalidParameter"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "422": {
            "$ref": "#/components/responses/unprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        }
      }
    },
    "/resources/sync": {
      "get": {
        "tags": ["Resources"],
        "summary": "Sync public content resources",
        "description": "Use this endpoint when your app keeps a local copy of public Quran.Foundation content and needs to know what changed without downloading everything again.\n\nA resource is one public content item, such as `translations:19`, `tafsirs:151`, `recitations:10`, or `articles:123`. A full copy, called a snapshot in the API, is the complete current row list for one resource.\n\nWhen `next_page_url` or mutation `snapshot_url` is present and non-null, we return a relative `/api/v4/...` API path, such as `/api/v4/resources/sync?cursor=...` or `/api/v4/resources/snapshots/translations/19`. You should prefix that path with the Content service e.g.  `https://apis.quran.foundation/content`.\n\nRecommended client flow:\n1. First sync: call with `bootstrap=true` and a `resources` filter.\n2. Follow `next_page_url` until `has_more` is `false`.\n3. Fetch every non-null `snapshot_url` and replace the local rows for that resource.\n4. Store `next_sync_token` from the final page only.\n5. Later syncs: call with `sync_token` and the same canonical `resources` filter to receive only newer changes.\n\nChange handling:\n- `RESOURCE_CREATE` and `RESOURCE_INVALIDATE`: fetch `snapshot_url`, then replace all local rows for that resource.\n- `RESOURCE_DELETE`: remove or hide the full local resource.\n- `ROW_CREATE` and `ROW_UPDATE`: upsert one local row using `record_type` and `record_key`.\n- `ROW_DELETE`: delete one local row using `record_type` and `record_key`.\n- `RESOURCE_UPDATE`: freshness marker only. Keep existing local rows.\n\nBootstrap example:\n```bash\ncurl \"https://apis.quran.foundation/content/api/v4/resources/sync?bootstrap=true&resources=translations:19;tafsirs:151&per_page=100\" \\\n  -H \"x-auth-token: $ACCESS_TOKEN\" \\\n  -H \"x-client-id: $CLIENT_ID\"\n```\n\nIncremental example:\n```bash\ncurl \"https://apis.quran.foundation/content/api/v4/resources/sync?sync_token=$SYNC_TOKEN&resources=translations:19;tafsirs:151&per_page=100\" \\\n  -H \"x-auth-token: $ACCESS_TOKEN\" \\\n  -H \"x-client-id: $CLIENT_ID\"\n```\n\nSync responses are not cacheable and return `Cache-Control: no-store`.",
        "operationId": "resources-sync",
        "parameters": [
          {
            "name": "resources",
            "in": "query",
            "description": "Which public content your app wants to track. Required unless `cursor` is supplied. Format: `group:*` or `group:id,id`; groups are separated by semicolons. Store sync tokens per canonical/normalized resource filter.",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "articles:*;recitations:10;tafsirs:151;translations:1,6"
          },
          {
            "name": "bootstrap",
            "in": "query",
            "description": "Set to `true` for first sync. The response pages current public resources as `RESOURCE_CREATE` changes with `snapshot_url` values.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "sync_token",
            "in": "query",
            "description": "Opaque checkpoint returned by the final bootstrap or incremental page. Send it on the next sync with the same canonical `resources` filter.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Opaque pagination cursor from `next_page_url`. Use the returned relative path and do not construct cursors manually. Prefix the returned `/api/v4/...` path with the Content API gateway root: `https://apis.quran.foundation/content`.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "Maximum changes or bootstrap resources per page. Defaults to 50 and cannot exceed 100.",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful sync response",
            "headers": {
              "Cache-Control": {
                "description": "Always `no-store` for sync responses.",
                "schema": {
                  "type": "string",
                  "example": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContentSyncResponse"
                },
                "examples": {
                  "bootstrap_page": {
                    "summary": "First sync page",
                    "value": {
                      "sync": {
                        "sync_until_sequence": 98234,
                        "has_more": false,
                        "next_page_url": null,
                        "next_sync_token": "opaque-sync-token",
                        "mutations": [
                          {
                            "sequence": 98100,
                            "type": "RESOURCE_CREATE",
                            "resource_group": "translations",
                            "resource_id": 19,
                            "resource_content_id": 19,
                            "record_type": null,
                            "record_key": null,
                            "source_record_id": null,
                            "changed_at": "2026-05-05T10:00:00Z",
                            "data": null,
                            "snapshot_url": "/api/v4/resources/snapshots/translations/19",
                            "unavailable_reason": null
                          }
                        ]
                      }
                    }
                  },
                  "row_update_page": {
                    "summary": "Incremental row update",
                    "value": {
                      "sync": {
                        "sync_until_sequence": 98240,
                        "has_more": false,
                        "next_page_url": null,
                        "next_sync_token": "opaque-next-sync-token",
                        "mutations": [
                          {
                            "sequence": 98240,
                            "type": "ROW_UPDATE",
                            "resource_group": "translations",
                            "resource_id": 19,
                            "resource_content_id": 19,
                            "record_type": "translation",
                            "record_key": "85108",
                            "source_record_id": 85108,
                            "changed_at": "2026-05-05T10:05:00Z",
                            "data": {
                              "id": 85108,
                              "verse_key": "26:153",
                              "text": "They said: Thou art but one of the bewitched;"
                            },
                            "snapshot_url": null,
                            "unavailable_reason": null
                          }
                        ]
                      }
                    }
                  },
                  "no_changes_page": {
                    "summary": "No resource changes available",
                    "value": {
                      "sync": {
                        "sync_until_sequence": 98240,
                        "has_more": false,
                        "next_page_url": null,
                        "next_sync_token": "opaque-next-sync-token",
                        "mutations": []
                      }
                    }
                  },
                  "paginated_page": {
                    "summary": "Intermediate page with a relative next page URL",
                    "value": {
                      "sync": {
                        "sync_until_sequence": 98234,
                        "has_more": true,
                        "next_page_url": "/api/v4/resources/sync?cursor=OPAQUE",
                        "next_sync_token": null,
                        "mutations": [
                          {
                            "sequence": 98100,
                            "type": "RESOURCE_CREATE",
                            "resource_group": "translations",
                            "resource_id": 19,
                            "resource_content_id": 19,
                            "record_type": null,
                            "record_key": null,
                            "source_record_id": null,
                            "changed_at": "2026-05-05T10:00:00Z",
                            "data": null,
                            "snapshot_url": "/api/v4/resources/snapshots/translations/19",
                            "unavailable_reason": null
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "410": {
            "description": "The token or cursor is invalid, incompatible, or requires a fresh bootstrap.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContentSyncErrorResponse"
                },
                "examples": {
                  "resync_required": {
                    "summary": "Token or cursor cannot be used",
                    "value": {
                      "error": {
                        "code": "resync_required",
                        "message": "The sync token is invalid or incompatible. Bootstrap again."
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid resources filter, cursor, token, or page size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContentSyncErrorResponse"
                },
                "examples": {
                  "token_filter_mismatch": {
                    "summary": "Token used with the wrong resources filter",
                    "value": {
                      "error": {
                        "code": "token_filter_mismatch",
                        "message": "sync_token does not match the requested resources"
                      }
                    }
                  },
                  "cursor_filter_mismatch": {
                    "summary": "Cursor used with the wrong resources filter",
                    "value": {
                      "error": {
                        "code": "cursor_filter_mismatch",
                        "message": "cursor does not match the requested resources"
                      }
                    }
                  },
                  "cursor_per_page_mismatch": {
                    "summary": "Cursor used with the wrong page size",
                    "value": {
                      "error": {
                        "code": "cursor_per_page_mismatch",
                        "message": "cursor does not match the requested per_page"
                      }
                    }
                  },
                  "invalid_per_page": {
                    "summary": "Invalid page size",
                    "value": {
                      "error": {
                        "code": "invalid_per_page",
                        "message": "per_page cannot exceed 100"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        }
      }
    },
    "/resources/snapshots/{resource_group}/{id}": {
      "get": {
        "tags": ["Resources"],
        "summary": "Get content resource snapshot",
        "description": "Use this endpoint to fetch a full copy of one public content resource. The API calls this full copy a snapshot.\n\nA 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.\n\nTypical client flow:\n1. Call [GET /resources/sync](../resources-sync/).\n2. If a change has a non-null `snapshot_url`, call this endpoint using that change's `resource_group` and `resource_id`.\n3. Delete existing local rows for that one resource.\n4. Insert the returned `records` as the new local copy.\n5. Continue applying later sync changes normally.\n\nExample:\n```bash\ncurl \"https://apis.quran.foundation/content/api/v4/resources/snapshots/translations/19\" \\\n  -H \"x-auth-token: $ACCESS_TOKEN\" \\\n  -H \"x-client-id: $CLIENT_ID\"\n```\n\nSnapshots 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`.",
        "operationId": "resources-snapshot",
        "parameters": [
          {
            "name": "resource_group",
            "in": "path",
            "description": "Public content group. Supported values are `articles`, `recitations`, `tafsirs`, and `translations`.",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ContentSyncResourceGroup"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Resource ID within the selected group, such as translation resource `19` or tafsir resource `151`.",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful snapshot response",
            "headers": {
              "Cache-Control": {
                "description": "Always `no-store` for snapshot responses.",
                "schema": {
                  "type": "string",
                  "example": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContentResourceSnapshot"
                },
                "examples": {
                  "translation_snapshot": {
                    "summary": "Translation full copy",
                    "value": {
                      "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_snapshot": {
                    "summary": "Tafsir full copy",
                    "value": {
                      "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_snapshot": {
                    "summary": "Recitation full copy",
                    "value": {
                      "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_snapshot": {
                    "summary": "Article full copy",
                    "value": {
                      "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"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "description": "Resource snapshot is unavailable or not public.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContentSyncErrorResponse"
                },
                "examples": {
                  "snapshot_not_found": {
                    "summary": "Snapshot is not available",
                    "value": {
                      "error": {
                        "code": "snapshot_not_found",
                        "message": "Resource snapshot not found"
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid snapshot request, such as an unsupported resource group.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContentSyncErrorResponse"
                },
                "examples": {
                  "unknown_resource_group": {
                    "summary": "Unsupported resource group",
                    "value": {
                      "error": {
                        "code": "unknown_resource_group",
                        "message": "Unknown resource group: unknown"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/rateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "SegmentTriplet": {
        "type": "array",
        "minItems": 3,
        "maxItems": 3,
        "items": {
          "type": "integer",
          "format": "int32"
        },
        "description": "[word_index, start_ms, end_ms] triplet. word_index is 1-based."
      },
      "VerseTimestamp": {
        "type": "object",
        "required": ["verse_key", "timestamp_from", "timestamp_to", "duration"],
        "properties": {
          "verse_key": {
            "type": "string",
            "example": "1:1"
          },
          "timestamp_from": {
            "type": "integer",
            "format": "int32",
            "description": "Start offset in milliseconds from the beginning of the file.",
            "example": 0
          },
          "timestamp_to": {
            "type": "integer",
            "format": "int32",
            "description": "End offset in milliseconds from the beginning of the file.",
            "example": 6493
          },
          "duration": {
            "type": "integer",
            "format": "int32",
            "description": "Duration in milliseconds (mirrors source data; may be negative in legacy data).",
            "example": -6493
          },
          "segments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SegmentTriplet"
            },
            "description": "Present only when `segments=true`. Word-level timing triplets for the verse.",
            "nullable": true
          }
        }
      },
      "AudioFile": {
        "type": "object",
        "required": ["id", "chapter_id", "file_size", "format", "audio_url"],
        "properties": {
          "id": {
            "type": "integer",
            "example": 457
          },
          "chapter_id": {
            "type": "integer",
            "example": 1
          },
          "file_size": {
            "type": "number",
            "format": "float",
            "description": "File size in bytes.",
            "example": 710784
          },
          "format": {
            "type": "string",
            "example": "mp3"
          },
          "audio_url": {
            "type": "string",
            "format": "uri",
            "example": "https://download.quranicaudio.com/qdc/abu_bakr_shatri/murattal/1.mp3"
          },
          "timestamps": {
            "type": "array",
            "description": "Present when timing data is available. If `segments=true`, each item may include a `segments` array.",
            "items": {
              "$ref": "#/components/schemas/VerseTimestamp"
            }
          }
        }
      },
      "ChapterReciterAudioFileResponse": {
        "type": "object",
        "properties": {
          "audio_file": {
            "$ref": "#/components/schemas/AudioFile"
          }
        },
        "required": ["audio_file"]
      },
      "audiofile": {
        "title": "AudioFile",
        "type": "object",
        "properties": {
          "verse_key": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "example": {
          "verse_key": "1:1",
          "url": "https://verses.quran.foundation/AbdulBaset/Mujawwad/mp3/001001.mp3"
        },
        "required": ["verse_key", "url"]
      },
      "author": {
        "title": "Author",
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "id": {
            "type": "number"
          }
        },
        "example": {
          "name": "Dr. Ghali"
        }
      },
      "chapter-info": {
        "title": "Chapter Info",
        "required": [
          "id",
          "chapter_id",
          "language_name",
          "resource_id",
          "short_text",
          "source",
          "text"
        ],
        "type": "object",
        "properties": {
          "chapter_id": {
            "type": "integer"
          },
          "text": {
            "type": "string",
            "description": "Long chapter info text; may include HTML markup for formatting."
          },
          "short_text": {
            "type": "string"
          },
          "language_name": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "description": "Name of the source, such as a book or site title."
          },
          "id": {
            "type": "integer"
          },
          "resource_id": {
            "type": "integer"
          }
        },
        "example": {
          "chapter_id": 1,
          "text": "<h2>Name</h2>\n<p>This Surah is named Al-Fatihah because of its subject-matter. Fatihah opens the book and the subject.</p>",
          "short_text": "This Surah is named Al-Fatihah because of its subject-matter. Fatihah opens the book and the subject.",
          "language_name": "english",
          "source": "Sayyid Abul Ala Maududi - Tafhim al-Qur'an - The Meaning of the Quran",
          "id": 1,
          "resource_id": 58
        }
      },
      "language": {
        "title": "Language",
        "type": "object",
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "native_name": {
            "type": "string"
          },
          "iso_code": {
            "type": "string",
            "description": "iso code of the language, you'll pass this code in api calls for fetching content in specific language."
          },
          "direction": {
            "type": "string"
          },
          "translations_count": {
            "type": "integer",
            "description": "Number of translation resources available in this language."
          },
          "translated_name": {
            "$ref": "#/components/schemas/translated-name"
          }
        },
        "example": {
          "id": 38,
          "name": "English",
          "native_name": "English",
          "iso_code": "en",
          "direction": "ltr",
          "translations_count": 100,
          "translated_name": {
            "name": "English",
            "language_name": "english"
          }
        }
      },
      "media-content": {
        "title": "MediaContent",
        "type": "object",
        "properties": {
          "url": {
            "type": "string"
          },
          "embed_text": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "author_name": {
            "type": "string"
          }
        },
        "example": {
          "url": "https://www.youtube.com/embed/JyLuLv2hrAo?autoplay=1",
          "embed_text": "<iframe src=\"//www.youtube.com/embed/JyLuLv2hrAo?enablejsapi=1&wmode=transparent&iv_load_policy=3&origin=https%3A%2F%2Fquran.com&rel=0&autohide=1&autoplay=1\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"></iframe>",
          "provider": "YouTube",
          "author_name": "Bayyinah"
        }
      },
      "recitation": {
        "title": "Recitation",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "reciter_name": {
            "type": "string"
          },
          "style": {
            "type": "string"
          },
          "translated_name": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "language_name": {
                "type": "string"
              }
            }
          }
        },
        "example": {
          "id": 1,
          "reciter_name": "AbdulBaset AbdulSamad",
          "style": "Mujawwad",
          "translated_name": {
            "name": "AbdulBaset AbdulSamad",
            "language_name": "english"
          }
        }
      },
      "tafsir": {
        "title": "Tafsir",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "resource_id": {
            "type": "integer"
          },
          "verse_id": {
            "type": "integer"
          },
          "language_id": {
            "type": "integer"
          },
          "text": {
            "type": "string"
          },
          "language_name": {
            "type": "string"
          },
          "resource_name": {
            "type": "string"
          },
          "verse_key": {
            "type": "string"
          },
          "chapter_id": {
            "type": "integer"
          },
          "verse_number": {
            "type": "integer"
          },
          "juz_number": {
            "type": "integer"
          },
          "hizb_number": {
            "type": "integer"
          },
          "rub_el_hizb_number": {
            "type": "integer"
          },
          "page_number": {
            "type": "integer"
          },
          "ruku_number": {
            "type": "integer"
          },
          "manzil_number": {
            "type": "integer"
          },
          "slug": {
            "type": "string"
          }
        },
        "example": {
          "id": 82641,
          "resource_id": 169,
          "verse_id": 1,
          "language_id": 38,
          "text": "<p>Bismillah is a verse of the Holy Qur'an.</p>",
          "language_name": "english",
          "resource_name": "Tafsir Ibn Kathir",
          "verse_key": "1:1",
          "chapter_id": 1,
          "verse_number": 1,
          "juz_number": 1,
          "hizb_number": 1,
          "rub_el_hizb_number": 1,
          "page_number": 1,
          "ruku_number": 1,
          "manzil_number": 1,
          "slug": "tafsir-ibn-kathir"
        }
      },
      "translated-name": {
        "title": "TranslatedName",
        "required": ["language_name", "name"],
        "type": "object",
        "properties": {
          "language_name": {
            "type": "string",
            "default": "english"
          },
          "name": {
            "type": "string",
            "description": "Name of the resource in specific language."
          }
        },
        "example": {
          "language_name": "english",
          "name": "The Opener"
        }
      },
      "translation": {
        "title": "Translation",
        "required": ["resource_id", "text"],
        "type": "object",
        "properties": {
          "resource_id": {
            "type": "integer"
          },
          "resource_name": {
            "type": "string"
          },
          "id": {
            "type": "integer"
          },
          "text": {
            "type": "string",
            "description": "Text of the translation, text could have HTML tags for formatting and footnotes. "
          },
          "verse_id": {
            "type": "integer"
          },
          "language_id": {
            "type": "integer"
          },
          "language_name": {
            "type": "string"
          },
          "verse_key": {
            "type": "string"
          },
          "chapter_id": {
            "type": "integer"
          },
          "verse_number": {
            "type": "integer"
          },
          "juz_number": {
            "type": "integer"
          },
          "hizb_number": {
            "type": "integer"
          },
          "page_number": {
            "type": "integer"
          },
          "rub_el_hizb_number": {
            "type": "integer"
          },
          "ruku_number": {
            "type": "integer"
          },
          "manzil_number": {
            "type": "integer"
          },
          "foot_notes": {
            "type": "object",
            "description": "Map of footnote IDs to their text. Present when `foot_notes=true`.",
            "additionalProperties": {
              "type": "string"
            }
          }
        },
        "example": {
          "resource_id": 131,
          "resource_name": "Dr. Mustafa Khattab, the Clear Quran",
          "id": 903958,
          "text": "In the Name of Allah - the Most Compassionate, Most Merciful.",
          "verse_id": 1,
          "language_id": 38,
          "language_name": "english",
          "verse_key": "1:1",
          "chapter_id": 1,
          "verse_number": 1,
          "juz_number": 1,
          "hizb_number": 1,
          "rub_el_hizb_number": 1,
          "page_number": 1,
          "ruku_number": 1,
          "manzil_number": 1,
          "foot_notes": {
            "1": "Some editions note variant readings here."
          }
        }
      },
      "transliteration": {
        "title": "Transliteration",
        "type": "object",
        "properties": {
          "language_name": {
            "type": "string"
          },
          "text": {
            "type": "string"
          }
        }
      },
      "verse": {
        "title": "Verse",
        "required": [
          "hizb_number",
          "id",
          "juz_number",
          "page_number",
          "rub_el_hizb_number",
          "verse_key",
          "verse_number"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "chapter_id": {
            "type": "integer",
            "description": "Chapter number of this verse"
          },
          "verse_number": {
            "type": "integer"
          },
          "verse_key": {
            "type": "string",
            "description": "key of the verse, key is generated using chapter number and ayah number. e.g 1:1 is first ayah of first surah."
          },
          "verse_index": {
            "type": "integer"
          },
          "text_uthmani": {
            "type": "string",
            "description": "Ayah text in Uthmani Script.\n\nUthmani script is an old-fashion script used by the third Caliph, Uthman, to produce the first standard quran manuscript."
          },
          "text_uthmani_simple": {
            "type": "string",
            "description": "Uthmani script diacritic marks "
          },
          "text_imlaei": {
            "type": "string",
            "description": "Ayah text in Imla'ei script.\n\nImla'ei script, is the modern Arabic writing style which is currently in use."
          },
          "text_imlaei_simple": {
            "type": "string"
          },
          "text_indopak": {
            "type": "string"
          },
          "text_uthmani_tajweed": {
            "type": "string"
          },
          "juz_number": {
            "type": "integer"
          },
          "hizb_number": {
            "type": "integer"
          },
          "page_number": {
            "minimum": 1,
            "type": "integer",
            "description": "Page number for the returned verse. For mushaf-aware by_page responses, this follows the selected mushaf layout and can exceed 604."
          },
          "ruku_number": {
            "type": "integer"
          },
          "manzil_number": {
            "type": "integer"
          },
          "image_url": {
            "type": "string"
          },
          "image_width": {
            "type": "integer"
          },
          "words": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/word"
            }
          },
          "audio": {
            "$ref": "#/components/schemas/audiofile"
          },
          "translations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/translation"
            }
          },
          "code_v1": {
            "type": "string",
            "description": "Glyphs codes for QCF v1 fonts"
          },
          "code_v2": {
            "type": "string",
            "description": "Glyphs codes for QCF v2 fonts"
          },
          "v1_page": {
            "maximum": 604,
            "minimum": 1,
            "type": "integer",
            "description": "Madani Mushaf Page number for v1 font. If `v1_page` value is 2, that means you'll use page 2 font file to render this ayah using v1 glyph codes."
          },
          "v2_page": {
            "maximum": 604,
            "minimum": 1,
            "type": "integer",
            "description": "Madani Mushaf Page number for v2 font. If `v2_page` value is 2, that means you'll use page 2 font file to render this ayah using v2 glyph codes."
          },
          "rub_el_hizb_number": {
            "type": "integer"
          }
        },
        "example": {
          "id": 1,
          "chapter_id": 1,
          "verse_number": 1,
          "verse_key": "1:1",
          "verse_index": 1,
          "text_uthmani": "بِسْمِ ٱللَّهِ ٱلرَّحْمَـٰنِ ٱلرَّحِيمِ",
          "text_uthmani_simple": "بسم الله الرحمن الرحيم",
          "text_imlaei": "بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ",
          "text_imlaei_simple": "بسم الله الرحمن الرحيم",
          "text_indopak": "بِسۡمِ اللهِ الرَّحۡمٰنِ الرَّحِيۡمِ",
          "text_uthmani_tajweed": "بِسْمِ <tajweed class=ham_wasl>ٱ</tajweed>للَّهِ <tajweed class=ham_wasl>ٱ</tajweed><tajweed class=laam_shamsiyah>ل</tajweed>رَّحْمَ<tajweed class=madda_normal>ـٰ</tajweed>نِ <tajweed class=ham_wasl>ٱ</tajweed><tajweed class=laam_shamsiyah>ل</tajweed>رَّح<tajweed class=madda_permissible>ِي</tajweed>مِ <span class=end>١</span>",
          "juz_number": 1,
          "hizb_number": 1,
          "rub_el_hizb_number": 1,
          "page_number": 1,
          "image_url": "//c22506.r6.cf1.rackcdn.com/1_1.png",
          "image_width": 675,
          "words": [
            {
              "id": 1,
              "position": 1,
              "audio_url": "wbw/001_001_001.mp3",
              "char_type_name": "word",
              "translation": {
                "text": "In (the) name",
                "language_name": "english"
              },
              "transliteration": {
                "text": "bis'mi",
                "language_name": "english"
              }
            }
          ]
        }
      },
      "word": {
        "title": "Word",
        "required": [
          "audio_url",
          "char_type_name",
          "position",
          "translation",
          "transliteration"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "position": {
            "type": "integer",
            "description": "Word position within ayah"
          },
          "text_uthmani": {
            "type": "string",
            "description": "Word text in Uthmanic script"
          },
          "text_indopak": {
            "type": "string"
          },
          "text_imlaei": {
            "type": "string",
            "description": "Word text in simple/Imlaei script"
          },
          "verse_key": {
            "type": "string"
          },
          "page_number": {
            "minimum": 1,
            "type": "integer",
            "description": "Page number for the returned word. For mushaf-aware by_page responses, this follows the selected mushaf layout and can exceed 604."
          },
          "line_number": {
            "type": "integer",
            "description": "Line number in the Mushaf for this word"
          },
          "audio_url": {
            "type": "string"
          },
          "location": {
            "type": "string"
          },
          "char_type_name": {
            "type": "string"
          },
          "code_v1": {
            "type": "string",
            "description": "glyph code that you can use to render the word using QCF  v1 font."
          },
          "code_v2": {
            "type": "string",
            "description": "glyph code that you can use to render the word using QCF  v2 font."
          },
          "translation": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string"
              },
              "language_name": {
                "type": "string"
              }
            }
          },
          "transliteration": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string"
              },
              "language_name": {
                "type": "string"
              }
            }
          },
          "v1_page": {
            "maximum": 604,
            "minimum": 1,
            "type": "integer",
            "description": "Madani Mushaf Page number for v1 font. If `v1_page` value is 2, that means you'll use page 2 font file to render this word using v1 glyph codes."
          },
          "v2_page": {
            "maximum": 604,
            "minimum": 1,
            "type": "integer",
            "description": "Madani Mushaf Page number for v2 font. If `v2_page` value is 2, that means you'll use page 2 font file to render this ayah using v2 glyph codes."
          }
        },
        "example": {
          "id": 1,
          "position": 1,
          "text_uthmani": "بِسْمِ",
          "text_indopak": "بِسۡمِ",
          "text_imlaei": "بِسْمِ",
          "verse_key": "1:1",
          "page_number": 1,
          "line_number": 2,
          "audio_url": "wbw/001_001_001.mp3",
          "location": "1:1:1",
          "char_type_name": "word",
          "code_v1": "&#xfb51;",
          "translation": {
            "text": "In (the) name",
            "language_name": "english"
          },
          "transliteration": {
            "text": "bis'mi",
            "language_name": "english"
          }
        }
      },
      "chapter": {
        "title": "Chapter",
        "required": [
          "id",
          "revelation_place",
          "revelation_order",
          "bismillah_pre",
          "name_simple",
          "name_complex",
          "name_arabic",
          "verses_count",
          "pages",
          "translated_name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "revelation_place": {
            "type": "string"
          },
          "revelation_order": {
            "type": "integer"
          },
          "bismillah_pre": {
            "type": "boolean"
          },
          "name_complex": {
            "type": "string"
          },
          "name_arabic": {
            "type": "string"
          },
          "verses_count": {
            "type": "integer"
          },
          "pages": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "translated_name": {
            "$ref": "#/components/schemas/translated-name"
          },
          "name_simple": {
            "type": "string"
          }
        },
        "example": {
          "id": 1,
          "revelation_place": "makkah",
          "revelation_order": 5,
          "bismillah_pre": false,
          "name_complex": "Al-Fātiĥah",
          "name_arabic": "الفاتحة",
          "verses_count": 7,
          "pages": [1, 1],
          "translated_name": {
            "language_name": "english",
            "name": "The Opener"
          },
          "name_simple": "Al-Fatihah"
        }
      },
      "resource": {
        "title": "Resource",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "author_name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "language_name": {
            "type": "string"
          },
          "translated_name": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "language_name": {
                "type": "string"
              }
            }
          }
        },
        "example": {
          "id": 169,
          "name": "Tafsir Ibn Kathir",
          "author_name": "Hafiz Ibn Kathir",
          "slug": "en-tafsir-ibn-kathir",
          "language_name": "english",
          "translated_name": {
            "name": "Tafsir Ibn Kathir",
            "language_name": "english"
          }
        }
      },
      "pagination": {
        "title": "Pagination",
        "type": "object",
        "properties": {
          "per_page": {
            "type": "integer",
            "description": "Entries per api call"
          },
          "current_page": {
            "type": "integer",
            "description": "Current page in paginated result"
          },
          "next_page": {
            "type": "integer",
            "description": "Next page in paginated result",
            "nullable": true
          },
          "total_pages": {
            "type": "integer",
            "description": "Total number of pages"
          },
          "total_records": {
            "type": "integer"
          }
        },
        "example": {
          "per_page": 1,
          "current_page": 1,
          "next_page": 2,
          "total_pages": 7,
          "total_records": 7
        }
      },
      "juz": {
        "title": "Juz",
        "type": "object",
        "required": [
          "id",
          "juz_number",
          "verse_mapping",
          "first_verse_id",
          "last_verse_id",
          "verses_count"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "juz_number": {
            "type": "integer",
            "minimum": 1,
            "maximum": 30
          },
          "verse_mapping": {
            "type": "object",
            "description": "Mapping of chapter numbers to the verse range included in the section.",
            "additionalProperties": {
              "type": "string"
            }
          },
          "first_verse_id": {
            "type": "integer",
            "description": "ID of the first verse in this juz."
          },
          "last_verse_id": {
            "type": "integer",
            "description": "ID of the last verse in this juz."
          },
          "verses_count": {
            "type": "integer",
            "description": "Total verses in this juz."
          }
        },
        "example": {
          "id": 1,
          "juz_number": 1,
          "verse_mapping": {
            "1": "1-7",
            "2": "1-141"
          },
          "first_verse_id": 1,
          "last_verse_id": 148,
          "verses_count": 148
        }
      },
      "chapter-recitation": {
        "title": "Chapter Recitation",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "The Id of the audio file"
          },
          "chapter_id": {
            "type": "integer",
            "description": "The chapter id"
          },
          "file_size": {
            "type": "integer",
            "description": "The file size in bytes"
          },
          "format": {
            "type": "string",
            "description": "The format of the file"
          },
          "audio_url": {
            "type": "string",
            "description": "The audio file's url"
          }
        },
        "example": {
          "id": 1,
          "chapter_id": 1,
          "file_size": 710784,
          "format": "mp3",
          "audio_url": "https://download.quranicaudio.com/quran/abdullaah_3awwaad_al-juhaynee//001.mp3"
        },
        "required": ["id", "chapter_id", "file_size", "format", "audio_url"]
      },
      "chapter-reciters": {
        "title": "Chapter Reciters",
        "required": ["id", "name", "style", "qirat"],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Reciter ID"
          },
          "name": {
            "type": "string",
            "description": "Name of reciter in English"
          },
          "style": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "nullable": true
              },
              "language_name": {
                "type": "string"
              }
            },
            "required": ["language_name"]
          },
          "qirat": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "nullable": true
              },
              "language_name": {
                "type": "string"
              }
            },
            "required": ["language_name"]
          },
          "translated_name": {
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/translated-name"
              }
            ]
          }
        },
        "example": {
          "id": 3,
          "name": "Abu Bakr al-Shatri",
          "style": {
            "name": "Murattal",
            "language_name": "english"
          },
          "qirat": {
            "name": "Hafs",
            "language_name": "english"
          },
          "translated_name": {
            "name": "Abu Bakr al-Shatri",
            "language_name": "english"
          }
        }
      },
      "ListSurahRecitationAudioFile": {
        "type": "object",
        "required": ["verse_key", "url"],
        "properties": {
          "verse_key": {
            "type": "string",
            "example": "1:1"
          },
          "url": {
            "type": "string",
            "description": "Relative or absolute URL to the verse audio file.",
            "example": "Alafasy/mp3/001001.mp3"
          }
        }
      },
      "Pagination": {
        "type": "object",
        "required": [
          "per_page",
          "current_page",
          "total_pages",
          "total_records"
        ],
        "properties": {
          "per_page": {
            "type": "integer",
            "example": 10
          },
          "current_page": {
            "type": "integer",
            "example": 1
          },
          "next_page": {
            "type": "integer",
            "nullable": true,
            "example": null,
            "description": "Next page number, or null if this is the last page."
          },
          "total_pages": {
            "type": "integer",
            "example": 1
          },
          "total_records": {
            "type": "integer",
            "example": 7
          }
        }
      },
      "ListSurahRecitationResponse": {
        "type": "object",
        "required": ["audio_files", "pagination"],
        "properties": {
          "audio_files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ListSurahRecitationAudioFile"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/Pagination"
          }
        }
      },
      "commonErrorResponse": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "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"
            ]
          },
          "success": {
            "type": "boolean"
          }
        }
      },
      "invalidRequestResponse": {
        "$ref": "#/components/schemas/commonErrorResponse"
      },
      "unauthorizedResponse": {
        "$ref": "#/components/schemas/commonErrorResponse"
      },
      "forbiddenResponse": {
        "$ref": "#/components/schemas/commonErrorResponse"
      },
      "notFoundResponse": {
        "$ref": "#/components/schemas/commonErrorResponse"
      },
      "unprocessableEntityResponse": {
        "$ref": "#/components/schemas/commonErrorResponse"
      },
      "internalServerErrorResponse": {
        "$ref": "#/components/schemas/commonErrorResponse"
      },
      "badGatewayResponse": {
        "$ref": "#/components/schemas/commonErrorResponse"
      },
      "serviceUnavailableResponse": {
        "$ref": "#/components/schemas/commonErrorResponse"
      },
      "gatewayTimeoutResponse": {
        "$ref": "#/components/schemas/commonErrorResponse"
      },
      "rateLimitExceededResponse": {
        "$ref": "#/components/schemas/commonErrorResponse"
      },
      "hadith-error-response": {
        "title": "Hadith Error Response",
        "type": "object",
        "required": ["status", "error"],
        "properties": {
          "status": {
            "type": "integer"
          },
          "error": {
            "type": "object",
            "required": ["code", "message"],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "details": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "example": {
          "status": 400,
          "error": {
            "code": "INVALID_PARAMETER",
            "message": "Invalid ayah_key format. Expected format: chapter:verse (e.g., 12:12)",
            "details": {
              "parameter": "ayah_key",
              "provided": "12-12",
              "expected": "12:12"
            }
          }
        }
      },
      "hadith-grade": {
        "title": "Hadith Grade",
        "type": "object",
        "required": ["graded_by", "grade"],
        "properties": {
          "graded_by": {
            "type": "string"
          },
          "grade": {
            "type": "string"
          }
        },
        "example": {
          "graded_by": "Ahmad Muhammad Shakir",
          "grade": "Sahih"
        }
      },
      "hadith-text": {
        "title": "Hadith Text",
        "type": "object",
        "required": [
          "lang",
          "chapterNumber",
          "chapterTitle",
          "body",
          "urn",
          "grades"
        ],
        "properties": {
          "lang": {
            "type": "string"
          },
          "chapterNumber": {
            "type": "string"
          },
          "chapterTitle": {
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "urn": {
            "type": "integer"
          },
          "grades": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/hadith-grade"
            }
          }
        },
        "example": {
          "lang": "en",
          "chapterNumber": "1",
          "chapterTitle": "Revelation",
          "body": "Narrated Umar bin Al-Khattab:...",
          "urn": 31,
          "grades": [
            {
              "graded_by": "Ahmad Muhammad Shakir",
              "grade": "Sahih"
            }
          ]
        }
      },
      "hadith-collection": {
        "title": "Hadith Collection",
        "type": "object",
        "required": [
          "urn",
          "collection",
          "bookNumber",
          "chapterId",
          "hadithNumber",
          "name",
          "hadith"
        ],
        "properties": {
          "urn": {
            "type": "integer"
          },
          "collection": {
            "type": "string"
          },
          "bookNumber": {
            "type": "string"
          },
          "chapterId": {
            "type": "string"
          },
          "hadithNumber": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "hadith": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/hadith-text"
            }
          }
        },
        "example": {
          "urn": 201,
          "collection": "bukhari",
          "bookNumber": "1",
          "chapterId": "1",
          "hadithNumber": "1",
          "name": "Sahih al-Bukhari",
          "hadith": [
            {
              "lang": "en",
              "chapterNumber": "1",
              "chapterTitle": "Revelation",
              "body": "Narrated Umar bin Al-Khattab:...",
              "urn": 31,
              "grades": [
                {
                  "graded_by": "Ahmad Muhammad Shakir",
                  "grade": "Sahih"
                }
              ]
            }
          ]
        }
      },
      "hadith-reference": {
        "title": "Hadith Reference",
        "type": "object",
        "required": [
          "id",
          "collection",
          "hadith_number",
          "our_hadith_number",
          "arabic_urn",
          "english_urn",
          "surah_number",
          "ayah_start_number",
          "ayah_end_number"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "collection": {
            "type": "string"
          },
          "hadith_number": {
            "type": "string"
          },
          "our_hadith_number": {
            "type": "integer"
          },
          "arabic_urn": {
            "type": "integer"
          },
          "english_urn": {
            "type": "integer"
          },
          "surah_number": {
            "type": "integer"
          },
          "ayah_start_number": {
            "type": "integer"
          },
          "ayah_end_number": {
            "type": "integer"
          }
        },
        "example": {
          "id": 10,
          "collection": "bukhari",
          "hadith_number": "1",
          "our_hadith_number": 1,
          "arabic_urn": 111,
          "english_urn": 211,
          "surah_number": 12,
          "ayah_start_number": 11,
          "ayah_end_number": 12
        }
      },
      "hadith-references-by-ayah-response": {
        "title": "Hadith References By Ayah Response",
        "type": "object",
        "required": [
          "verse_key",
          "verse_number",
          "chapter_number",
          "language",
          "direction",
          "hadith_references"
        ],
        "properties": {
          "verse_key": {
            "type": "string"
          },
          "verse_number": {
            "type": "integer"
          },
          "chapter_number": {
            "type": "integer"
          },
          "language": {
            "type": "string"
          },
          "direction": {
            "type": "string"
          },
          "hadith_references": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/hadith-reference"
            }
          }
        }
      },
      "hadith-by-ayah-response": {
        "title": "Hadith By Ayah Response",
        "type": "object",
        "required": [
          "hadiths",
          "page",
          "limit",
          "has_more",
          "language",
          "direction"
        ],
        "properties": {
          "hadiths": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/hadith-collection"
            }
          },
          "page": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          },
          "has_more": {
            "type": "boolean"
          },
          "language": {
            "type": "string"
          },
          "direction": {
            "type": "string"
          }
        }
      },
      "hadith-count-within-range-response": {
        "title": "Hadith Count Within Range Response",
        "type": "object",
        "additionalProperties": {
          "type": "integer"
        },
        "example": {
          "12:12": 2,
          "12:13": 2
        }
      },
      "hizb": {
        "title": "Hizb",
        "type": "object",
        "required": [
          "id",
          "hizb_number",
          "verse_mapping",
          "first_verse_id",
          "last_verse_id",
          "verses_count"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "hizb_number": {
            "type": "integer",
            "minimum": 1,
            "maximum": 60
          },
          "verse_mapping": {
            "type": "object",
            "description": "Mapping of chapter numbers to the verse range included in the section.",
            "additionalProperties": {
              "type": "string"
            }
          },
          "first_verse_id": {
            "type": "integer",
            "description": "ID of the first verse in this hizb."
          },
          "last_verse_id": {
            "type": "integer",
            "description": "ID of the last verse in this hizb."
          },
          "verses_count": {
            "type": "integer",
            "description": "Total verses in this hizb."
          }
        },
        "example": {
          "id": 1,
          "hizb_number": 1,
          "verse_mapping": {
            "1": "1-77",
            "2": "78-141",
            "3": "142-176",
            "4": "177-286"
          },
          "first_verse_id": 1,
          "last_verse_id": 286,
          "verses_count": 286
        }
      },
      "rub-el-hizb": {
        "title": "Rub El Hizb",
        "type": "object",
        "required": [
          "id",
          "rub_el_hizb_number",
          "verse_mapping",
          "first_verse_id",
          "last_verse_id",
          "verses_count"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "rub_el_hizb_number": {
            "type": "integer",
            "minimum": 1,
            "maximum": 240
          },
          "verse_mapping": {
            "type": "object",
            "description": "Mapping of chapter numbers to the verse range included in the section.",
            "additionalProperties": {
              "type": "string"
            }
          },
          "first_verse_id": {
            "type": "integer",
            "description": "ID of the first verse in this Rubʿ al-Ḥizb."
          },
          "last_verse_id": {
            "type": "integer",
            "description": "ID of the last verse in this Rubʿ al-Ḥizb."
          },
          "verses_count": {
            "type": "integer",
            "description": "Total verses in this Rubʿ al-Ḥizb."
          }
        },
        "example": {
          "id": 1,
          "rub_el_hizb_number": 1,
          "verse_mapping": {
            "1": "1-26",
            "2": "27-43"
          },
          "first_verse_id": 1,
          "last_verse_id": 43,
          "verses_count": 43
        }
      },
      "ruku": {
        "title": "Ruku",
        "type": "object",
        "required": [
          "id",
          "ruku_number",
          "surah_ruku_number",
          "verse_mapping",
          "first_verse_id",
          "last_verse_id",
          "verses_count"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "ruku_number": {
            "type": "integer",
            "minimum": 1,
            "maximum": 558
          },
          "surah_ruku_number": {
            "type": "integer",
            "description": "Position of the ruku within its surah."
          },
          "verse_mapping": {
            "type": "object",
            "description": "Mapping of chapter numbers to the verse range included in the section.",
            "additionalProperties": {
              "type": "string"
            }
          },
          "first_verse_id": {
            "type": "integer",
            "description": "ID of the first verse in this ruku."
          },
          "last_verse_id": {
            "type": "integer",
            "description": "ID of the last verse in this ruku."
          },
          "verses_count": {
            "type": "integer",
            "description": "Total verses in this ruku."
          }
        },
        "example": {
          "id": 1,
          "ruku_number": 1,
          "surah_ruku_number": 1,
          "verse_mapping": {
            "1": "1-7"
          },
          "first_verse_id": 1,
          "last_verse_id": 7,
          "verses_count": 7
        }
      },
      "manzil": {
        "title": "Manzil",
        "type": "object",
        "required": [
          "id",
          "manzil_number",
          "verse_mapping",
          "first_verse_id",
          "last_verse_id",
          "verses_count"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "manzil_number": {
            "type": "integer",
            "minimum": 1,
            "maximum": 7
          },
          "verse_mapping": {
            "type": "object",
            "description": "Mapping of chapter numbers to the verse range included in the section.",
            "additionalProperties": {
              "type": "string"
            }
          },
          "first_verse_id": {
            "type": "integer",
            "description": "ID of the first verse in this manzil."
          },
          "last_verse_id": {
            "type": "integer",
            "description": "ID of the last verse in this manzil."
          },
          "verses_count": {
            "type": "integer",
            "description": "Total verses in this manzil."
          }
        },
        "example": {
          "id": 1,
          "manzil_number": 1,
          "verse_mapping": {
            "1": "1-148",
            "2": "1-152"
          },
          "first_verse_id": 1,
          "last_verse_id": 260,
          "verses_count": 260
        }
      },
      "foot-note": {
        "title": "Foot Note",
        "type": "object",
        "required": ["id", "text", "language_name"],
        "properties": {
          "id": {
            "type": "integer"
          },
          "text": {
            "type": "string",
            "description": "Footnote body. May include HTML markup."
          },
          "language_name": {
            "type": "string",
            "description": "Language display name."
          }
        },
        "example": {
          "id": 1,
          "text": "Some manuscripts record an additional marginal explanation for this verse.",
          "language_name": "english"
        }
      },
      "ReferenceAttributes": {
        "type": "object",
        "properties": {
          "chapterId": {
            "type": "number",
            "minimum": 1
          },
          "from": {
            "type": "number",
            "default": 0
          },
          "to": {
            "type": "number",
            "default": 0
          }
        },
        "required": ["chapterId", "from", "to"]
      },
      "PostTag": {
        "type": "object",
        "properties": {
          "language": {
            "type": "string"
          },
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          }
        },
        "required": ["id"]
      },
      "PostReference": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "from": {
            "type": "number"
          },
          "to": {
            "type": "number"
          },
          "chapterId": {
            "type": "number"
          }
        },
        "required": ["id"]
      },
      "UserAuthor": {
        "type": "object",
        "properties": {
          "postsCount": {
            "type": "number"
          },
          "avatarUrls": {
            "type": "object",
            "properties": {
              "small": {
                "required": true,
                "type": "string"
              },
              "medium": {
                "required": true,
                "type": "string"
              },
              "large": {
                "required": true,
                "type": "string"
              }
            }
          },
          "id": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "verified": {
            "type": "boolean",
            "default": false
          },
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "memberType": {
            "type": "number"
          }
        },
        "required": ["avatarUrls", "id"]
      },
      "PostRecentComment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number"
          },
          "author": {
            "$ref": "#/components/schemas/UserAuthor"
          },
          "body": {
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": ["id", "author", "body", "createdAt"]
      },
      "PostRoom": {
        "type": "object",
        "properties": {
          "isAdmin": {
            "type": "object"
          },
          "isOwner": {
            "type": "object"
          },
          "isPublic": {
            "type": "object"
          },
          "id": {
            "type": "number"
          },
          "subdomain": {
            "type": "string"
          },
          "roomType": {
            "type": "string"
          },
          "verified": {
            "type": "boolean",
            "default": false
          },
          "name": {
            "type": "string"
          },
          "_group": {
            "type": "string"
          }
        },
        "required": ["id"]
      },
      "UserWithMentionLocations": {
        "type": "object",
        "properties": {
          "postsCount": {
            "type": "number"
          },
          "avatarUrls": {
            "type": "object",
            "properties": {
              "small": {
                "required": true,
                "type": "string"
              },
              "medium": {
                "required": true,
                "type": "string"
              },
              "large": {
                "required": true,
                "type": "string"
              }
            }
          },
          "id": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "verified": {
            "type": "boolean",
            "default": false
          },
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "memberType": {
            "type": "number"
          },
          "locations": {
            "type": "object"
          },
          "followersCount": {
            "type": "number"
          },
          "displayName": {
            "type": "string"
          }
        },
        "required": ["avatarUrls", "id", "locations", "followersCount"]
      },
      "PostSerialized": {
        "type": "object",
        "properties": {
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PostTag"
            }
          },
          "references": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PostReference"
            }
          },
          "author": {
            "type": "object"
          },
          "recentComment": {
            "description": "Most recent visible comment summary when available. Use the dedicated comment endpoints to retrieve full comment objects.",
            "$ref": "#/components/schemas/PostRecentComment"
          },
          "room": {
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/PostRoom"
              }
            ]
          },
          "mentions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserWithMentionLocations"
            }
          },
          "isLiked": {
            "type": "boolean"
          },
          "isByFollowedUser": {
            "type": "boolean"
          },
          "isCommentedOn": {
            "type": "boolean"
          },
          "isSaved": {
            "type": "boolean"
          },
          "id": {
            "type": "number"
          },
          "authorId": {
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "discussionId": {
            "type": "number"
          },
          "draft": {
            "type": "boolean",
            "default": false
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "publishedAt": {
            "format": "date-time",
            "type": "string"
          },
          "global": {
            "type": "boolean"
          },
          "toxicityScore": {
            "type": "number"
          },
          "reported": {
            "type": "boolean",
            "default": false
          },
          "views": {
            "type": "number"
          },
          "removed": {
            "type": "boolean",
            "default": false
          },
          "verified": {
            "type": "boolean",
            "default": false
          },
          "roomPostStatus": {
            "description": "@description 0: OnlyMembers, 1: Publicly, 2: AsRoom",
            "default": 0,
            "enum": [0, 1, 2],
            "type": "number"
          },
          "hidden": {
            "type": "boolean",
            "default": false
          },
          "commentsCount": {
            "description": "Total number of comments on the post.",
            "type": "number",
            "default": 0
          },
          "likesCount": {
            "description": "Total number of likes on the post.",
            "type": "number",
            "default": 0
          },
          "viewsCount": {
            "type": "number",
            "default": 0
          },
          "languageId": {
            "type": "number"
          },
          "languageName": {
            "type": "string"
          },
          "moderationStatus": {
            "description": "featured = 1, // Like Sticky posts, will be featured for a time period.Shown at top in feed and partner apps\n\npromoted = 2, // High quality content.Shown at top(after featured) in feed and partner apps\n\nnormal = 3, // Default status, available in search, latest and popular tabs.In feed(if you're following the author)\n\nhidden = 4, // Visible only to author or moderators, or via private share link.\n\nprivate_note = 5, // Private notes, only visible to author or via private share link.These are the posts made \"private\" by moderators.\n\nrequested_review = 6, // User requested the review, treat them has hidden.Only visible to author and moderators\n\ndeleted = 30,",
            "enum": [1, 2, 3, 4, 5, 6, 30],
            "type": "number"
          },
          "reviewedAt": {
            "format": "date-time",
            "type": "string"
          },
          "featuredAt": {
            "format": "date-time",
            "type": "string"
          },
          "estimatedReadingTime": {
            "type": "number",
            "default": 0
          },
          "roomId": {
            "type": "number"
          },
          "postTypeId": {
            "description": "Numeric Quran Reflect post type identifier. `1` = Reflection. `2` = Lesson.",
            "type": "number"
          },
          "postTypeName": {
            "description": "Human-readable Quran Reflect post type name, such as `reflection` or `lesson`.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "authorId",
          "createdAt",
          "updatedAt",
          "commentsCount",
          "roomId",
          "postTypeId"
        ]
      },
      "FeedResponseDto": {
        "type": "object",
        "properties": {
          "total": {
            "type": "number",
            "example": 10
          },
          "currentPage": {
            "type": "number",
            "example": 1
          },
          "limit": {
            "type": "number",
            "example": 10
          },
          "pages": {
            "type": "number",
            "example": 1
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PostSerialized"
            }
          }
        },
        "required": ["total", "currentPage", "limit", "pages", "data"]
      },
      "CommentAuthor": {
        "type": "object",
        "properties": {
          "postsCount": {
            "type": "number"
          },
          "avatarUrls": {
            "type": "object",
            "properties": {
              "small": {
                "required": true,
                "type": "string"
              },
              "medium": {
                "required": true,
                "type": "string"
              },
              "large": {
                "required": true,
                "type": "string"
              }
            }
          },
          "id": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "verified": {
            "type": "boolean",
            "default": false
          },
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "memberType": {
            "type": "number"
          }
        },
        "required": ["avatarUrls", "id"]
      },
      "CommentTag": {
        "type": "object",
        "properties": {
          "language": {
            "type": "string"
          },
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "commentsCount": {
            "type": "number"
          }
        },
        "required": ["id"]
      },
      "Comment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number"
          },
          "postId": {
            "type": "number"
          },
          "authorId": {
            "type": "string"
          },
          "parentId": {
            "type": "number"
          },
          "isPrivate": {
            "type": "boolean",
            "default": false
          },
          "body": {
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "toxicityScore": {
            "type": "number"
          },
          "repliesCount": {
            "type": "number",
            "default": 0
          },
          "likesCount": {
            "type": "number",
            "default": 0
          },
          "reported": {
            "type": "boolean",
            "default": false
          },
          "removed": {
            "type": "boolean",
            "default": false
          },
          "hidden": {
            "type": "boolean",
            "default": false
          },
          "languageId": {
            "type": "number"
          },
          "languageName": {
            "type": "string"
          },
          "moderationStatus": {
            "type": "number"
          },
          "author": {
            "$ref": "#/components/schemas/CommentAuthor"
          },
          "mentions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserWithMentionLocations"
            }
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CommentTag"
            }
          }
        },
        "required": [
          "id",
          "postId",
          "authorId",
          "parentId",
          "isPrivate",
          "body",
          "createdAt",
          "updatedAt"
        ]
      },
      "PostCommentsResponse": {
        "type": "object",
        "properties": {
          "total": {
            "type": "number",
            "example": 10
          },
          "currentPage": {
            "type": "number",
            "example": 1
          },
          "limit": {
            "type": "number",
            "example": 10
          },
          "pages": {
            "type": "number",
            "example": 1
          },
          "comments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Comment"
            }
          }
        },
        "required": ["total", "currentPage", "limit", "pages", "comments"]
      },
      "PostAllCommentsResponse": {
        "type": "object",
        "properties": {
          "comments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Comment"
            }
          },
          "total": {
            "type": "number",
            "example": 10
          }
        },
        "required": ["comments", "total"]
      },
      "QuranVerseText": {
        "title": "Quran Verse Text",
        "type": "object",
        "required": ["id", "verse_key"],
        "properties": {
          "id": {
            "type": "integer"
          },
          "verse_key": {
            "type": "string"
          },
          "text_uthmani": {
            "type": "string"
          },
          "text_uthmani_simple": {
            "type": "string"
          },
          "text_uthmani_tajweed": {
            "type": "string"
          },
          "text_indopak": {
            "type": "string"
          },
          "text_indopak_nastaleeq": {
            "type": "string"
          },
          "text_imlaei": {
            "type": "string"
          },
          "text_imlaei_simple": {
            "type": "string"
          },
          "text_qpc_hafs": {
            "type": "string"
          },
          "text_qpc_nastaleeq": {
            "type": "string"
          },
          "image_url": {
            "type": "string"
          },
          "code_v1": {
            "type": "string"
          },
          "code_v2": {
            "type": "string"
          },
          "v1_page": {
            "type": "integer"
          },
          "v2_page": {
            "type": "integer"
          }
        },
        "example": {
          "id": 1,
          "verse_key": "1:1",
          "text_uthmani": "بِسْمِ ٱللَّهِ ٱلرَّحْمَـٰنِ ٱلرَّحِيمِ"
        }
      },
      "QuranFiltersMeta": {
        "type": "object",
        "required": ["filters"],
        "properties": {
          "filters": {
            "type": "object",
            "additionalProperties": {
              "oneOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            }
          }
        }
      },
      "QuranTranslationMeta": {
        "type": "object",
        "required": ["translation_name", "author_name", "filters"],
        "properties": {
          "translation_name": {
            "type": "string"
          },
          "author_name": {
            "type": "string"
          },
          "filters": {
            "type": "object",
            "additionalProperties": {
              "oneOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            }
          }
        }
      },
      "AnswersAnswerDto": {
        "title": "AnswerDTO",
        "type": "object",
        "required": ["id", "body", "status"],
        "properties": {
          "id": {
            "type": "string",
            "description": "Answer identifier."
          },
          "body": {
            "type": "string",
            "description": "Published answer body."
          },
          "answeredBy": {
            "type": "string",
            "description": "Display name of the responder."
          },
          "status": {
            "type": "string",
            "enum": ["Draft", "Published"]
          },
          "language": {
            "type": "string",
            "description": "Answer language ISO code when present."
          }
        }
      },
      "AnswersQuestionDto": {
        "title": "QuestionDTO",
        "type": "object",
        "required": [
          "id",
          "body",
          "type",
          "ranges",
          "surah",
          "status",
          "answers"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Question identifier."
          },
          "body": {
            "type": "string",
            "description": "Question text."
          },
          "type": {
            "type": "string",
            "enum": ["CLARIFICATION", "TAFSIR", "COMMUNITY"]
          },
          "ranges": {
            "type": "array",
            "description": "Verse ranges returned by the internal DTO, e.g. 2:255-2:257.",
            "items": {
              "type": "string"
            }
          },
          "surah": {
            "type": "integer",
            "description": "Surah number associated with the question."
          },
          "theme": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "summary": {
            "type": "string"
          },
          "references": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "language": {
            "type": "string",
            "description": "Question language ISO code when present."
          },
          "status": {
            "type": "string",
            "enum": ["New", "Draft", "Published", "Answered"]
          },
          "answers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnswersAnswerDto"
            }
          }
        }
      },
      "AnswersByAyahResponse": {
        "title": "AnswersByAyahResponse",
        "type": "object",
        "required": ["questions", "totalCount"],
        "properties": {
          "questions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnswersQuestionDto"
            }
          },
          "totalCount": {
            "type": "integer",
            "description": "Total number of matching questions before pagination."
          }
        }
      },
      "AnswersCountWithinRangeEntry": {
        "title": "AnswersCountWithinRangeEntry",
        "type": "object",
        "required": ["types", "total"],
        "properties": {
          "types": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            },
            "description": "Per-question-type counts for the verse."
          },
          "total": {
            "type": "integer",
            "description": "Total number of questions touching the verse."
          }
        }
      },
      "AnswersCountWithinRangeResponse": {
        "title": "AnswersCountWithinRangeResponse",
        "type": "object",
        "additionalProperties": {
          "$ref": "#/components/schemas/AnswersCountWithinRangeEntry"
        }
      },
      "AnswersQdcErrorDetail": {
        "title": "AnswersQdcErrorDetail",
        "type": "object",
        "additionalProperties": true
      },
      "AnswersQdcError": {
        "title": "AnswersQdcError",
        "type": "object",
        "required": ["code", "message"],
        "properties": {
          "code": {
            "type": "string",
            "enum": ["INVALID_PARAMETER", "NOT_FOUND"]
          },
          "message": {
            "type": "string"
          },
          "details": {
            "$ref": "#/components/schemas/AnswersQdcErrorDetail"
          }
        }
      },
      "AnswersQdcErrorResponse": {
        "title": "AnswersQdcErrorResponse",
        "type": "object",
        "required": ["status", "error"],
        "properties": {
          "status": {
            "type": "integer"
          },
          "error": {
            "$ref": "#/components/schemas/AnswersQdcError"
          }
        }
      },
      "ContentSyncResourceGroup": {
        "type": "string",
        "description": "Public content group supported by Content Sync.",
        "enum": ["articles", "recitations", "tafsirs", "translations"]
      },
      "ContentSyncMutationType": {
        "type": "string",
        "description": "Type of content change the client should apply.",
        "enum": [
          "RESOURCE_CREATE",
          "RESOURCE_UPDATE",
          "RESOURCE_DELETE",
          "ROW_CREATE",
          "ROW_UPDATE",
          "ROW_DELETE",
          "RESOURCE_INVALIDATE"
        ]
      },
      "ContentSyncRecordType": {
        "type": "string",
        "nullable": true,
        "description": "Row type inside the resource. Present for row-level changes. Current values include `translation`, `tafsir`, `audio_file`, `chapter_audio_file`, and `article_localization`.",
        "enum": [
          "translation",
          "tafsir",
          "audio_file",
          "chapter_audio_file",
          "article_localization",
          null
        ]
      },
      "ContentSyncMutation": {
        "type": "object",
        "required": [
          "sequence",
          "type",
          "resource_group",
          "resource_id",
          "resource_content_id",
          "changed_at"
        ],
        "properties": {
          "sequence": {
            "type": "integer",
            "format": "int64",
            "description": "Monotonic server sequence for this content change."
          },
          "type": {
            "description": "Change type. `RESOURCE_UPDATE` is a resource-level freshness marker without `snapshot_url`; clients should keep existing local rows unless row changes, `RESOURCE_INVALIDATE`, or `RESOURCE_DELETE` later change them.",
            "allOf": [
              {
                "$ref": "#/components/schemas/ContentSyncMutationType"
              }
            ]
          },
          "resource_group": {
            "$ref": "#/components/schemas/ContentSyncResourceGroup"
          },
          "resource_id": {
            "type": "integer",
            "format": "int64",
            "description": "Resource ID within the group, such as translation resource `19`."
          },
          "resource_content_id": {
            "type": "integer",
            "format": "int64",
            "nullable": true,
            "description": "Underlying resource content ID when the resource is backed by `resource_contents`. It is `null` for article resources."
          },
          "record_type": {
            "description": "Present for row-level changes. Null for resource-level changes.",
            "allOf": [
              {
                "$ref": "#/components/schemas/ContentSyncRecordType"
              }
            ]
          },
          "record_key": {
            "type": "string",
            "nullable": true,
            "description": "Client row key within the resource. Use `resource_group + resource_id + record_type + record_key` as the stable local row identity."
          },
          "source_record_id": {
            "type": "integer",
            "format": "int64",
            "nullable": true,
            "description": "Present for row mutations when a source record ID is available."
          },
          "changed_at": {
            "type": "string",
            "format": "date-time",
            "description": "Server timestamp for when this content change was recorded."
          },
          "data": {
            "type": "object",
            "nullable": true,
            "additionalProperties": true,
            "description": "Full row payload for `ROW_CREATE` and `ROW_UPDATE`. Null for deletes and resource-level changes."
          },
          "snapshot_url": {
            "type": "string",
            "nullable": true,
            "description": "Present for `RESOURCE_CREATE` and `RESOURCE_INVALIDATE`. Fetch this full copy and replace local rows for the resource. When present, we return a relative `/api/v4/...` path; prefix it with `https://apis.quran.foundation/content`. `RESOURCE_UPDATE` does not include a snapshot URL."
          },
          "unavailable_reason": {
            "type": "string",
            "nullable": true,
            "description": "Present for `RESOURCE_DELETE` when a public resource became unavailable."
          }
        },
        "example": {
          "sequence": 98100,
          "type": "ROW_UPDATE",
          "resource_group": "translations",
          "resource_id": 19,
          "resource_content_id": 19,
          "record_type": "translation",
          "record_key": "85108",
          "source_record_id": 85108,
          "changed_at": "2026-05-05T10:00:00Z",
          "data": {
            "id": 85108,
            "verse_key": "26:153",
            "text": "They said: Thou art but one of the bewitched;"
          },
          "snapshot_url": null,
          "unavailable_reason": null
        }
      },
      "ContentSyncResponse": {
        "type": "object",
        "required": ["sync"],
        "properties": {
          "sync": {
            "type": "object",
            "required": [
              "sync_until_sequence",
              "has_more",
              "next_page_url",
              "next_sync_token",
              "mutations"
            ],
            "properties": {
              "sync_until_sequence": {
                "type": "integer",
                "format": "int64",
                "description": "Upper sequence bound for this sync page set."
              },
              "has_more": {
                "type": "boolean",
                "description": "True when the client must call `next_page_url` for another page before storing a sync token."
              },
              "next_page_url": {
                "type": "string",
                "nullable": true,
                "description": "Next page path when `has_more` is true. When present, we return a relative `/api/v4/...` path, such as `/api/v4/resources/sync?cursor=...`; prefix it with `https://apis.quran.foundation/content`."
              },
              "next_sync_token": {
                "type": "string",
                "nullable": true,
                "description": "Checkpoint to store after the final page has been fully applied. Null on intermediate pages."
              },
              "mutations": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ContentSyncMutation"
                }
              }
            }
          }
        }
      },
      "ContentResourceSnapshot": {
        "type": "object",
        "required": [
          "resource_group",
          "resource_id",
          "resource_content_id",
          "schema_version",
          "sync_sequence",
          "records"
        ],
        "properties": {
          "resource_group": {
            "$ref": "#/components/schemas/ContentSyncResourceGroup"
          },
          "resource_id": {
            "type": "integer",
            "format": "int64",
            "description": "Resource ID within the selected group."
          },
          "resource_content_id": {
            "type": "integer",
            "format": "int64",
            "nullable": true,
            "description": "Underlying resource content ID when available. It is `null` for article resources."
          },
          "schema_version": {
            "type": "integer",
            "description": "Version of the snapshot payload shape.",
            "example": 1
          },
          "sync_sequence": {
            "type": "integer",
            "format": "int64",
            "description": "Current sync sequence when the snapshot was fetched. Snapshots are current-at-fetch, not pinned to the sequence of the change that requested them."
          },
          "records": {
            "type": "array",
            "description": "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`.",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        },
        "example": {
          "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;"
            }
          ]
        }
      },
      "ContentSyncErrorResponse": {
        "type": "object",
        "required": ["error"],
        "properties": {
          "error": {
            "type": "object",
            "required": ["code", "message"],
            "properties": {
              "code": {
                "type": "string",
                "description": "Machine-readable Content Sync error code.",
                "example": "invalid_resources"
              },
              "message": {
                "type": "string",
                "description": "Human-readable error message.",
                "example": "Invalid resources filter"
              }
            }
          }
        }
      }
    },
    "securitySchemes": {
      "x-auth-token": {
        "type": "apiKey",
        "description": "The access token required for accessing the endpoints.",
        "name": "x-auth-token",
        "in": "header"
      },
      "x-client-id": {
        "type": "apiKey",
        "description": "Your client Id",
        "name": "x-client-id",
        "in": "header"
      }
    },
    "responses": {
      "invalidRequest": {
        "description": "Will be returned when the request is invalid e.g. request is missing required headers or with invalid query parameters.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/invalidRequestResponse"
            },
            "example": {
              "message": "The request is missing required headers or is invalid",
              "type": "invalid_request",
              "success": false
            }
          }
        }
      },
      "unauthorized": {
        "description": "Will be returned when the request is unauthorized.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/unauthorizedResponse"
            },
            "example": {
              "message": "The request requires user authentication",
              "type": "unauthorized",
              "success": false
            }
          }
        }
      },
      "forbidden": {
        "description": "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.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/forbiddenResponse"
            },
            "example": {
              "message": "The server understood the request, but refuses to authorize it",
              "type": "forbidden",
              "success": false
            }
          }
        }
      },
      "notFound": {
        "description": "Not Found. The resource being accessed does not exist.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/notFoundResponse"
            },
            "example": {
              "message": "The requested resource could not be found",
              "type": "not_found",
              "success": false
            }
          }
        }
      },
      "unprocessableEntity": {
        "description": "Validation Error. The request includes one or more invalid params. Please check the request params and try again.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/unprocessableEntityResponse"
            },
            "example": {
              "message": "The request was well-formed but was unable to be followed due to semantic errors",
              "type": "unprocessable_entity",
              "success": false
            }
          }
        }
      },
      "internalServerError": {
        "description": "Server Error. Something went wrong, try again later.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/internalServerErrorResponse"
            },
            "example": {
              "message": "The server encountered an internal error and was unable to complete your request",
              "type": "internal_server_error",
              "success": false
            }
          }
        }
      },
      "badGateway": {
        "description": "Bad Gateway",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/badGatewayResponse"
            },
            "example": {
              "message": "The server was acting as a gateway or proxy and received an invalid response from the upstream server",
              "type": "bad_gateway",
              "success": false
            }
          }
        }
      },
      "serviceUnavailable": {
        "description": "Service Unavailable",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/serviceUnavailableResponse"
            },
            "example": {
              "message": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance",
              "type": "service_unavailable",
              "success": false
            }
          }
        }
      },
      "gatewayTimeout": {
        "description": "Gateway Timeout",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/gatewayTimeoutResponse"
            },
            "example": {
              "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
            }
          }
        }
      },
      "rateLimitExceeded": {
        "description": "Rate-limit exceeded",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/rateLimitExceededResponse"
            },
            "example": {
              "message": "Too many requests, please try again later",
              "type": "rate_limit_exceeded",
              "success": false
            }
          }
        }
      },
      "answersInvalidParameter": {
        "description": "Invalid parameter. Returned for malformed ayah keys, invalid ranges, or invalid pagination values.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AnswersQdcErrorResponse"
            },
            "example": {
              "status": 400,
              "error": {
                "code": "INVALID_PARAMETER",
                "message": "Invalid ayah_key format. Expected format: chapter:verse (e.g., 12:12)",
                "details": {
                  "parameter": "ayah_key",
                  "provided": "2-255",
                  "expected": "12:12"
                }
              }
            }
          }
        }
      },
      "answersNotFound": {
        "description": "Not Found. Returned when the requested published question does not exist.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AnswersQdcErrorResponse"
            },
            "example": {
              "status": 404,
              "error": {
                "code": "NOT_FOUND",
                "message": "Question not found"
              }
            }
          }
        }
      }
    }
  },
  "x-stoplight": {
    "id": "xmulprojamrcd"
  },
  "x-original-swagger-version": "2.0"
}
