Quickstart
Make your first call in three steps. Every example uses curl: there is no SDK to install yet.
1. Get a key
Sign in to the console with your email, create a project, then a key: a secret key (mbx_sk_live_…) for a server, or a publishable key (mbx_pk_live_…) for a browser or a mobile app. The secret is shown once, so copy it before you leave the page.
export MASJIDBOX_KEY="mbx_sk_live_…"2. Find a masjid
Search by name. Each result carries the masjid's id, which every other call takes.
curl "https://hub.masjidbox.com/v1/masjids/search?q=paris" \
-H "Authorization: Bearer $MASJIDBOX_KEY"
# → { "object": "list", "data": [ { "id": "msj_ap20t2m2tk", "name": "…" }, … ] }To list the masjids around a point instead, call GET /v1/masjids/nearby?lat=…&lon=….
3. Read its prayer times
curl https://hub.masjidbox.com/v1/masjids/msj_ap20t2m2tk/prayer-times \
-H "Authorization: Bearer $MASJIDBOX_KEY"
# → { "object": "prayer_times", "prayers": { "fajr": { "adhan": "06:41", … } }, … }Times are wall-clock HH:mm in the masjid's timezone. source.type says whether the masjid supplied them (masjid) or Masjidbox calculated them (calculated).
4. Show the attribution
Wherever you display this data, show "Prayer times provided by Masjidbox" with its two links: one to report an error, one to the masjid's links.claim. The attribution guide has the snippet.
Next
- Authentication: secret and publishable keys.
- Limits & quotas: what a project may call, and how to ask for more.
- Errors: every refusal, and what to do about it.