For mosques & developers

Post once, show everywhere

Mosque admins post events on the hub. The same events appear on muslimnet.co.uk/events, reach the community mailing list, and can be embedded on your mosque's own website with the free API below — no double posting.

The endpoint

GET https://muslimnet.co.uk/api/events

Returns upcoming public events as JSON, soonest first. CORS is open, so you can call it straight from your website. No key needed.

Parameters

  • mosque — your mosque's slug, to show only your own events (ask us for it, or see your mosque page in the admin panel)
  • limit — max events to return (default 50, max 100)

Each event includes

title, description, location, address, postcode, starts_at, ends_at and the mosque's name, slug and town.

Copy-paste embed

Paste this anywhere in your website's HTML and replace YOUR-MOSQUE-SLUG. It renders your upcoming events and stays up to date by itself.

<div id="muslimnet-events"></div>
<script>
(async function () {
  var el = document.getElementById("muslimnet-events");
  try {
    var res = await fetch(
      "https://muslimnet.co.uk/api/events?mosque=YOUR-MOSQUE-SLUG"
    );
    var data = await res.json();
    if (!data.events || data.events.length === 0) {
      el.textContent = "No upcoming events.";
      return;
    }
    el.innerHTML = data.events
      .map(function (e) {
        var when = new Date(e.starts_at).toLocaleString("en-GB", {
          dateStyle: "medium",
          timeStyle: "short",
        });
        var where = e.location || e.address || "";
        return (
          '<div style="margin:0 0 14px">' +
          "<strong>" + e.title + "</strong><br>" +
          when + (where ? " \u00b7 " + where : "") +
          "</div>"
        );
      })
      .join("");
  } catch (_) {
    el.textContent = "Events are unavailable right now.";
  }
})();
</script>

Want in?

We set up an admin login for your mosque, you post events and keep your helpers directory, and your website updates itself. Free for mosques. Get in touch and we'll set you up.