Juz

Fetchs the quran data juz by juz. This will pull complete juz for specified juz number

Url: http://api.globalquran.com/surah/getJuz/quranID?key=api_key

attribute Value Description
getJuz juz number Identify here what surah number you want to pull
quranID quran id list of quran id seperated by | (pipe)
key api key your site / app api key here



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

{
    "quran": {
        "quran-simple": {
            "5673": {
                "surah": 78,
                "ayah": 1,
                "verse": "بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ عَمَّ يَتَسَاءَلُونَ"
            },
            "5674": {
                "surah": 78,
                "ayah": 2,
                "verse": "عَنِ النَّبَإِ الْعَظِيمِ"
            },
            "5675": {
                "surah": 78,
                "ayah": 3,
                "verse": "الَّذِي هُمْ فِيهِ مُخْتَلِفُونَ"
            },
            ..........
        }
    }
}



Examples:

Example: Loads the last juz 30.

<!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/juz/30/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

.