A simple C# app to fetch Namaz / Prayer Times for a given location using APIs.
- Detects user location (via IP geolocation or manual lat/long)
- Supports multiple calculation methods / madhab (e.g. Hanafi, etc.)
- Fetches prayer times from an API (e.g. UmmahAPI)
- Parses and displays Fajr, Dhuhr, Asr, Maghrib, Isha times
- .NET SDK (.NET 9.0)
- Internet access (to call the external API)
- (Optional) API key if the API requires one
-
Clone the repo:
git clone https://github.com/SheriPrime/prayerTimings.git cd prayerTimings -
Restore and build:
dotnet restore dotnet build
-
Run:
dotnet run
Or run the compiled executable from
/bin/Debug/...or/bin/Release/....
You can create a single .exe (with .NET runtime bundled) so your Windows friend can run it without needing .NET installed:
dotnet publish -c Release -r win-x64 --self-contained true /p:PublishSingleFile=trueand if your friend uses linux,
dotnet publish -c Release -r linux-x64 --self-contained true /p:PublishSingleFile=trueThen share the generated .exe from bin/Release/netX.X/win-x64/publish/.
In your code, you’ll:
- Get user latitude/longitude (via IP geolocation or manual input)
- Construct the API request URL (e.g.
https://api.ummahapi.com/api/prayer-times?lat={lat}&lng={lng}&madhab=Hanafi&method=MuslimWorldLeague) - Send HTTP request using
HttpClient - Parse the JSON response (extract
dataand prayer times)