Line 4: Line 4:
 
Fetchs the quran ayah data. This will pull the single ayah only
 
Fetchs the quran ayah data. This will pull the single ayah only
  
'''Url:''' [http://api.globalquran.com/ayah/getAyah/quranID http://api.globalquran.com/ayah/getAyah/quranID]
+
'''Url:''' [http://api.globalquran.com/ayah/getAyah/quranID http://api.globalquran.com/ayah/getAyah/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:'''
  
*Surah & Ayah:  [http://api.globalquran.com/ayah/114:6/quran-simple http://api.globalquran.com/ayah/114:6/quran-simple]
+
*Surah & Ayah:  [http://api.globalquran.com/ayah/114:6/quran-simple http://api.globalquran.com/ayah/114:6/quran-simple?key=api_key]
*Verse Number:  [http://api.globalquran.com/ayah/6023/quran-simple http://api.globalquran.com/ayah/6023/quran-simple]
+
*Verse Number:  [http://api.globalquran.com/ayah/6023/quran-simple http://api.globalquran.com/ayah/6023/quran-simple?key=api_key]
  
  
  
<br/><br/>'''JSON Response:&nbsp;''' [http://api.globalquran.com/ayah/10/quran-simple http://api.globalquran.com/ayah/10/quran-simple]
+
<br/><br/>'''JSON Response:&nbsp;''' [http://api.globalquran.com/ayah/10/quran-simple http://api.globalquran.com/ayah/10/quran-simple?key=api_key]
 
<pre class="prettyprint javascript">{
 
<pre class="prettyprint javascript">{
 
&nbsp;&nbsp;&nbsp; "quran": {
 
&nbsp;&nbsp;&nbsp; "quran": {
Line 63: Line 67:
 
<script>
 
<script>
 
$.ajaxSetup({ cache: true, jsonpCallback: 'quranData' }); // define ajax setup
 
$.ajaxSetup({ cache: true, jsonpCallback: 'quranData' }); // define ajax setup
$.getJSON("http://api.globalquran.com/ayah/10/quran-simple?jsoncallback=?", {
+
$.getJSON("http://api.globalquran.com/ayah/10/quran-simple?key=api_key&jsoncallback=?", {
 
     format&nbsp;: "jsonp"
 
     format&nbsp;: "jsonp"
 
}, function(data)
 
}, function(data)

Latest revision as of 03:35, 9 March 2014

Ayah

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

Url: [http://api.globalquran.com/ayah/getAyah/quranID 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:

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




JSON Response:  [http://api.globalquran.com/ayah/10/quran-simple 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

.