← SDKs & libraries

SDK

polymarket-api-python: Typed Python Market and Order-Book Client

polymarket-api-python is a compact typed Python package for Polymarket research, book analytics and streaming. Its public read surface needs no API key; trading is installed as an optional extra.

Pricing
MIT-licensed package. Public reads need no API key; venue and operating costs for trading are separate.

Screenshots and interface

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.

  1. Install polymarket-api-python.
  2. Find a market with GammaClient.
  3. Read OrderBookSnapshot for the selected token.
  4. Use WebSocket for continuing updates.
  5. Install the trading extra only for order actions.

Trading depends on the upstream client's current protocol compatibility.

Read the package documentation directory

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

Editorial rating
3.5/ 5
0 user reviews

Our take on polymarket-api-python

Typed reads, a focused cookbook and optional trading suit small Python integrations. Execution compatibility still relies on the upstream client and current venue protocol.

Based on documented features, setup and access terms. How we rate

User reviews 0

The main score switches to user ratings after 5 published reviews.

Be the first to share your experience

A specific example helps the next person choose the right tool.

Related tools

Browse category

Frequently 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.