This API provides data about upcoming and finished football matches. The data is scraped from BBC Sport using Python and Beautiful Soup.
The API uses Redis for caching results, It caches todays results for 30 seconds and the rest for 30 days.
The API is documented using Swagger UI.
- [GET]
/today
- Optional query parameter:
league
- supported values:pl
,sl
,gl
,sa
,fl
,cl
,in
- Optional query parameter:
- [GET]
/{date}
- date format: YYYY-MM-DD- Optional query parameter:
league
- supported values:pl
,sl
,gl
,sa
,fl
,cl
,in
- Optional query parameter:
{
"leagues": [
{
"title": "Premier League",
"matches": [
{
"home_team": "Manchester United",
"away_team": "Manchester United",
"match_status": "finished | playing | not started",
"home_team_score": "3",
"away_team_score": "0",
// or
"start_time": "15:00"
}
]
}
]
}
- Run your server and visit
http://localhost:5000/docs
in your browser.
git clone https://github.com/MikhailWahib/football-scores-api.git
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
- Install (if not) and run Redis server on default port 6379. (mandatory)
redis-server
- Run the API with
flask run