What is polymarket-api-python?
GammaClient paginates market listings and decodes JSON-string outcomes and tokens. OrderBookSnapshot adds best bid/ask, midpoint, spread in basis points, depth within 5% and total resting liquidity to the raw book.
The WebSocket client handles reconnects, heartbeat and stale-feed monitoring. Optional signing and placement rely on the upstream client and current protocol compatibility. Deterministic client order IDs aid retries but do not replace reconciliation of actual order state.
Who it is for
- Python projects needing a focused research client.
- Apps monitoring spread and depth.
- Teams separating read dependencies from trading.
Features and coverage
- Gamma reader
Paginate listings and decode outcome/token strings.
- Book metrics
Best bid/ask, midpoint, spread in basis points, depth within 5% and resting liquidity.
- Resilient streams
Reconnect, heartbeat and stale-feed monitoring.
- Client order IDs
Generate deterministic IDs for retry-aware workflows.
- Optional trading
Install signing and placement support only when required.
- Cookbook
Recipes cover reads, books, cancellation, authentication and resolution.
Workflows with polymarket-api-python
Monitor liquidity
Find a market with Gamma, read its YES or NO book and sample spread and depth consistently.
Consume a stream
Subscribe to chosen token IDs, handle typed price events and use watchdog/reconnect behavior.
Add order actions
Establish reads first, then install the trading extra and implement placement and cancellation.
Pricing and total cost
MIT-licensed package. Public reads need no API key; venue and operating costs for trading are separate.
Getting started
Before you start: Trading-wrapper compatibility depends on the upstream client.
- Install polymarket-api-python.
- Find a market with GammaClient.
- Read OrderBookSnapshot for the selected token.
- Use WebSocket for continuing updates.
- Install the trading extra only for order actions.
Trading depends on the upstream client's current protocol compatibility.
Useful links
What to check
- Trading-wrapper compatibility depends on the upstream client.
- Deterministic IDs do not replace order-state reconciliation.
- Market IDs and outcome token IDs serve different purposes.
A closer look
Ratings & reviews
User reviews 0
The main score switches to user ratings after 5 published reviews.
A specific example helps the next person choose the right tool.
Related tools
Browse categoryFrequently asked questions about polymarket-api-python
Do book analytics need trading credentials?
No. Reads, streams and analytics are credential-free.
What does a snapshot add?
Computed spread, midpoint, depth and resting-liquidity metrics.
Is trading installed by default?
No. It is an optional extra.


