Skip to main content

Overview

Individual trade executions captured from Polymarket’s websocket feed. Each row represents a single trade.

Columns

ColumnTypeDescription
exchange_timestampintegerExchange timestamp in milliseconds
local_timestampintegerLocal capture timestamp in milliseconds (UTC)
sidestringTrade side: BUY or SELL
sizedecimalNumber of contracts traded
pricedecimalExecution price

Fetching Data

Using Market Slug + Outcome

import requests

def download_trades(market_slug, outcome, date_str, api_key):
    url = f"http://datasets.predictiondata.dev/polymarket/trades/{market_slug}/{outcome}/{date_str}.csv.gz"
    params = {'slug': 'true', 'apikey': api_key}
    
    response = requests.get(url, params=params)
    response.raise_for_status()
    
    with open(f'{market_slug}_{outcome}_{date_str}_trades.csv.gz', 'wb') as f:
        f.write(response.content)
    
    print(f"Downloaded to {market_slug}_{outcome}_{date_str}_trades.csv.gz")

if __name__ == "__main__":
    api_key = "YOUR_API_KEY"
    market_slug = "ramp-ipo-in-2025"
    outcome = "YES"
    date_str = "2025-11-16"
    
    download_trades(market_slug, outcome, date_str, api_key)

Using Token ID

import requests

def download_trades_by_token(token_id, date_str, api_key):
    url = f"http://datasets.predictiondata.dev/polymarket/trades/{token_id}/{date_str}.csv.gz"
    params = {'apikey': api_key}
    
    response = requests.get(url, params=params)
    response.raise_for_status()
    
    with open(f'{token_id}_{date_str}_trades.csv.gz', 'wb') as f:
        f.write(response.content)
    
    print(f"Downloaded to {token_id}_{date_str}_trades.csv.gz")

if __name__ == "__main__":
    api_key = "YOUR_API_KEY"
    token_id = "6535996220481600525438454491949371553057652243233032166205012948847090204871"
    date_str = "2025-11-16"
    
    download_trades_by_token(token_id, date_str, api_key)

Notes

  • Files are gzip compressed
  • Date format: YYYY-MM-DD
  • Trades are deduplicated across multiple websockets
  • Side is from the taker’s perspective