Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
ClobClient
✓ from py_clob_client_v2 import ClobClient
✗ from py_clob_client.client import ClobClient
Initialize a ClobClient with private key from environment variable and test connectivity.
import os
from py_clob_client.client import ClobClient
from py_clob_client.clob_types import Credentials
host = "https://clob.polymarket.com"
key = os.environ.get('PRIVATE_KEY', '')
creds = Credentials(private_key=key, chain_id=137)
client = ClobClient(host=host, credentials=creds)
print(client.get_heartbeat())
Debug
Known issues
gotchaThe library's release versions do not follow strict semver; 1.0.1rc1 is a pre-release and may contain breaking changes.fixPin to 1.0.0 for production unless you need the features in 1.0.1rc1.
affects: >=1.0.0
gotchaPrivate key must be in hex format without 0x prefix. Incorrect formatting will cause silent failures.fixEnsure private key is a hex string (64 characters) without '0x'.
affects: >=0.0.1
deprecatedThe `getHeartbeat()` method (camelCase) is deprecated in v1.0.0; use `get_heartbeat()` instead.fixReplace `getHeartbeat()` with `get_heartbeat()`.
affects: >=1.0.0
breakingIn v1.0.0, the `Credentials` class was introduced and the constructor changed. Passing a raw private key string directly is no longer supported.fixUse from py_clob_client.clob_types import Credentials and pass Credentials object.
affects: <1.0.0 vs >=1.0.0
Upgrade
Version history
1.0.0latest on PyPI · released Apr 17, 2026
Audit
Dependencies
No dependency data recorded yet.