Why I decided to build my own prayer times API for Singapore
updatesI decided to build my own API for Singapore prayer times for a few practical reasons.
First, the official dataset from data.gov.sg has limitations for real-world use. It doesn’t include the Hijri date, the prayer times are not in a clean hour-based format, and there is only a single endpoint that returns all prayer times for the entire year. That makes it less flexible for applications that just want “today” or a specific date.
Second, there’s the yearly transition problem. During the switch from one year to the next (for example, 2025 to 2026), there’s an unavoidable downtime because the new year’s prayer times have to be uploaded right at midnight. By maintaining my own database, I can preload the next year’s data ahead of time and avoid this fragile midnight dependency entirely.
With these two issues solved at the API level, the main app becomes much simpler. All formatting—time normalization, Hijri dates, and friendly date handling—is done once in api.prayertimes.sg. The frontend’s job is just to fetch clean, ready-to-use data. This is the core architecture for version 1.0. Before v1.0, all of this logic lived inside the main app, which made it heavier and harder to maintain.
Finally, this API isn’t just for my own use. Other developers can build on top of it as well. The data remains trustworthy because it is still based on the official prayer times published by Majlis Ugama Islam Singapura, but packaged in a more developer-friendly way.