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 and request a project: our team reviews it (what it does, a link, screenshots). Once it is approved, create a key: a secret key (mbx_sk_live_…) for a server, or a publishable key (mbx_pk_live_…) for a mobile app. The secret is shown once, so copy it before you leave the page.
export MASJIDBOX_KEY="mbx_sk_live_…"From an agent
Your coding agent can create the account and request the project for you, with no browser. It asks for a code, you read it in your mail and give it back:
curl -X POST https://hub.masjidbox.com/api/public/developer/sign-up \
-H "Content-Type: application/json" -d '{ "email": "you@example.com" }'
# → 202 { "sent": true }: a six-digit code is on its way, valid 15 minutes
curl -X POST https://hub.masjidbox.com/api/public/developer/sign-up/verify \
-H "Content-Type: application/json" -d '{
"email": "you@example.com", "code": "042917", "acceptTerms": true,
"account": { "name": "Prayer Widget Co" },
"project": {
"name": "Mosque finder", "platforms": ["ios"], "link": "https://example.com/app",
"intendedUse": "Shows the nearest mosques and today’s prayer times.",
"audience": "10,000 – 100,000 monthly users",
"screenshots": [{ "contentType": "image/png", "sizeBytes": 412000 }]
}
}'
# → 201 the account, the project pending review, a presigned upload per screenshot
# and an uploadToken
curl -X PUT "<the screenshot's upload url>" -H "Content-Type: image/png" --data-binary @screenshot.png
curl -X POST https://hub.masjidbox.com/api/public/developer/sign-up/screenshots/<screenshotId>/confirm \
-H "Content-Type: application/json" -d '{ "token": "<uploadToken>" }'
# → 200: once every screenshot is confirmed, the project reaches reviewGiving the code back accepts the developer terms: read them before you do. The review is the same as from the console, and so is the next step: once the project is approved, sign in to the console to create the key.
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": { "athan": "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.