onefootball-wrapper


Nameonefootball-wrapper JSON
Version 0.0.4 PyPI version JSON
download
home_pagehttps://github.com/tommhe14/onefootball-wrapper
SummaryPython API wrapper for OneFootball undocumented API
upload_time2025-09-12 23:44:59
maintainerNone
docs_urlNone
authortommhe14
requires_python>=3.8
licenseMIT
keywords transfermarkt tmk tmkt football soccer fotmob sofascore flashscore api wrapper onefootball one football
VCS
bugtrack_url
requirements aiohttp
Travis-CI
coveralls test coverage No coveralls.
            # 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](https://static.pepy.tech/badge/onefootball-wrapper)](https://pepy.tech/projects/onefootball-wrapper)

## Features

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

## Installation

```bash
pip install onefootball-wrapper
```

## Example usage

```py
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.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/tommhe14/onefootball-wrapper",
    "name": "onefootball-wrapper",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "transfermarkt tmk tmkt football soccer fotmob sofascore flashscore api wrapper onefootball one football",
    "author": "tommhe14",
    "author_email": "theckley@yahoo.co.uk",
    "download_url": "https://files.pythonhosted.org/packages/ff/b9/670cebc263e76f8cc5c8f83106fc7007b7a210612a38183626c215eef26e/onefootball_wrapper-0.0.4.tar.gz",
    "platform": null,
    "description": "# onefootball-wrapper - A OneFootball API Wrapper\n\nA Python wrapper for the OneFootball API, providing easy access to football (soccer) data including players, clubs, competitions, transfers, and more.\n\n[![PyPI Downloads](https://static.pepy.tech/badge/onefootball-wrapper)](https://pepy.tech/projects/onefootball-wrapper)\n\n## Features\n\n- **Player Data**: Transfers, injuries, profiles\n- **Club Data**: Squads, stadiums, transfers\n- **Competition Data**: Tables, participating clubs\n- **Search Functionality**: Players, clubs, leagues\n\n## Installation\n\n```bash\npip install onefootball-wrapper\n```\n\n## Example usage\n\n```py\nimport asyncio\nfrom onefootball import OneFootball\n\nimport json\n\nasync def main():\n    async with OneFootball() as of:\n        # Search for players\n        results = await of.search(\"saka\")\n        print(json.dumps(results, indent = 4))\n        \n        # Get team information\n        team = await of.get_team(2)  # Arsenal\n        print(json.dumps(team, indent = 4))\n        \n        # Get today's matches\n        matches = await of.get_today_matches()\n        print(json.dumps(matches, indent = 4))\n\nasyncio.run(main())\n```\n\n## Complete API Reference\n\n### Search Endpoints\n\n| Method | Description | Example |\n|--------|-------------|---------|\n| `search(query: str)` | Search for players, teams, etc. | `search(\"saka\")` |\n| `search_players(query: str)` | Search for players | `search(\"saka\")` |\n| `search_teams(query: str)` | Search for teams | `search_teams(\"arsenal\")` |\n| `search_competitions(query: str)` | Search for competitions | `search_competitions(\"premier league\")` |\n| `search_news(query: str)` | Search for news | `search_news(\"premier league\")` |\n\n### Team Endpoints\n\n| Method | Description | Example |\n|--------|-------------|---------|\n| `get_team(team_id: int)` | Get team data | `get_team(2)` |\n| `get_team_transfers(team_id: int)` | Get team transfers | `get_team_transfers(2)` |\n| `get_team_relevant_items(team_id: int)` | Get team relevant news | `get_team_relevant_items(2)` |\n| `get_team_news(team_id: int)` | Get team news | `get_team_news(2)` |\n| `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)` |\n| `get_team_fixtures(team_id: int, since_date: Optional[date] = None)` | Get team fixtures | `get_team_fixtures(2)` |\n| `get_team_next_match(team_id: int)` | Get team next fixture | `get_team_next_match(2)` |\n| `get_team_previous_match(team_id: int, until_date: Optional[str] = None)` | Get team last fixture | `get_team_previous_match(2)` |\n\n\n### Competition Endpoints\n\n| Method | Description | Example |\n|--------|-------------|---------|\n| `get_competition_top_players(competition_id: int)` | Get top players in a competition | `get_competition_top_players(9)` |\n| `get_competition_stats(competition_id: int, season_id: int)` | Get competition statistics | `get_competition_stats(9, 43029)` |\n| `get_competition(competition_id: int)` | Get competition info | `get_competition(9)` |\n| `get_competition_matches(competition_id: int, number_next: int = 1, number_previous: int = 1)` | Get competition matches | `get_competition_matches(9)` |\n| `get_competition_standings(competition_id: int, season_id: int)` | Get competition standings | `get_competition_standings(9, 43029)` |\n| `get_competition_video_news(competition_id: int)` | Get competition video news | `get_competition_video_news(9)` |\n| `get_competition_news(competition_id: int)` | Get competition news | `get_competition_news(9)` |\n| `get_competition_transfers(competition_id: int)` | Get competition transfers | `get_competition_transfers(9)` |\n| `get_competition_matchdays(competition_id: int, season_id: int)` | Get competition matchdays | `get_competition_matchdays(9, 43029)` |\n| `get_competition_current_season(competition_id: int)` | Get competition current_season | `get_competition_current_season(9)` |\n| `get_all_competitions()` | Get all competitions | `get_all_competitions()` |\n\n\n\n### Match Endpoints\n\n| Method | Description | Example |\n|--------|-------------|---------|\n| `get_match(match_id: int, country: str = \"gb\")` | Get match information | `get_match(2595592)` |\n| `get_match_news(match_id: int, country: str = \"gb\")` | Get match news | `get_match_news(2595592)` |\n| `get_match_tv_listings(match_id: int, country: str = \"gb\")` | Get match TV listings | `get_match_tv_listings(2595592)` |\n| `get_match_widget(match_id: int)` | Get live match widget | `get_match_widget(2595592)` |\n| `get_match_predictions(match_id: int)` | Get match prediction votes | `get_match_predictions(2595592)` |\n| `get_match_odds(match_id: int, bookmaker_id: int = 3)` | Get match odds | `get_match_odds(2595592)` |\n| `get_today_matches()` | Get today's matches | `get_today_matches()` |\n| `get_live_matches()` | Get live matches | `get_live_matches()` |\n| `get_tomorrow_matches()` | Get tomorrow's matches | `get_tomorrow_matches()` |\n| `get_matches_by_date(match_date: date)()` | Get matches by specific date | `get_matches_by_date(date(2025, 9, 14))` |\n\n### Player Endpoints\n\n| Method | Description | Example |\n|--------|-------------|---------|\n| `get_player_transfers(player_id: int)` | Get player transfers | `get_player_transfers(257485)` |\n| `get_player_stats(player_slug: str)` | Get player stats by slug | `get_player_stats(\"bukayo-saka-257485\")` |\n| `get_player_competition_stats(player_slug: str, season_id: int)` | Get player competition stats | `get_player_competition_stats(\"bukayo-saka-257485\", 43072)` |\n| `get_player_news(player_slug: str)` | Get player news by slug | `get_player_competition_stats(\"get_player_news(\"bukayo-saka-257485\")` |\n\n## Rate Limiting\n\nBe mindful of rate limits when making multiple requests. Consider adding delays between requests if you're making many calls in succession.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the MIT License.\n\n## Tips and Tricks\n- 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.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python API wrapper for OneFootball undocumented API",
    "version": "0.0.4",
    "project_urls": {
        "Bug Reports": "https://github.com/tommhe14/cs2api/tonefootball-wrapper",
        "Homepage": "https://github.com/tommhe14/onefootball-wrapper",
        "Source": "https://github.com/tommhe14/onefootball-wrapper"
    },
    "split_keywords": [
        "transfermarkt",
        "tmk",
        "tmkt",
        "football",
        "soccer",
        "fotmob",
        "sofascore",
        "flashscore",
        "api",
        "wrapper",
        "onefootball",
        "one",
        "football"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "49172001c9790c28cdfad81d37bc7382870125e84624302617348e84d55f8e0d",
                "md5": "16e5c79e67f226b256d3a8f476c87e49",
                "sha256": "a84fda2d551722bdec9c65744193d04d080298da76f5c94601e97c245746d224"
            },
            "downloads": -1,
            "filename": "onefootball_wrapper-0.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "16e5c79e67f226b256d3a8f476c87e49",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 7310,
            "upload_time": "2025-09-12T23:44:58",
            "upload_time_iso_8601": "2025-09-12T23:44:58.201787Z",
            "url": "https://files.pythonhosted.org/packages/49/17/2001c9790c28cdfad81d37bc7382870125e84624302617348e84d55f8e0d/onefootball_wrapper-0.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "ffb9670cebc263e76f8cc5c8f83106fc7007b7a210612a38183626c215eef26e",
                "md5": "0a0fb806c8209ce78328e046bd99805e",
                "sha256": "5d5aafcf4c16e53b7932d185242cc0b570c92ce40e773645b13c5faf81654171"
            },
            "downloads": -1,
            "filename": "onefootball_wrapper-0.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "0a0fb806c8209ce78328e046bd99805e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 7156,
            "upload_time": "2025-09-12T23:44:59",
            "upload_time_iso_8601": "2025-09-12T23:44:59.156032Z",
            "url": "https://files.pythonhosted.org/packages/ff/b9/670cebc263e76f8cc5c8f83106fc7007b7a210612a38183626c215eef26e/onefootball_wrapper-0.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-12 23:44:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "tommhe14",
    "github_project": "onefootball-wrapper",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "aiohttp",
            "specs": [
                [
                    ">=",
                    ">=3.8.0"
                ]
            ]
        }
    ],
    "lcname": "onefootball-wrapper"
}
        
Elapsed time: 1.97380s