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.
The Islam Companion Web API has the following features:
The Islam Companion Web API requires PHP >= 7.2. It also requires MySQL server >= 5.6.
The following steps can be used to install the “Islam Companion Web API” project on your own server:
We have compiled a Hadith database with the purpose of spreading knowledge of Hadith. The database should be used by developers in their own applications. The Hadith database contains text in Urdu, English and Arabic languages.
<?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 handle
curl_close($ch);
// json decode the response
$result = json_decode($result, true);
// Print the result
print_r($result);
?>
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.