Line 4: Line 4:
 
Fetchs the quran data page by page. This method we use on GlobalQuran.com 3.0
 
Fetchs the quran data page by page. This method we use on GlobalQuran.com 3.0
  
'''Url:''' [http://api.globalquran.com/page/getPage/quranID http://api.globalquran.com/page/getPage/quranID]
+
'''Url:''' [http://api.globalquran.com/page/getPage/quranID http://api.globalquran.com/page/getPage/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
 
|}
 
|}
  
Line 25: Line 29:
 
'''Url Examples By:'''
 
'''Url Examples By:'''
  
*Page Number: [http://api.globalquran.com/page/604/quran-simple http://api.globalquran.com/page/604/quran-simple]
+
*Page Number: [http://api.globalquran.com/page/604/quran-simple http://api.globalquran.com/page/604/quran-simple?key=api_key]
*Verse Number: [http://api.globalquran.com/page/6023/quran-simple http://api.globalquran.com/page/6023/quran-simple]
+
*Verse Number: [http://api.globalquran.com/page/6023/quran-simple http://api.globalquran.com/page/6023/quran-simple?key=api_key]
*Surah & Ayah:  [http://api.globalquran.com/page/114:1/quran-simple http://api.globalquran.com/page/114:1/quran-simple]
+
*Surah & Ayah:  [http://api.globalquran.com/page/114:1/quran-simple http://api.globalquran.com/page/114:1/quran-simple?key=api_key]
  
  
  
<br/>'''JSON Response:&nbsp;'''[http://api.globalquran.com/page/604/quran-simple http://api.globalquran.com/page/604/quran-simple]
+
<br/>'''JSON Response:&nbsp;'''[http://api.globalquran.com/page/604/quran-simple http://api.globalquran.com/page/604/quran-simple?key=api_key]
 
<pre class="prettyprint javascript">{
 
<pre class="prettyprint javascript">{
 
&nbsp;&nbsp;&nbsp; "quran": {
 
&nbsp;&nbsp;&nbsp; "quran": {
Line 133: Line 137:
 
<script>
 
<script>
 
$.ajaxSetup({ cache: true, jsonpCallback: 'quranData' }); // define ajax setup
 
$.ajaxSetup({ cache: true, jsonpCallback: 'quranData' }); // define ajax setup
$.getJSON("http://api.globalquran.com/page/604/quran-simple?jsoncallback=?", {
+
$.getJSON("http://api.globalquran.com/page/604/quran-simple?key=api_key&jsoncallback=?", {
 
     format&nbsp;: "jsonp"
 
     format&nbsp;: "jsonp"
 
}, function(data)
 
}, function(data)

Latest revision as of 03:33, 9 March 2014

Page

Fetchs the quran data page by page. This method we use on GlobalQuran.com 3.0

Url: [http://api.globalquran.com/page/getPage/quranID http://api.globalquran.com/page/getPage/quranID?key=api_key]

attribute Value Description
getPage page number, verse number or surah:ayah 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:

  • Page Number: [http://api.globalquran.com/page/604/quran-simple http://api.globalquran.com/page/604/quran-simple?key=api_key]
  • Verse Number: [http://api.globalquran.com/page/6023/quran-simple http://api.globalquran.com/page/6023/quran-simple?key=api_key]
  • Surah & Ayah:  [http://api.globalquran.com/page/114:1/quran-simple http://api.globalquran.com/page/114:1/quran-simple?key=api_key]



JSON Response: [http://api.globalquran.com/page/604/quran-simple http://api.globalquran.com/page/604/quran-simple?key=api_key]

{
    "quran": {
        "quran-simple": {
            "6222": {
                "surah": 112,
                "ayah": 1,
                "verse": "بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ قُلْ هُوَ اللَّهُ أَحَدٌ"
            },
            "6223": {
                "surah": 112,
                "ayah": 2,
                "verse": "اللَّهُ الصَّمَدُ"
            },
            "6224": {
                "surah": 112,
                "ayah": 3,
                "verse": "لَمْ يَلِدْ وَلَمْ يُولَدْ"
            },
            "6225": {
                "surah": 112,
                "ayah": 4,
                "verse": "وَلَمْ يَكُنْ لَهُ كُفُوًا أَحَدٌ"
            },
            "6226": {
                "surah": 113,
                "ayah": 1,
                "verse": "بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ قُلْ أَعُوذُ بِرَبِّ الْفَلَقِ"
            },
            "6227": {
                "surah": 113,
                "ayah": 2,
                "verse": "مِنْ شَرِّ مَا خَلَقَ"
            },
            "6228": {
                "surah": 113,
                "ayah": 3,
                "verse": "وَمِنْ شَرِّ غَاسِقٍ إِذَا وَقَبَ"
            },
            "6229": {
                "surah": 113,
                "ayah": 4,
                "verse": "وَمِنْ شَرِّ النَّفَّاثَاتِ فِي الْعُقَدِ"
            },
            "6230": {
                "surah": 113,
                "ayah": 5,
                "verse": "وَمِنْ شَرِّ حَاسِدٍ إِذَا حَسَدَ"
            },
            "6231": {
                "surah": 114,
                "ayah": 1,
                "verse": "بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ قُلْ أَعُوذُ بِرَبِّ النَّاسِ"
            },
            "6232": {
                "surah": 114,
                "ayah": 2,
                "verse": "مَلِكِ النَّاسِ"
            },
            "6233": {
                "surah": 114,
                "ayah": 3,
                "verse": "إِلَٰهِ النَّاسِ"
            },
            "6234": {
                "surah": 114,
                "ayah": 4,
                "verse": "مِنْ شَرِّ الْوَسْوَاسِ الْخَنَّاسِ"
            },
            "6235": {
                "surah": 114,
                "ayah": 5,
                "verse": "الَّذِي يُوَسْوِسُ فِي صُدُورِ النَّاسِ"
            },
            "6236": {
                "surah": 114,
                "ayah": 6,
                "verse": "مِنَ الْجِنَّةِ وَالنَّاسِ"
            }
        }
    }
}



Examples:

Example: Loads the last quran page 604.

<!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/page/604/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

.