← SDKs & libraries

SDK

polymarket-api-python

A compact typed Python client for Gamma discovery, computed order-book metrics and resilient CLOB streams, with trading as an optional extra.

View repositorygithub.com
Available on
Python, PyPI
Pricing
MIT-licensed package

Screenshots and interface

What is polymarket-api-python?

This antflow-maintained package focuses on reusable API plumbing. Its base installation reads markets and books without trading credentials, calculates useful spread and depth metrics and handles live-feed reconnection. Order signing and placement are opt-in through a wrapper around Polymarket’s trading client.

Who it is for

  • Python developers wanting a small research client
  • Applications monitoring spread and depth
  • Teams separating read-only dependencies from trading support

Features and coverage

Available on
Python, PyPI
Markets & venues
Polymarket
  • Gamma reader

    Paginates market listings and decodes JSON-string outcome and token fields.

  • Computed book metrics

    Read best bid/ask, midpoint, spread in basis points, depth within 5% and total resting liquidity.

  • Resilient streaming

    The WebSocket client handles reconnects, heartbeat and stale-feed monitoring.

  • Client order IDs

    Generate deterministic identifiers for retry-aware order workflows.

  • Optional trading extra

    Add the signing/placement wrapper only when needed.

  • Task-oriented cookbook

    Recipes cover market reads, books, cancellation, authentication and resolution.

Workflows with polymarket-api-python

Monitor market liquidity

Find a market through Gamma, fetch its YES or NO book and record spread and depth at a consistent interval.

Build a stream consumer

Subscribe to selected token IDs, handle typed price events and use the watchdog/reconnect behavior to maintain the feed.

Add order support separately

Install the trading extra and implement the desired placement and cancellation path after the read workflow is established.

Pricing and total cost

MIT-licensed package. Public read functions need no API key; venue and operating costs apply separately to trading.

Getting started

Before you start: The trading wrapper depends on the upstream client and its current protocol compatibility.

  1. Install polymarket-api-python.
  2. Use GammaClient to find a market.
  3. Fetch an OrderBookSnapshot for the relevant token.
  4. Use the WebSocket client for ongoing updates.
  5. Install the trading extra only if your application needs order actions.

Open documentation

Useful links

What to check

  • The trading wrapper depends on the upstream client and its current protocol compatibility.
  • Deterministic client IDs help retry handling but do not replace reconciliation of actual order state.
  • Market identifiers and outcome token IDs serve different functions.

A closer look

Ratings & reviews

Write a review
Editorial rating
3.5/ 5
0 user reviews

Our take on polymarket-api-python

A focused cookbook, typed reads and optional trading support make the package approachable for Python projects. Execution compatibility still depends 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.

Write a review

How was your experience with polymarket-api-python?

Share what you used, what worked and what could be better. We confirm your email and review the submission before publishing.

To submit a review, email info@polytradingbot.com with the tool name, your rating and your experience. Enable JavaScript to prepare a draft here.

Related tools

Browse category

Frequently asked questions about polymarket-api-python

Do I need trading credentials for book analytics?

No. The read, stream and analytics surface is credential-free.

What does the snapshot add to a raw ladder?

It computes spread, midpoint, depth and resting-liquidity metrics.

Is trading installed by default?

No. Order support is an optional extra.