Skip to main content

Python API wrapper for OneFootball undocumented API

Project description

onefootball-wrapper - A OneFootball API Wrapper

A Python wrapper for the OneFootball API, providing easy access to football (soccer) data including players, clubs, competitions, transfers, and more.

PyPI Downloads

Features

  • Player Data: Transfers, injuries, profiles
  • Club Data: Squads, stadiums, transfers
  • Competition Data: Tables, participating clubs
  • Search Functionality: Players, clubs, leagues

Installation

pip install onefootball-wrapper

Example usage

import asyncio
from onefootball import OneFootball

import json

async def main():
    async with OneFootball() as of:
        # Search for players
        results = await of.search("saka")
        print(json.dumps(results, indent = 4))
        
        # Get team information
        team = await of.get_team(2)  # Arsenal
        print(json.dumps(team, indent = 4))
        
        # Get today's matches
        matches = await of.get_today_matches()
        print(json.dumps(matches, indent = 4))

asyncio.run(main())

Complete API Reference

Search Endpoints

Method Description Example
search(query: str) Search for players, teams, etc. search("saka")
search_players(query: str) Search for players search("saka")
search_teams(query: str) Search for teams search_teams("arsenal")
search_competitions(query: str) Search for competitions search_competitions("premier league")
search_news(query: str) Search for news search_news("premier league")

Team Endpoints

Method Description Example
get_team(team_id: int) Get team data get_team(2)
get_team_transfers(team_id: int) Get team transfers get_team_transfers(2)
get_team_relevant_items(team_id: int) Get team relevant news get_team_relevant_items(2)
get_team_news(team_id: int) Get team news get_team_news(2)
get_team_season_stats(team_id: int, season_id: int, current_group: int = 1, games_n: int = 5) Get team season stats get_team_season_stats(2, 43029)
get_team_fixtures(team_id: int, since_date: Optional[date] = None) Get team fixtures get_team_fixtures(2)
get_team_next_match(team_id: int) Get team next fixture get_team_next_match(2)
get_team_previous_match(team_id: int, until_date: Optional[str] = None) Get team last fixture get_team_previous_match(2)

Competition Endpoints

Method Description Example
get_competition_top_players(competition_id: int) Get top players in a competition get_competition_top_players(9)
get_competition_stats(competition_id: int, season_id: int) Get competition statistics get_competition_stats(9, 43029)
get_competition(competition_id: int) Get competition info get_competition(9)
get_competition_matches(competition_id: int, number_next: int = 1, number_previous: int = 1) Get competition matches get_competition_matches(9)
get_competition_standings(competition_id: int, season_id: int) Get competition standings get_competition_standings(9, 43029)
get_competition_video_news(competition_id: int) Get competition video news get_competition_video_news(9)
get_competition_news(competition_id: int) Get competition news get_competition_news(9)
get_competition_transfers(competition_id: int) Get competition transfers get_competition_transfers(9)
get_competition_matchdays(competition_id: int, season_id: int) Get competition matchdays get_competition_matchdays(9, 43029)
get_competition_current_season(competition_id: int) Get competition current_season get_competition_current_season(9)
get_all_competitions() Get all competitions get_all_competitions()

Match Endpoints

Method Description Example
get_match(match_id: int, country: str = "gb") Get match information get_match(2595592)
get_match_news(match_id: int, country: str = "gb") Get match news get_match_news(2595592)
get_match_tv_listings(match_id: int, country: str = "gb") Get match TV listings get_match_tv_listings(2595592)
get_match_widget(match_id: int) Get live match widget get_match_widget(2595592)
get_match_predictions(match_id: int) Get match prediction votes get_match_predictions(2595592)
get_match_odds(match_id: int, bookmaker_id: int = 3) Get match odds get_match_odds(2595592)
get_today_matches() Get today's matches get_today_matches()
get_live_matches() Get live matches get_live_matches()
get_tomorrow_matches() Get tomorrow's matches get_tomorrow_matches()
get_matches_by_date(match_date: date)() Get matches by specific date get_matches_by_date(date(2025, 9, 14))

Player Endpoints

Method Description Example
get_player_transfers(player_id: int) Get player transfers get_player_transfers(257485)
get_player_stats(player_slug: str) Get player stats by slug get_player_stats("bukayo-saka-257485")
get_player_competition_stats(player_slug: str, season_id: int) Get player competition stats get_player_competition_stats("bukayo-saka-257485", 43072)
get_player_news(player_slug: str) Get player news by slug get_player_competition_stats("get_player_news("bukayo-saka-257485")

Rate Limiting

Be mindful of rate limits when making multiple requests. Consider adding delays between requests if you're making many calls in succession.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License.

Tips and Tricks

  • If a function requires a slug, You have to splice it from the returned URL, for example the player URL as the API does not directly provide that.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

onefootball_wrapper-0.0.3.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

onefootball_wrapper-0.0.3-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file onefootball_wrapper-0.0.3.tar.gz.

File metadata

  • Download URL: onefootball_wrapper-0.0.3.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for onefootball_wrapper-0.0.3.tar.gz
Algorithm Hash digest
SHA256 ccf39e0e2ac48f07fc643429774eeddbce1f163bcf290f06d24220a0f812ae32
MD5 dac2cdd0add23bff9c867ea2389ef086
BLAKE2b-256 cb1fd91d802f084b18a1e5241f61182645a94630e8d3edf4956ce31a363eca17

See more details on using hashes here.

File details

Details for the file onefootball_wrapper-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for onefootball_wrapper-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a33359f7ff9bdb000505cd5995f73a7adfe0f3eaba46a5f2e581db9a4c30996e
MD5 38450f396e7064500e04d795fb416b75
BLAKE2b-256 5e6bcf6225c17fe22bde07c16869511e07b4762bdc2fd6efb4b2a86961be9353

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page