Line 4: | Line 4: | ||
Fetchs the quran data juz by juz. This will pull complete juz for specified juz number | Fetchs the quran data juz by juz. This will pull complete juz for specified juz number | ||
− | '''Url:''' [http://api.globalquran.com/surah/getJuz/quranID http://api.globalquran.com/surah/getJuz/quranID] | + | '''Url:''' [http://api.globalquran.com/surah/getJuz/quranID http://api.globalquran.com/surah/getJuz/quranID?key=api_key] |
{| border="1" cellspacing="1" cellpadding="1" style="width: 500px;" | {| border="1" cellspacing="1" cellpadding="1" style="width: 500px;" | ||
Line 19: | Line 19: | ||
| quran id | | quran id | ||
| list of quran id seperated by '''|''' (pipe) | | list of quran id seperated by '''|''' (pipe) | ||
+ | |- | ||
+ | | key | ||
+ | | api key | ||
+ | | your site / app api key here | ||
|} | |} | ||
− | <br/>'''JSON Response: ''' [http://api.globalquran.com/juz/30/quran-simple http://api.globalquran.com/juz/30/quran-simple] | + | <br/>'''JSON Response: ''' [http://api.globalquran.com/juz/30/quran-simple http://api.globalquran.com/juz/30/quran-simple?key=api_key] |
<pre class="prettyprint javascript">{ | <pre class="prettyprint javascript">{ | ||
"quran": { | "quran": { | ||
Line 66: | Line 70: | ||
<script> | <script> | ||
$.ajaxSetup({ cache: true, jsonpCallback: 'quranData' }); // define ajax setup | $.ajaxSetup({ cache: true, jsonpCallback: 'quranData' }); // define ajax setup | ||
− | $.getJSON("http://api.globalquran.com/juz/30/quran-simple?jsoncallback=?", { | + | $.getJSON("http://api.globalquran.com/juz/30/quran-simple?key=api_key&jsoncallback=?", { |
format : "jsonp" | format : "jsonp" | ||
}, function(data) | }, function(data) |
Fetchs the quran data juz by juz. This will pull complete juz for specified juz number
Url: [http://api.globalquran.com/surah/getJuz/quranID 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 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": "الَّذِي هُمْ فِيهِ مُخْتَلِفُونَ" }, .......... } } }
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:
.