Books
https://hadithapi.com/api/books?apiKey={API_KEY}
Path Parameters
apiKey (required)
Your api key, generated in your
profile.
Responses
403
Forbidden - API key is required.
401
Unauthorized - API key is invalid.
404
Not found - Books not found.
200
Success - Books has been found.
Sample code:
const apiUrl = 'https://hadithapi.com/api/books?apiKey={API_KEY}';
fetch(apiUrl)
.then(response => response.json())
.then(data => {
console.log(data);
})
.catch(error => {
console.log(error);
})
const apiUrl = 'https://hadithapi.com/api/books?apiKey={API_KEY}';
$.ajax({
url: apiUrl,
type: 'get',
success: function(data){
console.log(data);
},
error: function(err){
console.log(err);
}
})
$response = file_get_contents('https://hadithapi.com/api/books?apiKey={API_KEY}');
$response = json_decode($response);
print_r($response);