Hijri Date API Documentation

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:

Response:
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:

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:

Use Cases