The ”Islam Companion Web API” project is a RESTFul API (Application Programming Interface) that allows users to add Holy Quran and Hadith data to their applications.
It provides Holy Quran translation in 42 languages. Following languages are supported: Amharic, Arabic, Bosnian, Bengali, Bulgarian, Amazigh, Czech, German, Divehi, Spanish, English, Persian, French, Hindi, Hausa, Indonesian, Italian, Japanese, Korean, Kurdish, Malayalam, Malay, Dutch, Norwegian, Portuguese, Polish, Russian, Romanian, Swedish, Somali, Sindhi, Albanian, Swahili, Turkish, Tajik, Tamil, Tatar, Thai, Uzbek, Urdu, Uyghur and Chinese.
Hadith translation is provided in Urdu, English and Arabic languages.
The goal of the Islam Companion Web API is to help users develop applications that promote knowledge about Islam.
Features
The Islam Companion Web API has the following features:
It provides translations of Holy Quran in 42 languages
It provides translations of Hadith in Urdu, English and Arabic languages
It provides 8 API functions for fetching Quranic data
It provides 7 API functions for fetching Hadith data
Create a database and import the contents of the SQL file to the database. Note down the credentials used for connecting to the database
Enter the database credentials in the file api/config/RequiredObjects.php
In the file: api/Config.php, on line 37 enter the domain names that will be used to access the API
Customize the following variables in the file: api/config/General.php. $config[‘app_name’], $config[‘dev_mode’] and $config[‘site_url’]
Download data
Click here to download the Hadith database in .sql format for MySQL server.
Click here to download the Hadith database in .db format for SQLite server.
Click here to download the Quranic database in .db format for SQLite server.
Frequently asked questions
What is the Islam Companion Web API. It is a RESTFul API for accessing Holy Quran and Hadith data
What can I do with the Islam Companion Web API. You can develop web based applications that present Holy Quran and Hadith data to the user. The Islam Companion API can work as the back-end of your application.
Which languages are supported by the Islam Companion Web API. Click Here
What functions are provided by the Islam Companion Api. Please read the documentation.
How do I use the API. To use the API, you have to make HTTP POST request to your server. Please see following sample code in PHP language.
Sample Code
<?php$data=array('language'=>'English','narrator'=>'Mohammed Marmaduke William Pickthall');// Prepare new cURL resource$ch=curl_init('https://your-host-name/api/get_random_verses');curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);curl_setopt($ch,CURLINFO_HEADER_OUT,true);curl_setopt($ch,CURLOPT_POST,true);curl_setopt($ch,CURLOPT_POSTFIELDS,$data);// Submit the POST request$result=curl_exec($ch);// Close cURL session handlecurl_close($ch);// json decode the response$result=json_decode($result,true);// Print the resultprint_r($result);?>
Usage
The Islam Companion Web API supports the following functions. All function response values are in JSON format.
To test the API, use the following url: https://your-host-name/api/ for making API requests. All API requests must be of type HTTP POST and should include the required API parameters.