This project provides a simple API to retrieve football fixtures using the Football Data API. ⚽📅
These instructions will help you set up and run the project on your local machine.
- Python 3.x 🐍
- Flask 🌐
- Requests library 📡
-
Clone the repository:
git clone https://github.com/hkimi02/football-fixtures-api.git
-
Install the required dependencies:
pip install flask requests
-
Obtain an API key from Football Data API. 🔑
-
Replace
'your_api_key'
inmain.py
with your actual API key. -
Run the Flask app:
python main.py
-
Open your browser or use a tool like
curl
or Postman to send a GET request:-
Retrieve Premier League fixtures:
http://127.0.0.1:5000/get_fixtures?league_id=2021
-
Retrieve a list of all available leagues:
http://127.0.0.1:5000/get_all_leagues
-
-
/get_fixtures
- Method: GET
- Parameters:
league_id
(required): ID of the football league (e.g., 2021 for Premier League).
-
/get_all_leagues
- Method: GET
- Retrieves a list of all available football leagues.
{
"fixtures": [
{
"homeTeam": {"name": "TeamA"},
"awayTeam": {"name": "TeamB"},
"date": "2023-01-01T18:00:00Z",
"status": "SCHEDULED"
},
// More fixtures...
]
}
Contributions are welcome! Please feel free to open issues or pull requests. 🙌