Next Salah API is a simple and personal project designed to provide the next prayer time for Muslims. This API calculates time left before the upcoming Salah (prayer) time based on the user's location.
- Retrieves all prayer times for a given day.
- Provides the next prayer time based on the user's location.
-
Clone the repository:
git clone https://github.com/usefmahmud/next-salah-api.git
-
Navigate to the project directory:
cd next-salah-api
-
Install the required dependencies:
pip install -r requirements.txt
-
Run the FastAPI development server:
uvicorn main:app --reload
Retrieves all prayer times for a given day based on the provided address.
Parameters:
- address: The address to get the prayer times for. Default is 'Cairo, Egypt'.
- date: The date to get the prayer times for. Default is today's date.
Response:
[
{
"name": "Fajr",
"time": "05:00"
},
{
"name": "Dhuhr",
"time": "12:00"
},
{
"name": "Asr",
"time": "15:00"
},
{
"name": "Maghrib",
"time": "18:00"
},
{
"name": "Isha",
"time": "20:00"
}
]
Retrieves the next prayer time based on the provided address.
Parameters:
- address: The address to get the next prayer time for. Default is 'Cairo, Egypt'.
Response:
{
"next": {
"name": "Dhuhr",
"time": "12:00"
},
"time_left": 3600
}