Skip to content
All Masjids FIND · PRAY · CONNECT

Developers

Put masjids’ prayer and jamaat times on your website, app or screen. Free, with a key.

What You Get

Published Masjids Only

Every masjid in the API has a published timetable. Where a masjid hasn’t published, we don’t offer calculated times in its name.

Whose Times They Are

Each masjid says where its times come from: committee (the masjid’s own), checked (checked by All Masjids) or pending (not yet checked).

Calculated Days Marked

Past the end of a masjid’s own timetable, begin times are calculated by our prayer engine and the day says calculated: true. We never guess a jamaat.

JSON, CSV and Calendar

Daily times for up to a year at a time, a month as CSV, a calendar feed of jamaat times, masjid search and a widget for any website.

Times are 24-hour HH:MM in the masjid’s own timezone. The full description is on OpenAPI (openapi.json), and a typed JavaScript client is in @allmasjids/client.

Get a Key

Keys are free. We email yours: it’s never shown on this page and we don’t keep a copy, so keep the email safe.

The website, app or screen, and roughly who will see it. Up to 500 characters.

Authentication and Limits

Send your key with every request as a header:

Authorization: Bearer amk_your_key

Or, where you can’t send headers (calendar apps, a quick try in the browser), add it to the address as ?key=amk_your_key. Anyone who sees an address with a key in it can use the key, so share those only with people you trust, and never put a key in a public web page: call the API from your server. (The widget needs no key.)

Each key may make 600 requests an hour. Past that the API answers 429 with a Retry-After header saying how many seconds to wait. Times change a few times a month at most, so cache answers rather than asking on every page view.

The base address is https://allmasjids.com/api/public/v1.

Endpoints

Every JSON answer carries attribution: the words to show and the link to give them.

Find Masjids

GET/masjids

By name or address (q), town, or near a point (lat and lng, nearest first, within radius_km). 50 a page, A to Z unless near a point.

qoptional
Words in the name or address.
townoptional
The town, as the masjid’s page names it.
latoptional
Latitude, with lng.
lngoptional
Longitude, with lat.
radius_kmoptional
How far from lat/lng, in kilometres. Default 10.
pageoptional
Default 1.
Sample Answer
{
    "data": [
        {
            "slug": "riverside-masjid",
            "name": "Riverside Masjid",
            "address": "12 River Street, Hillford, HF1 2AB",
            "town": "Hillford",
            "postcode": "HF1 2AB",
            "latitude": 53.7957,
            "longitude": -1.5492,
            "distance_km": null,
            "timetable": {
                "source": "committee"
            },
            "page_url": "https://allmasjids.com/masjid/riverside-masjid"
        }
    ],
    "meta": {
        "page": 1,
        "per_page": 50,
        "total": 1
    },
    "attribution": {
        "text": "Prayer times from All Masjids (allmasjids.com)",
        "url": "https://allmasjids.com"
    }
}

One Masjid

GET/masjids/{slug}

slugin the path
The masjid’s slug, from /masjids.
Sample Answer
{
    "data": {
        "slug": "riverside-masjid",
        "name": "Riverside Masjid",
        "address": "12 River Street, Hillford, HF1 2AB",
        "town": "Hillford",
        "postcode": "HF1 2AB",
        "latitude": 53.7957,
        "longitude": -1.5492,
        "distance_km": null,
        "timetable": {
            "source": "committee"
        },
        "page_url": "https://allmasjids.com/masjid/riverside-masjid",
        "timezone": "Europe/London",
        "published_at": "2026-10-30T18:04:11+00:00"
    },
    "attribution": {
        "text": "Prayer times from All Masjids (allmasjids.com)",
        "url": "https://allmasjids.com/masjid/riverside-masjid"
    }
}

Daily Times

GET/masjids/{slug}/times

Today to six days on unless from/to are given. At most 366 days, from the start of the month 12 months back to 13 months ahead.

slugin the path
The masjid’s slug, from /masjids.
fromoptional
First date, YYYY-MM-DD. Default today, in the masjid’s timezone.
tooptional
Last date, YYYY-MM-DD. Default six days after from.
Sample Answer
{
    "data": [
        {
            "date": "2026-11-06",
            "weekday": "Friday",
            "begins": {
                "fajr": "05:41",
                "sunrise": "07:12",
                "dhuhr": "11:56",
                "asr": "14:08",
                "maghrib": "16:30",
                "isha": "17:58"
            },
            "jamaat": {
                "fajr": "06:15",
                "dhuhr": "12:45",
                "asr": "14:30",
                "maghrib": "16:35",
                "isha": "19:30"
            },
            "jumuah": [
                "12:45",
                "13:30"
            ],
            "calculated": false
        }
    ],
    "meta": {
        "masjid": "riverside-masjid",
        "timezone": "Europe/London",
        "source": "committee",
        "from": "2026-11-06",
        "to": "2026-11-06"
    },
    "attribution": {
        "text": "Prayer times from All Masjids (allmasjids.com)",
        "url": "https://allmasjids.com/masjid/riverside-masjid"
    }
}

A Month as CSV

GET/masjids/{slug}/month.csv

UTF-8 with a byte-order mark, one row a day: Date, Day, Fajr, Fajr Jamaat, Sunrise, Dhuhr, Dhuhr Jamaat, Asr, Asr Jamaat, Maghrib, Maghrib Jamaat, Isha, Isha Jamaat, Jumuah (space-separated), Calculated (yes or empty).

slugin the path
The masjid’s slug, from /masjids.
monthoptional
YYYY-MM. Default this month.
Sample Answer
Date,Day,Fajr,Fajr Jamaat,Sunrise,Dhuhr,Dhuhr Jamaat,Asr,Asr Jamaat,Maghrib,Maghrib Jamaat,Isha,Isha Jamaat,Jumuah,Calculated
2026-11-06,Friday,05:41,06:15,07:12,11:56,12:45,14:08,14:30,16:30,16:35,17:58,19:30,12:45 13:30,

Calendar Feed

GET/masjids/{slug}/calendar.ics

Each jamaat (and Jumu’ah on Fridays, in place of Dhuhr) of the next 60 days as a 10-minute event. Calendar apps can’t send headers, so subscribe with ?key= in the address; the feed asks to be refreshed hourly.

slugin the path
The masjid’s slug, from /masjids.

Widget Times (No Key)

GET/widget/{slug}

No key needed; 120 requests a minute per address. Used by https://allmasjids.com/widget.js.

slugin the path
The masjid’s slug, from /masjids.
Sample Answer
{
    "data": [
        {
            "date": "2026-11-06",
            "weekday": "Friday",
            "begins": {
                "fajr": "05:41",
                "sunrise": "07:12",
                "dhuhr": "11:56",
                "asr": "14:08",
                "maghrib": "16:30",
                "isha": "17:58"
            },
            "jamaat": {
                "fajr": "06:15",
                "dhuhr": "12:45",
                "asr": "14:30",
                "maghrib": "16:35",
                "isha": "19:30"
            },
            "jumuah": [
                "12:45",
                "13:30"
            ],
            "calculated": false
        }
    ],
    "meta": {
        "masjid": "Riverside Masjid",
        "slug": "riverside-masjid",
        "timezone": "Europe/London",
        "source": "committee",
        "page_url": "https://allmasjids.com/masjid/riverside-masjid"
    },
    "attribution": {
        "text": "Prayer times from All Masjids (allmasjids.com)",
        "url": "https://allmasjids.com/masjid/riverside-masjid"
    }
}

Examples

curl

# Masjids near a point, nearest first
curl -H "Authorization: Bearer $ALLMASJIDS_KEY" \
  "https://allmasjids.com/api/public/v1/masjids?lat=53.80&lng=-1.55&radius_km=5"

# A week of times
curl -H "Authorization: Bearer $ALLMASJIDS_KEY" \
  "https://allmasjids.com/api/public/v1/masjids/riverside-masjid/times?from=2026-11-01&to=2026-11-07"

JavaScript With @allmasjids/client

A small typed client with no dependencies, for Node 18 and later. Install it with npm install @allmasjids/client.

import { createClient, AllMasjidsApiError } from '@allmasjids/client'

const api = createClient({ key: process.env.ALLMASJIDS_KEY })

const { data } = await api.searchMasjids({ lat: 53.8, lng: -1.55, radiusKm: 5 })
const { data: days, attribution } = await api.getTimes(data[0].slug, { from: '2026-11-01', to: '2026-11-07' })
console.log(days[0].begins.fajr, days[0].jamaat.fajr, attribution.text)

try {
  await api.getMasjid('nowhere')
} catch (e) {
  if (e instanceof AllMasjidsApiError) console.log(e.status, e.code, e.retryAfter)
}

JavaScript With fetch

const response = await fetch('https://allmasjids.com/api/public/v1/masjids/riverside-masjid/times', {
  headers: { Authorization: `Bearer ${process.env.ALLMASJIDS_KEY}` },
})
if (!response.ok) throw new Error((await response.json()).message)
const { data, meta } = await response.json()
for (const day of data) console.log(day.date, day.jamaat.isha ?? 'no jamaat set', day.calculated ? '(calculated)' : '')

PHP

$context = stream_context_create(['http' => [
    'header' => 'Authorization: Bearer '.getenv('ALLMASJIDS_KEY'),
    'ignore_errors' => true,
]]);
$answer = json_decode(file_get_contents('https://allmasjids.com/api/public/v1/masjids/riverside-masjid/times', false, $context), true);

foreach ($answer['data'] as $day) {
    echo $day['date'], ' Fajr ', $day['begins']['fajr'], ', jamaat ', $day['jamaat']['fajr'] ?? '–', PHP_EOL;
}
echo $answer['attribution']['text'];

Calendar and CSV

A masjid’s jamaat times for the next 60 days, each a 10-minute event (Jumu‘ah in Dhuhr’s place on Fridays), as a feed calendar apps check every hour. Subscribe with the key in the address:

https://allmasjids.com/api/public/v1/masjids/riverside-masjid/calendar.ics?key=amk_your_key

A month as CSV (UTF-8, opens straight into Excel or Google Sheets), one row a day with the begin and jamaat times, Jumu‘ah and whether the day is calculated:

https://allmasjids.com/api/public/v1/masjids/riverside-masjid/month.csv?month=2026-11&key=amk_your_key

Widget

Today’s begin and jamaat times for one masjid, with the next jamaat lit and Jumu‘ah on Fridays, in a box on any web page. No key needed: paste this where the box should go, with the masjid’s slug (the end of its address on All Masjids):

<script src="https://allmasjids.com/widget.js" data-masjid="riverside-masjid" data-theme="light" async></script>

Use data-theme="dark" on a dark page. The box keeps its own styles, so your page’s styles won’t change it, and it moves on to the next jamaat by itself. A masjid’s committee can also embed its times from its dashboard (Your Times on Your Website).

Errors

Errors come back as JSON with an error code and a message to read:

{
    "error": "not_found",
    "message": "No masjid with that slug has a published timetable. Search /masjids to find one."
}
StatusErrorMeaning
401key_missingNo key was sent.
401key_invalidWe don’t know that key, or it has been turned off.
404not_foundNo masjid with that slug has a published timetable.
422bad_rangeThe dates are out of order, more than 366 days, or outside 12 months back to 13 months ahead.
422–A parameter we can’t read: the answer has message and errors, field by field.
429rate_limitedToo many requests this hour: wait for the seconds in Retry-After.

Fair Use and Attribution

Draft for review: the parts in square brackets are still to be confirmed.

  • Free. The API, the calendar feeds, the CSV and the widget are free [for any website, app or screen that keeps to these terms, including commercial ones].
  • Say where the times come from. Wherever you show them, show “Prayer times from All Masjids (allmasjids.com)” with a link to the masjid’s page on All Masjids (attribution.url) or to allmasjids.com. [Masjid names and places include data from © OpenStreetMap contributors, under the ODbL.]
  • Don’t speak for the masjid. Don’t present the times as the masjid’s own announcement, or as coming from the masjid itself [unless you are its committee]. Where a masjid’s times say pending, they haven’t been checked yet.
  • Don’t resell the data. Don’t sell the times or the listings, or pass them on in bulk for others to use [, or use them to build a rival directory].
  • Keep to the limits. 600 requests an hour per key, one person or organisation [up to three keys]; cache answers rather than asking on every page view.
  • We may turn a key off if it’s misused or puts the service at risk [, and will email you first where we can].
  • Times can change. Masjids change their jamaat times through the year, sometimes at short notice. Fetch them again [at least once a day], and check with the masjid for anything that matters. [All Masjids does its best to keep the times right but can’t promise they always are.]

Questions, or a project that needs more? Contact us.