Qibla Direction API
Get the accurate Qibla direction (direction to Mecca) from any location worldwide. Uses great circle calculations for precision and includes distance to Mecca.
Get Qibla Direction
Retrieve Qibla direction and distance to Mecca for a specific location.
GET
/v1/qiblaQuery Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| lat | float | Required | Latitude (-90 to 90) |
| lng | float | Required | Longitude (-180 to 180) |
Example Request
curl "https://api.falakapi.com/v1/qibla?lat=28.66&lng=77.07" \
-H "X-API-Key: fak_your_api_key_here"Example Response
{
"coordinates": {
"latitude": 28.66,
"longitude": 77.07
},
"qibla": {
"bearing": 291.5,
"direction": "WNW",
"direction_ar": "غرب-شمال-غرب",
"distance_km": 4234.5
},
"kaaba": {
"latitude": 21.4225,
"longitude": 39.8262
}
}Notes
- •Bearing is in degrees from True North (0-360°)
- •Direction uses 16-point cardinal system
- •Distance is calculated using great circle formula
- •Arabic direction names are included
Direction Reference
The API returns both a numeric bearing (0-360° from True North) and a cardinal direction. The bearing is more precise for compass applications.
Note: The bearing is relative to True North, not Magnetic North. For compass applications, you may need to apply magnetic declination based on your location.