Ayah

Fetchs the quran ayah data. This will pull the single ayah only

Url: http://api.globalquran.com/ayah/getAyah/quranID?key=api_key

attribute Value Description
getAyah surah:ayah number or verse number Identify here what page number you want to pull
quranID quran id list of quran id seperated by | (pipe)
key api key your site / app api key here


Url Examples By:




JSON Response:  http://api.globalquran.com/ayah/10/quran-simple?key=api_key

{
    "quran": {
        "quran-simple": {
            "10": {
                "surah": 2,
                "ayah": 3,
                "verse": "الَّذِينَ يُؤْمِنُونَ بِالْغَيْبِ وَيُقِيمُونَ الصَّلَاةَ وَمِمَّا رَزَقْنَاهُمْ يُنْفِقُونَ"
            }
        }
    }
}



Examples:

Example: Loads the verse number 10, which also can be wrote as 2:3

<!DOCTYPE html>
<html>
<head>
  <style>#demo-1{ color:lightBlue; }</style>
  <script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
  <div id="demo-1">

</div>
<script>
$.ajaxSetup({ cache: true, jsonpCallback: 'quranData' }); // define ajax setup
$.getJSON("http://api.globalquran.com/ayah/10/quran-simple?key=api_key&jsoncallback=?", {
    format : "jsonp"
}, function(data)
{    
    $.each(data.quran, function(i, by)
    {
	$.each(by, function (verseNo, line) {
            $("<p>").html(line.surah+':'+line.ayah+' '+line.verse).appendTo("#demo-1");
	});
    });
});
</script>
</body>
</html>

Demo:

Comments


blog comments powered by Disqus

.