Skip to content

usefmahmud/next-salah-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

    git clone https://github.com/usefmahmud/next-salah-api.git
  2. Navigate to the project directory:

    cd next-salah-api
  3. Install the required dependencies:

    pip install -r requirements.txt
  4. Run the FastAPI development server:

    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:

[
    {
        "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:

{
    "next": {
        "name": "Dhuhr",
        "time": "12:00"
    },
    "time_left": 3600
}

About

Personal API for getting information about salah timing, upcoming salah, and the time left befire it.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages