Market Data

Guide for fetching and streaming market data programmatically using the Python SDK.

Prerequisites

Market data endpoints are public — no authentication required:

from turbine_client import TurbineClient, Outcome

client = TurbineClient(
    host="https://api.turbinefi.com",
    chain_id=137,
)

List Markets

Fetch all markets, optionally filtered by chain:

# All markets
markets = client.get_markets()

# Filter by chain
markets = client.get_markets(chain_id=137)

for m in markets:
    status = "RESOLVED" if m.resolved else "ACTIVE"
    print(f"[{status}] {m.question}")
    print(f"  ID: {m.id}")
    print(f"  Contract: {m.contract_address}")
    print(f"  Volume: {m.volume / 1e6:.2f} USDC")
    print()

Each Market object contains the market ID (used for API calls) and the contract address (used for claiming winnings). See Types for all fields.

Orderbook Snapshots

Get the current orderbook for a market:

Parsing the Orderbook

Bids are sorted highest-first (best bid on top). Asks are sorted lowest-first (best ask on top).

Derived Metrics

Trade History

Get recent trades for a market:

Aggregate Trade Data

Market Statistics

Single Market

Platform-Wide

Top Holders

Quick Market Data

Quick markets are 15-minute prediction markets for BTC and ETH. They rotate automatically.

Active Quick Market

Current Price

Price History

Quick Market History

Real-Time Streaming via WebSocket

For live data, use the TurbineWSClient:

Multi-Market Streaming

Market Transition Detection

Quick markets rotate every 15 minutes. Detect transitions via WebSocket:

Complete Example

A market data dashboard that polls and displays key metrics:

Last updated