Skip to main content
These Python examples demonstrate how to interact with the Polymarket US API. Each example is self-contained and includes authentication helpers.

Prerequisites

pip install requests cryptography

Quick Start

All examples require:
  • Your API key ID from the developer portal
  • Your Ed25519 private key (base64-encoded, 64 bytes)
Set these as environment variables:
export POLYMARKET_API_KEY="your-api-key-id"
export POLYMARKET_PRIVATE_KEY="your-base64-private-key"

Required Headers

All requests to api.polymarket.us must include these authentication headers:
HeaderDescription
X-PM-Access-KeyYour API key ID (UUID)
X-PM-TimestampUnix timestamp in milliseconds
X-PM-SignatureBase64-encoded Ed25519 signature
Content-Typeapplication/json
See Authentication for details on signing requests.

Available Examples