Welcome to the Ethiopian Date API! This API offers an easy way to retrieve the current Ethiopian date, including day, month, year, and numeric date, in both Amharic and English formats. It’s ideal for applications, websites, and tools that need Ethiopian calendar integration.
Base URL
The API is accessible at:
https://date.ethioall.com/api/date
Response Format
The API returns a JSON response with the following fields:
{
"day": "ሰኞ",
"month": "መስከረም",
"date": 21,
"year": 2017,
"numeric_date": "21-1-2017",
"day_english": "Monday",
"month_english": "Meskerem",
"month_number": 1
}
Response Details
Field | Description | Example |
---|---|---|
day | The day of the week in Amharic | ሰኞ (Monday) |
month | The month name in Amharic | መስከረም |
date | The day of the month in the Ethiopian calendar | 21 |
year | The Ethiopian year | 2017 |
numeric_date | The full Ethiopian date in day-month-year format |
21-1-2017 |
day_english | The day of the week in English | Monday |
month_english | The month name in English | Meskerem |
month_number | The month number in the Ethiopian calendar | 1 |
How to Use the API
Make a Request
To use the API, send a GET
request to the endpoint:
https://date.ethioall.com/api/date
Sample Response
The server will return the current Ethiopian date in JSON format as shown above.
Integration Examples
Here are examples of how to make API requests in different programming languages.
1. Python
import requests
url = "https://date.ethioall.com/api/date"
response = requests.get(url)
if response.status_code == 200:
data = response.json()
print(f"Ethiopian Date: {data['date']} {data['month']} {data['year']}")
print(f"Day (English): {data['day_english']}, Month (English): {data['month_english']}")
else:
print(f"Error: {response.status_code}")
2. JavaScript (Node.js)
const axios = require('axios');
axios.get('https://date.ethioall.com/api/date')
.then(response => {
const data = response.data;
console.log(`Ethiopian Date: ${data.date} ${data.month} ${data.year}`);
console.log(`Day (English): ${data.day_english}, Month (English): ${data.month_english}`);
})
.catch(error => {
console.error('Error fetching the date:', error);
});
3. PHP
<?php
$url = "https://date.ethioall.com/api/date";
$response = file_get_contents($url);
if ($response !== false) {
$data = json_decode($response, true);
echo "Ethiopian Date: {$data['date']} {$data['month']} {$data['year']}\n";
echo "Day (English): {$data['day_english']}, Month (English): {$data['month_english']}\n";
} else {
echo "Error fetching the Ethiopian date.";
}
?>
4. Ruby
require 'net/http'
require 'json'
url = URI("https://date.ethioall.com/api/date")
response = Net::HTTP.get(url)
data = JSON.parse(response)
puts "Ethiopian Date: #{data['date']} #{data['month']} #{data['year']}"
puts "Day (English): #{data['day_english']}, Month (English): #{data['month_english']}"
Error Handling
The API will return standard HTTP status codes to indicate the success or failure of your request:
- 200 OK: The request was successful, and the response contains the Ethiopian date.
- 400 Bad Request: Your request was not formatted correctly.
- 404 Not Found: The endpoint does not exist.
- 500 Internal Server Error: A server-side error occurred.
Example Error Response:
{
"error": "Invalid request"
}
Use Cases
- Websites: Display the Ethiopian date dynamically on your website.
- Mobile Applications: Integrate the Ethiopian calendar into mobile apps.
- Cultural Tools: Build tools to promote Ethiopian culture and calendar systems.
- Event Management: Convert Gregorian dates to Ethiopian for event planning and scheduling.
Frequently Asked Questions (FAQ)
1. Is the API free?
Yes, the Ethiopian Date API is free to use.
2. How often is the data updated?
The API fetches the current Ethiopian date dynamically, ensuring accurate results every time.
3. Can I use this for commercial applications?
Yes, you can use the API for both personal and commercial projects.
4. How do I report an issue or suggest improvements?
Contact us at [email protected] for any queries or feedback.
Conclusion
The Ethiopian Date API simplifies Ethiopian calendar integration for developers and organizations. With support for Amharic and English, it ensures seamless usage for a wide range of applications.
Get started today and bring Ethiopian calendar functionality to your projects!
For more information, visit: EthioAll.com
This version is clean, detailed, and tailored for public-facing documentation on another website.
Labels : #code ,