rishavganguly007 / football-API-client

An API wrapper for the API-football
MIT License
2 stars 3 forks source link
api-client hactoberfest python

footballAPIClient

A simple wrapper around the football API provided by @API-SPORTS. For full documentation on the API endpoints and subscription details, refer to API-FOOTBALL. Usage of this package requires any level of subscription and an API-KEY.

Installation

pip install footballapiclient

Usage

Create the client

from  footballAPIClient  import  footballAPI

fp  =  footballAPI.FootballAPI("api-sports", api_key="YOUR_API_KEY")

Arguments:

Examples

Getting the country data by calling the countries API.

print(fp.get_countries())



Arguments:

name: (optional) The name of the country  
code:  (optional) The Alpha2 code of the country 
search:  (optional) The name of the country
:return: Returns the Country json schema


Output:

{ "get": "countries", "parameters": { "name": "england" }, "errors": [], "results": 1, "paging": { "current": 1, "total": 1 }, "response": [ { "name": "England", "code": "GB", "flag": "https://media.api-sports.io/flags/gb.svg" } ] }