https://hadithapi.com/api/hadiths/?apiKey={API_KEY}
Path Parameters
apiKey (required)
Your api key, generated in your profile page.
Query Parameters
hadithEnglish
English word(s) you want to search in hadiths collection
hadithUrdu
Urdu word(s) you want to search in hadiths collection
hadithArabic
Arabic word(s) you want to search in hadiths collection
hadithNumber
Number of the hadith
book
Slug of the book. See below
chapter
Chapter number of any book
status
Sahih / Hasan / Da`eef
paginate
Number of hadiths you want to paginate.
Default: 25
Book slugs
Book Slug
Sahih Bukhari sahih-bukhari
Sahih Muslim sahih-muslim
Jami' Al-Tirmidhi al-tirmidhi
Sunan Abu Dawood abu-dawood
Sunan Ibn-e-Majah ibn-e-majah
Sunan An-Nasa`i sunan-nasai
Mishkat Al-Masabih mishkat
Musnad Ahmad musnad-ahmad
Al-Silsila Sahiha al-silsila-sahiha
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/hadiths?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/hadiths?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/hadiths?apiKey={API_KEY}');
                        $response = json_decode($response);
                        print_r($response);