diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ad5818..6b4279f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## Unreleased + +### Docs +- `get_markets`, `get_bookmakers`, the `markets` argument of `get_event_odds` and the README link to the market reference at https://odds-api.io/markets and bookmaker coverage at https://odds-api.io/sportsbooks#coverage. + ## 1.2.2 First release published from GitHub Actions with npm/PyPI trusted publishing and provenance. No code changes. diff --git a/README.md b/README.md index 1caabf5..dda7130 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ with OddsAPIClient(api_key="YOUR_API_KEY") as client: print(bookmaker, market["name"], market["odds"][0]) ``` -Market names are exact: `ML`, `Spread`, `Totals`, `Both Teams To Score`, `Spread HT` and so on. `client.get_markets("football")` lists every name a sport serves. Pass `markets` on odds calls so you only download what you use. +Market names are exact: `ML`, `Spread`, `Totals`, `Both Teams To Score`, `Spread HT` and so on. `client.get_markets("football")` lists every name a sport serves, and the [market reference](https://odds-api.io/markets) shows them per sport on the web (for example [football](https://odds-api.io/markets/football)). Bookmaker coverage by sport is at [odds-api.io/sportsbooks](https://odds-api.io/sportsbooks#coverage). Pass `markets` on odds calls so you only download what you use. ## Get an API key diff --git a/odds_api/async_client.py b/odds_api/async_client.py index 442ffb0..46812d6 100644 --- a/odds_api/async_client.py +++ b/odds_api/async_client.py @@ -180,6 +180,8 @@ async def get_leagues(self, sport: str, all: Optional[bool] = None) -> List[Leag async def get_markets(self, sport: Optional[str] = None) -> Dict[str, Any]: """ Get the market catalogue: the exact market names to pass to ``markets``. + The same catalogue is browsable per sport at https://odds-api.io/markets + (for example https://odds-api.io/markets/football). Args: sport: Sport name or slug. Omit for every sport (keyed by slug). @@ -310,6 +312,7 @@ async def get_event_odds( event_id: Event ID bookmakers: Bookmaker names (max 30), e.g. ["Bet365", "SingBet"] markets: Market names (max 40), e.g. ["ML", "Spread", "Totals"]. + Every name per sport: https://odds-api.io/markets See :meth:`get_markets`. Omit for every market. include_seq: True to get the WebSocket sequence number in the ``X-OddsAPI-Seq`` header (``client.last_response_headers``) @@ -626,6 +629,7 @@ async def get_participant_logo(self, participant_id: Union[int, str]) -> bytes: async def get_bookmakers(self) -> List[Bookmaker]: """ Get all bookmakers with ``status`` (ok, degraded, down) and ``reason``. + Coverage by sport: https://odds-api.io/sportsbooks#coverage Example: >>> down = [b["name"] for b in await client.get_bookmakers() if b.get("status") == "down"] diff --git a/odds_api/client.py b/odds_api/client.py index 2e4a6e4..6315f97 100644 --- a/odds_api/client.py +++ b/odds_api/client.py @@ -180,6 +180,8 @@ def get_leagues(self, sport: str, all: Optional[bool] = None) -> List[League]: def get_markets(self, sport: Optional[str] = None) -> Dict[str, Any]: """ Get the market catalogue: the exact market names to pass to ``markets``. + The same catalogue is browsable per sport at https://odds-api.io/markets + (for example https://odds-api.io/markets/football). Args: sport: Sport name or slug. Omit for every sport (keyed by slug). @@ -307,6 +309,7 @@ def get_event_odds( event_id: Event ID bookmakers: Bookmaker names (max 30), e.g. ["Bet365", "SingBet"] markets: Market names (max 40), e.g. ["ML", "Spread", "Totals"]. + Every name per sport: https://odds-api.io/markets See :meth:`get_markets`. Omit for every market. include_seq: True to get the WebSocket sequence number in the ``X-OddsAPI-Seq`` header (``client.last_response_headers``) @@ -618,6 +621,7 @@ def get_participant_logo(self, participant_id: Union[int, str]) -> bytes: def get_bookmakers(self) -> List[Bookmaker]: """ Get all bookmakers with ``status`` (ok, degraded, down) and ``reason``. + Coverage by sport: https://odds-api.io/sportsbooks#coverage Example: >>> down = [b["name"] for b in client.get_bookmakers() if b.get("status") == "down"]