hijri.api

A simple HTTP API that returns the current Islamic Hijri date for any location on Earth.

About

Supply a location — as coordinates, a city name, a timezone string, or a Google Plus Code — and the API responds with the current Hijri date in plain text, calculated against the local midnight for that location.

No authentication required. No JSON envelope. Just the date.

Query Parameters

Parameter Type Description
lat + lon float Decimal latitude and longitude. Both required together.
city string City name. Combine with country for accuracy.
country string Country name or ISO code. Optional — used with city.
timezone string IANA timezone identifier, e.g. Africa/Johannesburg.
pluscode string Google Plus Code (Open Location Code), e.g. 4FRW3J2V+PQ.
Provide at least one of the above. Parameters are resolved in this priority order: timezonelat+lonpluscodecity.

Endpoints

PathDescription
GET / Returns the Hijri date for the given location parameters.
GET /date Alias for /.
GET /health Returns ok — for uptime monitoring.

Response

Always text/plain, UTF-8. One line. No trailing markup.

Examples

Latitude & Longitude — Cape Town
https://api.hijri.co.za/date?lat=-33.92&lon=18.42

6 Dhu al-Qi'dah 1446
City & Country
https://api.hijri.co.za/date?city=Makkah&country=Saudi+Arabia

6 Dhu al-Qi'dah 1446
IANA Timezone
https://api.hijri.co.za/date?timezone=Asia/Karachi

6 Dhu al-Qi'dah 1446
Google Plus Code
https://api.hijri.co.za/date?pluscode=4FRW3J2V%2BPQ

6 Dhu al-Qi'dah 1446
Error response (400)
https://api.hijri.co.za/date?timezone=Rubbish

Error: Unknown timezone: 'Rubbish'. Use an IANA timezone string.

Command-line

curl
curl "https://api.hijri.co.za/date?timezone=Africa/Johannesburg"