4.8 KiB
Documentation Index
Fetch the complete documentation index at: https://docs.polymarket.com/llms.txt Use this file to discover all available pages before exploring further.
Fetching Market Data
Fetch Polymarket data in minutes with no authentication required
Get market data with zero setup. No API key, no authentication, no wallet required.
Understanding the Data Model
Before fetching data, understand how Polymarket structures its markets:
The top-level object representing a question like "Will X happen?" Each event contains one or more markets. Each market is a specific tradable binary outcome. Markets have `outcomes` and `outcomePrices` arrays that map 1:1. These prices represent implied probabilities.{
"outcomes": "[\"Yes\", \"No\"]",
"outcomePrices": "[\"0.20\", \"0.80\"]"
}
// Index 0: "Yes" → 0.20 (20% probability)
// Index 1: "No" → 0.80 (80% probability)
Fetch Active Events
List all currently active events on Polymarket:
curl "https://gamma-api.polymarket.com/events?active=true&closed=false&limit=5"
Market Discovery Best Practices
For Sports Events
Use the /sports endpoint to discover leagues, then query by series_id:
# Get all supported sports leagues
curl "https://gamma-api.polymarket.com/sports"
# Get events for a specific league (e.g., NBA series_id=10345)
curl "https://gamma-api.polymarket.com/events?series_id=10345&active=true&closed=false"
# Filter to just game bets (not futures) using tag_id=100639
curl "https://gamma-api.polymarket.com/events?series_id=10345&tag_id=100639&active=true&closed=false&order=startTime&ascending=true"
For Non-Sports Topics
Use /tags to discover all available categories, then filter events:
# Get all available tags
curl "https://gamma-api.polymarket.com/tags?limit=100"
# Query events by topic
curl "https://gamma-api.polymarket.com/events?tag_id=2&active=true&closed=false"
Get Market Details
Once you have an event, get details for a specific market using its ID or slug:
curl "https://gamma-api.polymarket.com/markets?slug=will-bitcoin-reach-100k-by-2025"
The response includes clobTokenIds, you'll need these to fetch prices and place orders.
Get Current Price
Query the CLOB for the current price of any token:
curl "https://clob.polymarket.com/price?token_id=YOUR_TOKEN_ID&side=buy"
Get Orderbook Depth
See all bids and asks for a market:
curl "https://clob.polymarket.com/book?token_id=YOUR_TOKEN_ID"