Free Mosque Prayer Times Widget — Embed on Your Website in 2 Lines
Auto-updating live prayer times for your mosque or Muslim organization. One <div> and one <script> tag. No signup, no API key, no usage limits.
Configure your widget
Or enter lat/lng manually below if your city isn't listed.
Copy and paste this into your website
<!-- Prayer Times Near Me · widget --> <div data-ptn-widget data-lat="51.5169" data-lng="-0.0653" data-tz="Europe/London" data-method="MWL" data-madhab="Shafi" data-theme="light" data-locale="en" data-name="East London Mosque"></div> <script async src="https://prayertimesnearme.com/widget.js"></script>
How it works
The widget is two pieces of HTML you paste into your website:
<div data-ptn-widget
data-lat="40.7128"
data-lng="-74.006"
data-tz="America/New_York"
data-name="Islamic Center of NYC"></div>
<script async src="https://prayertimesnearme.com/widget.js"></script>On page load, our script finds every data-ptn-widget element on your page, fetches today's prayer times for the coordinates you specified, and renders a clean card inside a Shadow DOM (so your site's CSS can't interfere with the widget, and vice versa). Times auto-refresh every 15 minutes so the countdown stays accurate.
Compatibility
Works on any website that allows custom HTML:
- WordPress — paste into a Custom HTML block or theme footer
- Squarespace — Code Block
- Wix — Embed HTML element
- Webflow — Embed component
- Shopify — paste into any liquid template
- Plain HTML / Hugo / Jekyll / Astro / Next.js — just paste in the markup
- Google Sites — Embed → Embed code
All configuration options
Set these as data-* attributes on the widget <div>:
| Attribute | Required? | Default | Notes |
|---|---|---|---|
| data-lat | Yes | — | Latitude (decimal degrees) |
| data-lng | Yes | — | Longitude (decimal degrees) |
| data-tz | No | UTC | IANA timezone (recommended for correct local times) |
| data-method | No | ISNA | ISNA, MWL, Egyptian, Karachi, UmmAlQura, Tehran, NorthAmerica |
| data-madhab | No | Shafi | Shafi or Hanafi |
| data-theme | No | light | light, dark, or emerald |
| data-locale | No | en | en or ar (Arabic, RTL) |
| data-name | No | — | Header label (e.g. mosque name) |
Public JSON API
If you'd rather build your own UI, hit our public JSON API directly. CORS-enabled, no auth required:
GET https://prayertimesnearme.com/api/widget/v1?lat=40.7128&lng=-74.006&tz=America/New_York
{
"location": { "lat": 40.7128, "lng": -74.006, "timezone": "America/New_York" },
"date": "2026-05-23",
"hijri": "6 Dhū al-Ḥijjah 1447 AH",
"method": "ISNA",
"madhab": "Shafi",
"times": {
"fajr": "04:12",
"sunrise": "05:33",
"dhuhr": "12:18",
"asr": "15:42",
"maghrib": "18:51",
"isha": "20:12"
},
"next": { "name": "Maghrib", "time": "18:51", "in_minutes": 47 },
"current_prayer": "Asr",
"qibla_degrees": 58.5,
"updated_at": "2026-05-23T15:30:00Z",
"powered_by": "https://prayertimesnearme.com"
}Cached at the Vercel edge for 5 minutes (stale-while-revalidate 60s) — so even high-traffic sites won't hit our origin. Free for non-commercial use. For commercial volume (1,000+ req/day), email us.
Why is this free?
Two reasons. First, prayer times are a basic Islamic utility and mosques shouldn't need to budget for embedding them on their websites. Second, every widget in the wild contains a small "Powered by prayertimesnearme.com" footer link — which helps people find us. Win-win.
If you want the footer removed for branding reasons, we offer a $99/year white-label tier. Contact us at [email protected].
Frequently asked questions
- Is the widget really free?
- Yes, completely free with no usage limits, no signup, and no API key required. We don't charge mosques or any non-profit. We earn a small footer credit link back to prayertimesnearme.com — that's the only ask. If you ever need to remove the credit, we offer a $99/year white-label tier (contact us).
- How do I install the widget on my mosque's website?
- Two steps: (1) Use our interactive builder on this page to configure your mosque's location, calculation method, theme, and language. (2) Copy the generated snippet (a <div> + a <script> tag) and paste it into your website wherever you want the widget to appear — homepage, sidebar, footer, anywhere HTML can go. Works on WordPress, Squarespace, Wix, Webflow, Shopify, plain HTML — anywhere.
- Will the widget slow down my website?
- No. The widget's JavaScript is loaded asynchronously (async script tag) so it doesn't block your page rendering. Total payload is ~6 KB gzipped. Prayer time data is fetched once per page load (then refreshed every 15 minutes in the background) from our globally-cached CDN — typical fetch latency is under 50 ms anywhere in the world. Lighthouse performance impact: negligible.
- Can I customize the widget's appearance?
- Yes. Three themes built in: Light (white with green accents), Dark (deep navy), and Emerald (full emerald-and-gold). Choose calculation method (ISNA, MWL, Egyptian, Karachi, Umm Al-Qura, Tehran, Jafari), madhab (Shafi/Hanafi), and language (English or Arabic with proper RTL). Need a custom theme matching your mosque's brand colors? Email us — we'll add it to the build.
- Is there a public API I can build against?
- Yes. The widget is powered by our public JSON API at /api/widget/v1. CORS-enabled, no auth required. Query parameters: ?lat=&lng=&method=&madhab=&tz=. Returns JSON with all 5 prayer times, next prayer with countdown, Qibla direction, and Hijri date. Free for any non-commercial use. For high-volume commercial use (1000+ requests/day), contact us.
- How accurate are the prayer times?
- Computed using adhan.js — the same library used by Muslim Pro, IslamicFinder, and most major prayer apps. Standards-compliant astronomical calculations. We support all 7 mainstream calculation methods. For high-latitude cities (above 48°N) where standard methods fail in summer, we apply the middle-of-night correction by default. Times are accurate to within ±1 minute of any major mosque or established prayer app.
Show your mosque some love
Building or running a mosque website? Also see our mosque finder, Qibla compass, and Zakat calculator — all linkable, all free.