Salah APIsalah.com ↗
Get Islamic prayer times for any location via salah.com. Query by coordinates, city name, or homepage defaults. Returns Fajr, Dhuhr, Asr, Maghrib, Isha, and more.
What is the Salah API?
The salah.com API exposes 4 endpoints for retrieving daily Islamic prayer times — Fajr, Sunrise, Dhuhr, Asr, Maghrib, Isha, and Qiyam — for locations worldwide. Use get_prayer_times_by_coordinates to query by latitude and longitude, or get_all_prayer_times_for_location to pass a city name or address and receive geocoded results. Each response includes a times object mapping prayer names to scheduled times, a location string, and optional calculation method details.
curl -X GET 'https://api.parse.bot/scraper/ef45bcf1-9fcb-49c5-bf70-392cbc9e4dbf/get_prayer_times_by_coordinates?latitude=40.7128&longitude=-74.0060&method_id=1' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace salah-com-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Walkthrough: Salah SDK — prayer times by coordinates, city name, and auto-detect."""
from parse_apis.salah.com_prayer_times_api import Salah, MethodId, NotFoundError
salah = Salah()
# Get prayer times by coordinates (New York City)
nyc_schedule = salah.schedules.by_coordinates(latitude=40.7128, longitude=-74.0060)
print(nyc_schedule.location, nyc_schedule.times)
# Get prayer times by city name with a specific calculation method
london_schedule = salah.schedules.by_location_name(location="London, UK", method_id=MethodId._2)
print(london_schedule.location, london_schedule.times)
# Get default prayer times from homepage (auto-detected location)
homepage_schedule = salah.schedules.from_homepage()
print(homepage_schedule.location, homepage_schedule.calculation_method)
# Typed error handling: wrap a fallible call
try:
remote_schedule = salah.schedules.by_coordinates(latitude=0.0, longitude=0.0)
print(remote_schedule.location, remote_schedule.times)
except NotFoundError as exc:
print(f"Location not found: {exc}")
print("exercised: schedules.by_coordinates / schedules.by_location_name / schedules.from_homepage")
Fetches today's prayer times for a given location using latitude and longitude coordinates. Returns prayer names (Fajr, Sunrise, Dhuhr, Asr, Maghrib, Isha, Qiyam) with their times formatted as 'HH:MM AM/PM'. Uses the salah.com /get endpoint with coordinate parameters. If coordinates resolve to no known location, returns input_not_found.
| Param | Type | Description |
|---|---|---|
| latituderequired | number | Latitude of the location (e.g. 40.7128) |
| longituderequired | number | Longitude of the location (e.g. -74.0060) |
| method_id | integer | Calculation method ID for prayer time computation. When omitted, the site uses its default method for the region. |
{
"type": "object",
"fields": {
"times": "object mapping prayer names (Fajr, Sunrise, Dhuhr, Asr, Maghrib, Isha, Qiyam) to their scheduled times in HH:MM AM/PM format",
"method": "object, calculation method details (may be empty object)",
"location": "string, address or area name for the coordinates"
},
"sample": {
"data": {
"times": {
"Asr": "4:54 PM",
"Fajr": "3:45 AM",
"Isha": "10:04 PM",
"Dhuhr": "12:55 PM",
"Qiyam": "1:51 AM",
"Maghrib": "8:25 PM",
"Sunrise": "5:24 AM"
},
"method": {},
"location": "260 Broadway, New York"
},
"status": "success"
}
}About the Salah API
Endpoints and Response Shape
The API provides three main ways to retrieve prayer times. get_prayer_times_by_coordinates accepts latitude and longitude as required inputs plus an optional method_id for selecting a specific prayer time calculation method. It returns a times object (prayer name → scheduled time), a location string describing the area, and a method object with calculation method details. get_all_prayer_times_for_location takes a location string such as "London, UK" or "Cairo", geocodes it, and returns the same times, location, and method fields. The method_id parameter is also available here to pin a specific calculation standard.
Homepage and Mosque Endpoints
get_prayer_times_homepage requires no inputs and returns the default prayer times, detected location name, and calculation_method string as shown on the salah.com homepage — useful for testing or for building a generic widget that reflects the site's own defaults. get_mosques is a separate endpoint that attempts to return mosque directory information for a location, but coverage is limited: the response returns a status and message field, and mosque data may not be available for all regions.
Prayer Times and Calculation Methods
All time-returning endpoints expose seven named prayers: Fajr, Sunrise, Dhuhr, Asr, Maghrib, Isha, and Qiyam. The optional method_id parameter on coordinate and location endpoints lets callers specify the calculation authority (e.g., ISNA, MWL, Egyptian General Authority) where salah.com supports multiple methods. If method_id is omitted, salah.com applies its own default for the queried location.
The Salah API is a managed, monitored endpoint for salah.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when salah.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official salah.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Display today's prayer schedule in a Muslim lifestyle mobile app using
get_prayer_times_by_coordinateswith device GPS coordinates - Send daily prayer time notifications by querying
get_all_prayer_times_for_locationfor a user's saved city each morning - Build a prayer time widget for a mosque website that shows Fajr through Isha times for a fixed location
- Compare prayer times across different calculation methods by calling the coordinates endpoint with different
method_idvalues for the same lat/lng - Populate a world clock-style dashboard showing prayer times for multiple cities via repeated calls to
get_all_prayer_times_for_location - Verify or cross-check Qiyam (night prayer) times programmatically for scheduling automated reminders
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does salah.com have an official developer API?+
What does the `method_id` parameter control and which endpoints support it?+
method_id selects the Islamic prayer time calculation authority used to derive the schedule. It is accepted by both get_prayer_times_by_coordinates and get_all_prayer_times_for_location. When omitted, salah.com applies its default calculation method for the queried location. The method field in the response may return details about the method that was applied, though it can be empty in some cases.Are prayer times returned for future dates or just today?+
date parameter to request schedules for past or future dates. The API covers the current day's Fajr through Qiyam schedule. You can fork the API on Parse and revise it to add date-based querying if salah.com exposes that capability.Does the mosque endpoint return detailed mosque listings?+
get_mosques endpoint returns a status and message field, and mosque directory data is noted as not available for all regions. It does not currently return structured fields such as mosque names, addresses, or coordinates. You can fork the API on Parse and revise it to add a more detailed mosque data endpoint if the underlying source expands its coverage.