Skip to main content

Overview

Polymarket Exchange provides multiple methods for obtaining candlestick (OHLC - Open, High, Low, Close) data for market analysis and charting applications. Use the REST API’s trade statistics endpoint to get pre-calculated OHLC data:
Request Example:
Response Example:
Benefits:
  • Server-side aggregation (faster, more efficient)
  • Ready-to-use candlestick data
  • Configurable time intervals
  • No client-side computation required
Common Intervals:
  • 1m - 1 minute
  • 5m - 5 minutes
  • 15m - 15 minutes
  • 1h - 1 hour
  • 4h - 4 hours
  • 1d - 1 day

Method 2: Manual Aggregation from Trade Data

Query individual trades and calculate OHLC values client-side:
Request Example:
Response Example:

Aggregation Logic

  1. Query trades for the desired time range
  2. Group trades by your chosen interval (e.g., 5min, 1h, 1d)
  3. For each interval, calculate:

Python Example

When to use:
  • Custom aggregation logic needed
  • Non-standard time intervals
  • Additional trade metadata required
  • Complex filtering or weighting logic

Method 3: Real-Time Streaming

Subscribe to market data via gRPC to build live candlestick charts that update as trades occur.

Subscribe to Market Data

Building Real-Time Candles

Features:
  • Real-time price updates
  • Last trade price and volume
  • Aggregated statistics (cumulative volume, notional traded)
  • Best bid/offer data
Use cases:
  • Live trading dashboards
  • Real-time candlestick charts
  • Automated trading strategies
  • Market monitoring systems

Choosing the Right Method

Best Practices

Time Zones

All timestamps are in UTC. Ensure your client handles timezone conversion appropriately:

Price Scaling

Prices in the API use a price_scale multiplier. Check the instrument’s reference data:

Data Gaps

Handle gaps in data gracefully:
  • Pre-aggregated: Missing intervals indicate no trades occurred
  • Manual: Empty intervals should show previous close as O/H/L/C
  • Streaming: Implement reconnection logic for dropped connections

Caching

For historical data:
  • Cache pre-aggregated candles locally
  • Only query new intervals since last update
  • Use start_time filters to avoid redundant data