### Development setup and tests Source: https://github.com/5dollarfootball-api/football-api-python-sdk/blob/main/README.md Install the package in editable mode and run the test suite with unittest. ```bash pip install -e . python -m unittest discover tests ``` -------------------------------- ### Quickstart: create client and fetch fixtures Source: https://github.com/5dollarfootball-api/football-api-python-sdk/blob/main/README.md Initialize the client with an API key, fetch today's fixtures, filter live matches, and retrieve a single fixture with events and stats. The free tier covers top-5 European leagues. ```python from fivedollarfootball import Client client = Client("fb_live_your_key") # Today's fixtures (kickoff window defaults to today UTC) for match in client.fixtures(): teams = match["teams"] print(teams["home"]["name"], "vs", teams["away"]["name"], "-", match["status"]) # Live matches only live = client.fixtures(status="live") # One fixture with events and statistics included fixture = client.fixture(1234567, include=["events", "stats"]) ``` -------------------------------- ### Install the Python client with pip Source: https://github.com/5dollarfootball-api/football-api-python-sdk/blob/main/README.md Install the fivedollarfootball package via pip. Requires Python 3.8+ and the requests library. ```bash pip install fivedollarfootball ``` -------------------------------- ### Fetch odds, odds history, and bookmakers Source: https://github.com/5dollarfootball-api/football-api-python-sdk/blob/main/README.md Get current odds for a fixture, iterate through all recorded price movements for a market, and list available bookmakers. The odds history endpoint is unique to this API. ```python # Current prices for a fixture: 1x2, Asian handicap, goal line, corners, cards, BTTS odds = client.fixture_odds(1234567, bookmakers=["bet365", "pinnacle"], market="1x2") # Every recorded price movement for a market — the endpoint most APIs don't have for tick in client.iter_all(client.odds_history, fixture_id=1234567, market="corner"): print(tick) # Which bookmakers are available on your plan books = client.bookmakers() ``` -------------------------------- ### Fetch leagues, teams, and standings Source: https://github.com/5dollarfootball-api/football-api-python-sdk/blob/main/README.md Retrieve popular leagues, league fixtures, standings (including corner/card standings), team details, and recent team fixtures. Use the returned IDs to chain requests. ```python leagues = client.leagues(popular=True) league_id = leagues[0]["id"] # A league season's fixtures finished = client.league_fixtures(league_id, status="finished") # League table — also as corner or card standings table = client.standings(league_id) corner_table = client.standings(league_id, type="corner") team_id = finished[0]["teams"]["home"]["id"] team = client.team(team_id) recent = client.team_fixtures(team_id, status="finished") ``` -------------------------------- ### Paginate through all results with iter_all Source: https://github.com/5dollarfootball-api/football-api-python-sdk/blob/main/README.md Walk through every page of a paginated method using the built-in helper. The Page object is a plain list with page, per_page, count, and has_more attributes. ```python for fixture in client.iter_all(client.fixtures, status="finished"): ... ``` -------------------------------- ### Use datetime objects for time windows Source: https://github.com/5dollarfootball-api/football-api-python-sdk/blob/main/README.md Pass unix seconds or datetime objects to start_time/end_time. Naive datetimes are treated as UTC. ```python import datetime as dt start = dt.datetime(2026, 8, 22, tzinfo=dt.timezone.utc) weekend = client.fixtures(start_time=start, end_time=start + dt.timedelta(hours=24)) ``` -------------------------------- ### Handle API errors and rate limits Source: https://github.com/5dollarfootball-api/football-api-python-sdk/blob/main/README.md Catch RateLimitError and APIError to handle rate limits and other API errors. The client retries 429 responses automatically (max_retries=2 by default) and exposes rate-limit headers on client.rate_limit. ```python from fivedollarfootball import APIError, RateLimitError try: client.fixture(999999999) except RateLimitError as e: print("try again in", e.retry_after, "seconds") except APIError as e: print(e.status_code, e.code, e.message, e.request_id) ``` ```python client.status() print(client.rate_limit) # {'limit': 10, 'remaining': 9, 'reset': 1755590400} ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.