Show Aya by Id

Show Aya API will retrieve one text of verse/aya from the Holy Quran, based on the reference number (id).

Version

v1

URL

https://ialharami.com/quran-projects/api/v1/ayas/:id

Method

GET

API Authentication

Not required

URL Params

id : number(4)

Data Params

None

Success Response

Code: 200 OK

Example: https://ialharami.com/quran-projects/api/v1/ayas/80
{
  "success": true,
  "data": {
    "aya": {
      "id": "80",
      "ayaNumber": "72",
      "ayaText": "وإذ قتلتم نفسا فادارأتم فيها والله مخرج ما كنتم تكتمون",
      "suraName": "البقره",
      "suraNumber": "2"
    }
  }
}

id : number(4)
ayaNumber : number(3)
ayaText : string, Arabic Unicode
suraName : string(10), Arabic Unicode
suraNumber : number(3)

Not Found Response

Code: 404 Not Found

Example: https://ialharami.com/quran-projects/api/v1/ayas/8000
{
  "success": false,
  "errors": {
    "code": 404,
    "message": "Not Found",
    "detail": "Aya (8000) does not exist, (id) values: 1 to 6348"
  }
}

Error Response

Code: 500 Internal Server Error

Note: The detailed message varies depending on the type of error.

{
  "success": false,
  "errors": {
    "code": 500,
    "message": "Internal Server Error",
    "detail": "Database: SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it"
  }
}
PHP Code Snippets Powered By : XYZScripts.com