Back to Blog
GuideFebruary 28, 2026

How to Use the Polymarket API: Developer Guide (2026)

Complete tutorial on using the Polymarket CLOB API for automated trading. Covers authentication, market data, order placement, and Python examples.

15 min read

Polymarket API Overview

The Polymarket CLOB API is a REST + WebSocket API that provides full access to Polymarket's Central Limit Order Book. You can fetch market data, place and cancel orders, check positions, and stream real-time price updates.

Authentication uses API keys generated from your Polymarket account. The official Python SDK is py-clob-client, which wraps the API with convenient methods for common operations.

Setting Up Your Environment

Install the Python SDK: pip install py-clob-client. You also need an Ethereum private key for signing orders and your Polymarket API credentials.

Generate API keys from your Polymarket account settings or via the API itself. Store your private key and API credentials securely — never commit them to version control.

Fetching Market Data

The Gamma API (gamma-api.polymarket.com) provides market metadata: titles, descriptions, outcomes, token IDs, and resolution criteria. The CLOB API provides orderbook data: prices, sizes, and depth.

Use the Gamma API for discovering markets and the CLOB API for trading. Combine both to build a complete trading system that scans markets and executes trades automatically.

Placing Orders via API

Orders require a signed payload with your private key. The SDK handles signing automatically. Specify the token ID (YES or NO), side (BUY/SELL), price, and size. Submit as GTC (maker) or FOK (taker).

Rate limits apply: typically 10 orders per second. For high-frequency strategies, batch your orders and use WebSocket connections for real-time data instead of polling REST endpoints.

Advanced API Usage

WebSocket subscriptions let you stream live orderbook updates, trade events, and market resolutions in real-time. This is essential for latency-sensitive strategies like arbitrage and market making.

PredictEngine's API wraps Polymarket's CLOB with additional features: gasless transactions, managed wallets, strategy templates, and built-in risk management. Use PredictEngine when you want the power of the API without managing infrastructure.

Ready to Start Trading?

PredictEngine lets you create automated trading bots for Polymarket in seconds. No coding required.

Get Started Free

Start Trading on Polymarket Today

Join thousands of traders using PredictEngine to automate Polymarket. Free to start, no coding required.

Get Started Free

1,500 free credits. No credit card required.

Frequently Asked Questions

Is the Polymarket API free?

Yes, the API is free to use. You only pay trading fees on orders that execute. Maker orders have zero fees and earn rebates.

What programming languages are supported?

The official SDK is Python (py-clob-client). You can also use the REST API directly from any language including JavaScript, Go, or Rust.

Are there rate limits?

Yes. The CLOB API has rate limits around 10 requests per second for order submission. Market data endpoints have higher limits. Use WebSockets for real-time data.

How do I get my API credentials?

Generate API keys from your Polymarket account settings page or create them programmatically via the SDK using your wallet private key.