Data
Trades & Candles
Executed trades and OHLCV candlestick aggregations for any market.
GET
/markets/{market_id}/tradessdk
client.markets.trades(market_id, **params)List executed trades for a market, ordered by execution time.
Parameters
market_idstrrequired
Market UUID.
afterint
Trades after this timestamp (exclusive, ms).
beforeint
Trades before this timestamp (exclusive, ms).
sidestr
"BUY" or "SELL".
min_sizestr
Minimum trade size in USD.
orderstr= "asc"
Sort order.
limitint= 500
Trades per page.
trades = client.markets.trades(
"8150b888...", after="2024-03-10", side="BUY"
)
df = trades.to_dataframe()
print(df[["price", "size", "side"]].head())jsonResponse
{
"data": [{
"id": "01HQXYZ...",
"market_id": "8150b888-67f6-58ed-...",
"platform": "polymarket",
"price": "0.6200",
"size": "150.0000",
"side": "BUY",
"platform_timestamp": 1710400123456,
"collected_at": 1710400123800,
"fee_rate_bps": 100
}],
"meta": { "cursor": "...", "has_more": true }
}GET
/markets/{market_id}/candlessdk
client.markets.candles(market_id, **params)OHLCV candlestick data at configurable resolution. Buckets with zero trades are omitted.
Parameters
market_idstrrequired
Market UUID.
resolutionstr= "1m"
Candle interval.
afterint
Candles starting after this timestamp (ms).
beforeint
Candles starting before this timestamp (ms).
orderstr= "asc"
Sort order.
limitint= 500
Candles per page.
Resolutions
1s, 5s, 10s, 30s
Sub-minute intervals.
1m, 5m, 15m
Minute intervals.
1h, 4h, 1d
Hourly and daily intervals.
candles = client.markets.candles(
"8150b888...", resolution="5m"
)
df = candles.to_dataframe()
print(df[["open", "high", "low", "close"]].tail())jsonResponse
{
"data": [{
"open_time": 1710400200000,
"close_time": 1710400500000,
"open": "0.6200",
"high": "0.6350",
"low": "0.6180",
"close": "0.6300",
"vwap": "0.6265",
"volume": "4250.0000",
"trade_count": 18
}],
"meta": { "cursor": "...", "has_more": true }
}