Skip to content

Asynchronous wrapper for football API from API-SPORTS

License

Notifications You must be signed in to change notification settings

h3ave/apisports_football

Repository files navigation

apisports_football

PyPI version python

Russian version

It's a handy API wrapper that makes it easy to work with https://www.api-football.com/.

Official documentation: https://www.api-football.com/documentation-v3

Installing

  • With git
git clone https://github.com/h3ave/apisports_football
cd apisports_football
pip install -r requirements.txt
  • With pip
pip install apisports-football

Dependencies

  • Python >= 3.7
  • aiohttp
  • pydantic
  • typing-extensions

Getting API Key

Register on API-Sports.

Go to profile and copy key from API-Key field.

Usage example

import asyncio
from apisports_football import Wrapper

api = Wrapper('TOKEN_HERE')

async def main() -> None:
    data = await api.leagues().get(
        country = 'Spain',
        season = 2024
    )
    print(data)

if __name__ == '__main__':
    asyncio.run(main())