Mosque API Reference
Base URL: http://localhost:8081 (Development)
Authentication: X-API-Key header required for some endpoints.
Endpoints
1. Get Masjids
Retrieve a list of masjids, optionally filtered by location.
- URL:
/masjids - Method:
GET - Query Parameters:
city(optional): Filter by city name.country(optional): Filter by country name.
- Response:
200 OK
[
{
"id": "1",
"name": "Regents Park Mosque",
"city": "London",
"country": "UK",
"timezone": "Europe/London",
"website": "https://iccuk.org",
"phone": "+44 20 7724 3363",
...
}
]2. Create Masjid
Add a new masjid to the directory.
- URL:
/masjids - Method:
POST - Body:
{
"name": "East London Mosque",
"address": "82-92 Whitechapel Rd",
"city": "London",
"country": "UK",
"timezone": "Europe/London",
"latitude": 51.518,
"longitude": -0.066
}- Response:
201 Created
3. Get Prayer Times
Get prayer times for a specific masjid.
- URL:
/prayer-times - Method:
GET - Query Parameters:
masjid_id(required): ID of the masjid.
- Response:
200 OK
{
"masjid_id": "1",
"date": "2026-01-10",
"fajr": "05:30",
"dhuhr": "12:15",
"asr": "15:00",
"maghrib": "16:45",
"isha": "18:30",
"jumaah_times": ["13:00", "13:45"]
}4. Get Usage
Check API usage for the provided key.
- URL:
/usage - Method:
GET - Headers:
X-API-Key: Your API key.
- Response:
200 OK
{
"api_key": "abc-123",
"usage": 42
}Last updated on