Introduction
Welcome to the Ethiopian Date Conversion API! This API allows you to convert dates between the Ethiopian and Gregorian calendars. You can convert a Gregorian date to an Ethiopian date or vice versa. The API supports both single and bulk conversions, making it ideal for applications that require date conversions.
Base URL
https://api.ethioall.com/convert/api?
Try the API
Click the button below to convert a sample Ethiopian date(2016-01-01) YY-MM-DD to Gregorian:
Click the button to see the response here...
API Endpoints
1. Convert Ethiopian Date to Gregorian
To convert an Ethiopian date to Gregorian, use the ec parameter with the date in YYYY-MM-DD format.
Example Request:
https://api.ethioall.com/convert/api?ec=2016-01-01
Example Response:
[
{
"type": "toGregorian",
"day": 12,
"month": 9,
"year": 2023,
"month_name": "September",
"day_name": "Tuesday"
}
]
2. Convert Gregorian Date to Ethiopian
To convert a Gregorian date to Ethiopian, use the gc parameter with the date in YYYY-MM-DD format.
Example Request:
https://api.ethioall.com/convert/api?gc=2023-09-08
Example Response:
[
{
"type": "toEthiopian",
"day": 3,
"month": 13,
"year": 2015,
"day_name": {
"amharic": "ዓርብ",
"english": "Arb"
},
"month_name": {
"amharic": "ጳጉሜ",
"english": "Pagume"
}
}
]
3. Bulk Conversion
You can convert multiple dates at once by passing an array of dates to the ec or gc parameter. The API can handle mixed conversions (both Ethiopian and Gregorian dates) in a single request.
Example Request:
https://api.ethioall.com/convert/api?ec[]=1914-09-20&gc[]=2017-01-01&ec[]=2018-02-30
Example Response:
[
{
"type": "toEthiopian",
"day": 1,
"month": 4,
"year": 2009,
"day_name": {
"amharic": "እሑድ",
"english": "Ehud"
},
"month_name": {
"amharic": "ታኅሣሥ",
"english": "Tahsas"
}
},
{
"type": "toGregorian",
"day": 28,
"month": 5,
"year": 1922,
"month_name": "May",
"day_name": "Sunday"
},
{
"type": "toGregorian",
"day": 9,
"month": 11,
"year": 2025,
"month_name": "November",
"day_name": "Sunday"
}
]
Examples in Different Programming Languages
PHP Example
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.ethioall.com/convert/api?ec=2016-01-01");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
if ($response !== false) {
$data = json_decode($response, true);
echo "Gregorian Date: {$data[0]['day']} {$data[0]['month_name']} {$data[0]['year']}\n";
}
curl_close($ch);
Python Example
import requests
url = "https://api.ethioall.com/convert/api?gc=2023-09-08"
response = requests.get(url)
if response.status_code == 200:
data = response.json()
print(f"Ethiopian Date: {data[0]['day']} {data[0]['month_name']['english']} {data[0]['year']}")
JavaScript (Node.js) Example
const axios = require('axios');
axios.get('https://api.ethioall.com/convert/api?ec[]=2016-01-01&gc[]=2023-09-08')
.then((response) => {
console.log(response.data);
});
Ruby Example
require 'net/http'
require 'json'
url = URI.parse("https://api.ethioall.com/convert/api?ec=2016-01-01")
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 Ethiopian and Gregorian dates side by side.
- Use in mobile applications for date conversion functionality.
- Develop cultural and religious applications that require Ethiopian dates.
- Provide educational platforms with Ethiopian date conversion tools.
- Create tools for Ethiopian date comparison and analysis.