Skip to content

Authentication

All endpoints require a valid API key to access the Islamic API.

Getting an API Key

To generate an API key, log in to the dashboard and create a key from your account settings.

This key will be used to authenticate requests to the API.


Using Your Key

You can pass the API key in two ways:

Query Parameter

?api_key=YOUR_API_KEY

Example:

bash
curl "https://your-domain.com/api/v1/qibla?lat=24.7136&lon=46.6753&api_key=YOUR_KEY"

Request Header

X-API-Key: YOUR_API_KEY

Example:

bash
curl -H "X-API-Key: YOUR_KEY" \
  "https://your-domain.com/api/v1/qibla?lat=24.7136&lon=46.6753"

Error Responses

If the API key is missing or invalid, the API returns a 401 error:

json
{
  "success": false,
  "error": "Unauthorized",
  "message": "Invalid or missing API key."
}
Tip: Keep your API key private. Do not expose it in client-side code or public repositories.

Free & Open Source Islamic API