py-clob-client-v2
Python client for the Polymarket CLOBV2
What it is and what it does
py-clob-client-v2 is a Python REST client for Polymarket's CLOB, enabling programmatic order placement and management on prediction markets. It handles two-tier authentication: L1 wallet signing (EIP-712) to derive API credentials, and L2 HMAC signing for subsequent order operations. The library wraps Polymarket's REST API with native support for limit orders (GTC), market orders (FOK/FAK), and account queries.
The package is built on eth-account, eth-abi, eth-utils, and httpx for blockchain interaction and HTTP communication. It's actively maintained (last commit 2026-08-05) and requires Python >=3.9.10. The maintainers note that a unified SDK (py-sdk) now combines REST and WebSocket APIs, suggesting this package may be superseded for new projects, though it remains functional for CLOB-specific workflows.
Use it for:
- Place limit buy/sell orders on Polymarket prediction markets with custom price and size parameters
- Execute market orders with immediate-or-cancel (FOK) or fill-as-much-as-possible (FAK) semantics using USDC
- Automate wallet-based authentication and API credential derivation for programmatic trading workflows
- Monitor account balances and order status via authenticated REST endpoints
- Build trading bots that sign orders with an Ethereum private key and submit them to the CLOB
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Python client library for placing and managing orders on Polymarket's CLOB (central limit order book) via REST API, with built-in wallet authentication and order execution.
Yes, if you are actively trading on Polymarket's CLOB and need a Python REST client. The package is actively maintained, has low install friction, and provides the core order-placement and authentication layer. However, note the maintainers' recommendation to use py-sdk for new projects—evaluate whether you need CLOB-specific functionality or would benefit from the unified SDK's broader API coverage and WebSocket support.
Install
py-clob-client-v2 on PyPI
pip
pip install py-clob-client-v2uv
uv add py-clob-client-v2poetry
poetry add py-clob-client-v2Installing py-clob-client-v2
Before you install
Low friction: pure Python wheel with six runtime dependencies (eth-account, eth-abi, eth-utils, poly_eip712_structs, py-order-utils, httpx). Active maintenance—last commit 2026-08-05, released 2026-07-17, 28 days ago. Requires Python >=3.9.10.
License in practice
MIT license (permissive). You can use, modify, and distribute this package freely in commercial or private projects with minimal restrictions.
Quickstart
pip install py-clob-client-v2
import os
from py_clob_client_v2 import ClobClient, OrderArgs, Side, OrderType, PartialCreateOrderOptions
client = ClobClient(host="<host>", chain_id=137, key=os.environ["PK"])
creds = client.create_or_derive_api_key()
client = ClobClient(host="<host>", chain_id=137, key=os.environ["PK"], creds=creds)
resp = client.create_and_post_order(
order_args=OrderArgs(token_id="", price=0.4, side=Side.BUY, size=100),
options=PartialCreateOrderOptions(tick_size="0.01"),
order_type=OrderType.GTC
)
Requires a private key (PK environment variable) for wallet authentication and a Polymarket CLOB host URL. Chain ID must be set to 137 (mainnet) or 80002 (Amoy testnet).
Verify before relying
- Whether the package supports both limit and market orders with all documented order types (GTC, FOK, FAK) as shown in examples
- Real-world latency and reliability characteristics for order placement under load
- Whether the unified py-sdk mentioned in the note is a replacement or complementary to this package
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.9.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 6 — eth-account, eth-abi, eth-utils, poly_eip712_structs, py-order-utils, httpx |
| Maintenance | actively maintained — 28 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 708,389/month — #5,263 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: py_clob_client_v2-1.1.0-py3-none-any.whl
Tags
More Internet packages
Botocore provides low-level, data-driven access…
permissive · top 100 on PyPI
aiobotocoreProvides an async client for AWS services using…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
filelockProvides a platform-independent file locking…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
googleapis-common-protosProvides common Protocol Buffer message…
permissive · top 100 on PyPI
polymarket-clientOfficial Python SDK for Polymarket that…
permissive · top 15,000 on PyPI
py-builder-relayer-clientA Python client library for submitting…
permissive · top 15,000 on PyPI
py-clob-clientPython client library for trading on…
permissive · top 15,000 on PyPI
py-order-utilsGenerates and cryptographically signs orders…
permissive · top 5,000 on PyPI
hyperliquid-python-sdkPython SDK for trading on the Hyperliquid…
permissive · top 15,000 on PyPI
py-builder-signing-sdkGenerates cryptographically signed HTTP headers…
permissive · top 15,000 on PyPI
dhanhqPython client library for the Dhan trading API,…
permissive · top 15,000 on PyPI
python-binanceUnofficial Python wrapper for the Binance…
permissive · top 15,000 on PyPI
pybitpybit is the official Python connector for…
permissive · top 15,000 on PyPI
paradime-ioPython SDK for interacting with the Paradime…
unclear · top 15,000 on PyPI