Polymarket — Sports Prediction Markets
Setup
Before first use, check if the CLI is available:
bash
which sports-skills || pip install sports-skills
If
fails with a Python version error, the package requires Python 3.10+. Find a compatible Python:
bash
python3 --version # check version
# If < 3.10, try: python3.12 -m pip install sports-skills
# On macOS with Homebrew: /opt/homebrew/bin/python3.12 -m pip install sports-skills
No API keys required.
Quick Start
Prefer the CLI — it avoids Python import path issues:
bash
sports-skills polymarket get_sports_markets --limit=20
sports-skills polymarket search_markets --query="NBA Finals"
Python SDK (alternative):
python
from sports_skills import polymarket
markets = polymarket.get_sports_markets(limit=20)
prices = polymarket.get_market_prices(token_id="abc123")
Commands
get_sports_markets
Get active sports prediction markets.
- (int, optional): Max results (default: 50, max: 100)
- (int, optional): Pagination offset
- (str, optional): Filter by type ("moneyline", "spreads", "totals")
- (str, optional): Filter by game
- (bool, optional): Only active markets (default: true)
- (bool, optional): Include closed markets (default: false)
- (str, optional): Sort field (default: "volume")
- (bool, optional): Sort ascending (default: false)
get_sports_events
Get sports events (each groups related markets).
- , , , , , (same as above)
- (str, optional): Filter by series (league) ID
get_series
Get all series (leagues, recurring event groups).
- (int, optional): Max results (default: 100)
- (int, optional): Pagination offset
get_market_details
Get detailed info for a specific market.
- (str): Market ID
- (str): Market slug (alternative to ID)
get_event_details
Get detailed info for a specific event.
- (str): Event ID
- (str): Event slug (alternative to ID)
get_market_prices
Get current prices from the CLOB API.
- (str): Single CLOB token ID
- (list): Multiple CLOB token IDs (batch)
get_order_book
Get full order book for a market.
- (str, required): CLOB token ID
get_sports_market_types
Get all valid sports market types. No params.
search_markets
Find markets by keyword and filters. Search matches event titles, not sport categories. Use specific league/competition names, not generic terms like "soccer" or "football".
- (str, optional): Keyword to search — use league names (e.g., "Premier League", "Champions League", "La Liga", "NBA Finals")
- (str, optional): Filter by type
- (int, optional): Tag ID (default: 1 = Sports)
- (int, optional): Max results (default: 20)
get_price_history
Get historical price data.
- (str, required): CLOB token ID
- (str, optional): Time range ("1d", "1w", "1m", "max"). Default: "max"
- (int, optional): Seconds between data points. Default: 120
get_last_trade_price
Get the most recent trade price.
- (str, required): CLOB token ID
Examples
User: "Who's favored to win the NBA Finals?"
- Call
search_markets(query="NBA Finals", sports_market_types="moneyline")
- Get from the market details
- Call
get_market_prices(token_id="...")
for current odds
- Present teams with implied probabilities (price = probability)
User: "Who will win the Premier League?"
- Call
search_markets(query="English Premier League")
— use full league name
- Sort results by Yes outcome price descending
- Present teams with implied probabilities (price = probability)
User: "Show me Champions League odds"
- Call
search_markets(query="Champions League")
- Present top contenders with prices, volume, and liquidity
User: "What's the order book depth on this market?"
- Call
get_order_book(token_id="...")
for full book
- Present bids, asks, spread, and implied probabilities
Troubleshooting
- command not found: Package not installed. Run
pip install sports-skills
. If pip fails with a Python version error, you need Python 3.10+ — see Setup section.
ModuleNotFoundError: No module named 'sports_skills'
: Same as above — install the package. Prefer the CLI over Python imports to avoid path issues.
- token_id vs market_id: Price/orderbook endpoints need the CLOB (found in market details under ), not the Gamma . Always fetch market details first to get the token_id.
- Search returns 0 results: matches event titles, not sport categories. Don't search "soccer" or "football" — search by league name: "Premier League", "Champions League", "La Liga", "Bundesliga", "Serie A", "NBA Finals", etc.
- Market not found by ID: Use
search_markets(query="...")
with keywords instead of guessing IDs. Or use get_market_details(slug="...")
with the URL slug.
- Stale or wide prices: Low-liquidity markets may have wide bid-ask spreads. The price from is the midpoint — check to assess reliability.
- Pagination: Use parameter for paging. Default varies by endpoint (20-100). Increment offset by limit for each page.
APIs
- Gamma API (gamma-api.polymarket.com): Market metadata, events, series. Public, no auth.
- CLOB API (clob.polymarket.com): Prices, order books, trades. Public reads, no auth.