Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions odds_api/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -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``)
Expand Down Expand Up @@ -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"]
Expand Down
4 changes: 4 additions & 0 deletions odds_api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -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``)
Expand Down Expand Up @@ -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"]
Expand Down
Loading