Introduction
Welcome to the Hijri Date API! This API allows you to easily retrieve the current Hijri date, including the day, month, year, and the numeric date in both Arabic and English formats. You can use this API to integrate Hijri date functionality into your applications, websites, and more. The Hijri (Islamic) calendar is widely used in Muslim countries, and this API helps make it accessible for all kinds of digital projects.
Base URL
https://api.ethioall.com/hijri/api
Try the API
Click the button below to fetch the current Hijri date in real-time:
Click the button to see the response here...
Example API Response Format
{
"day": "الإثنين",
"month": "جمادى الأولى",
"date": 20,
"year": 1446,
"numeric_date": "20-5-1446",
"day_english": "Monday",
"month_english": "Jumada al-Awwal",
"month_number": 5
}
Fields in the Response:
- day: The day of the week in Arabic (e.g., "الإثنين" for Monday).
- month: The month name in Arabic (e.g., "جمادى الأولى" for Jumada al-Awwal).
- date: The day of the month in the Hijri calendar.
- year: The current Hijri year.
- numeric_date: The Hijri date in the format
day-month-year(e.g., "20-5-1446"). - day_english: The day of the week in English (e.g., "Monday").
- month_english: The month name in English (e.g., "Jumada al-Awwal").
- month_number: The month number in the Hijri calendar (e.g., 5 for Jumada al-Awwal).
How to Use the Hijri Date API
You can access the API by making a GET request to the following endpoint:
https://api.ethioall.com/hijri/api
This will return the current Hijri date and additional information in JSON format.
Example Request with cURL
curl -X GET https://api.ethioall.com/hijri/api
Examples in Different Programming Languages
PHP Example
// dont forget php tags
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://date.ethioall.com/hijri/api");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
if ($response !== false) {
$data = json_decode($response, true);
echo "Hijri Date: {$data['date']} {$data['month']} {$data['year']}\n";
}
curl_close($ch);
?>
Python Example
import requests
url = "https://api.ethioall.com/hijri/api"
response = requests.get(url)
if response.status_code == 200:
data = response.json()
print(f"Hijri Date: {data['date']} {data['month']} {data['year']}")
JavaScript (Node.js) Example
const axios = require('axios');
axios.get('https://api.ethioall.com/hijri/api')
.then((response) => {
console.log(response.data);
});
Ruby Example
require 'net/http'
require 'json'
url = URI.parse("https://api.ethioall.com/hijri/api")
response = Net::HTTP.get(url)
data = JSON.parse(response)
puts data
Error Handling
The API responds with an HTTP status code. Common error codes:
- 400 Bad Request: The request was not formatted properly.
- 404 Not Found: The requested resource could not be found.
- 500 Internal Server Error: An error occurred on the server.
Use Cases
- Integrate into websites to display the current Hijri date.
- Use in mobile applications to show Hijri dates alongside the Gregorian calendar.
- Develop religious applications like prayer time calculators and Islamic events.
- Provide educational platforms with Hijri date details.
- Create tools for Hijri date conversion and comparison.