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
- With git
git clone https://github.com/h3ave/apisports_football
cd apisports_football
pip install -r requirements.txt
- With pip
pip install apisports-football
- Python >= 3.7
- aiohttp
- pydantic
- typing-extensions
Register on API-Sports.
Go to profile and copy key from API-Key field.
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())