https://github.com/usefmahmud/next-salah-api
Personal API for getting information about salah timing, upcoming salah, and the time left befire it.
https://github.com/usefmahmud/next-salah-api
fastapi python salah
Last synced: about 2 months ago
JSON representation
Personal API for getting information about salah timing, upcoming salah, and the time left befire it.
- Host: GitHub
- URL: https://github.com/usefmahmud/next-salah-api
- Owner: usefmahmud
- Created: 2024-12-21T03:02:26.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-01T05:00:32.000Z (over 1 year ago)
- Last Synced: 2025-03-27T03:44:24.965Z (about 1 year ago)
- Topics: fastapi, python, salah
- Language: Python
- Homepage: https://next-salah-api.vercel.app
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Next Salah API
## Overview
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.
## Features
- Retrieves all prayer times for a given day.
- Provides the next prayer time based on the user's location.
## Installation
1. Clone the repository:
```bash
git clone https://github.com/usefmahmud/next-salah-api.git
```
2. Navigate to the project directory:
```bash
cd next-salah-api
```
3. Install the required dependencies:
```bash
pip install -r requirements.txt
```
4. Run the FastAPI development server:
```bash
uvicorn main:app --reload
```
## API Endpoints
### Get All Salah Times
#### `GET /all_salah`
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:**
```json
[
{
"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"
}
]
```
### Get Next Salah Time
#### `GET /next_salah`
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:**
```json
{
"next": {
"name": "Dhuhr",
"time": "12:00"
},
"time_left": 3600
}
```