Skip to content

Debi-Ejeta/soccer-api-wrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

soccer-api-wrapper

soccer-api-wrapper is a library for getting information about soccer matches in the five big club competitions, with live score, fixtures, and stats of games available.

codecov Build Status PyPI Documentation Status Github Page

Overview

As writing GET and POST requests multiple times to get data can be frustrating, the library will streamline the process of retrieving information about soccer by making the API calls under the hood as an API Wrapper. So if anyone wants to create an app or a bot on apps like Telegram, they will be able to make use of this library to easily create their apps or bots for anything related to soccer without having to make api calls every single time.

Getting Started

To get started using this library follow the instructions below.

Installing

If you run into an issue please check the closed issues on the github, although feel free to re-open a new issue if you find an issue that's been closed for a few months. The codebase can and does run into similar issues as it has before, because the api this library is based on changes things up.

pip install soccer_api_wrapper

Quick Start Guide

In order to use this library, you will need to first get an API token from https://www.football-data.org/ as this library is completely based on that API and you will need to provide that token every time you use the functions listed below

In the first verion of this library, only the premier league is supported. Other league functionalities will be added in future versions.

[Project Preview]

Similarly, there are other functions you can call on soccerapi after importing it:

# returns the matches happening within the next couple of days
soccerapi.get_recent_matches("YourAPIToken")
# returns the matches happening for the team inputted
soccerapi.get_epl_team_matches("YourAPIToken", "TeamName")
# returns the top scorers in the premier league
soccerapi.get_epl_top_scorers("YourAPIToken")
# returns the premier league matches on Matchday 12
soccerapi.get_epl_matchday("YourAPIToken", 12)
# returns information about the team inputted
# You can access the team_ids down below
soccerapi.get_team_info("YourAPIToken", "team_id")
# returns the teams that are currently in the premier league
soccerapi.get_epl_teams("YourAPIToken")
# returns information about the player with player_id = 44
soccerpi.get_recent_matches("YourAPIToken", 44)

You can find the IDs of the teams in the premier league below

Team_ID Team Name
57 Arsenal
65 Manchester City
66 Manchester United
73 Tottenham Hotspur
67 Newcastle United
63 Fulham
64 Liverpool
397 Brighton & Hove Albion
402 Brentford
61 Chelsea
58 Aston Villa
354 Crystal Palace
351 Nottingham Forest
338 Leicester City
76 Wolverhampton Wanderers
563 West Ham United
341 Leeds United
62 Everton
1044 Bournemouth
340 Southampton