Show Sura by Id

Show Sura API will retrieve one Sura name, based on sura number.

Version

v1

URL

https://ialharami.com/quran-projects/api/v1/suras/:sura-number

Method

GET

API Authentication

Not required

URL Params

sura-number : number(3), values (1 to 114)

Data Params

None

Success Response

Code: 200 OK

Example: https://ialharami.com/quran-projects/api/v1/suras/33
{
  "success": true,
  "data": {
    "sura": {
      "suraName": "الاحزاب",
      "suraNumber": "33"
    }
  }
}

suraName : string(10), Arabic Unicode
suraNumber : number(3)

Not Found Response

Code: 404 Not Found

Example: https://ialharami.com/quran-projects/api/v1/suras/211
{
  "success": false,
  "errors": {
    "code": 404,
    "message": "Not Found",
    "detail": "Sura (211) does not exist, values (1 to 114)"
  }
}

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