You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thin, typed Python wrapper for the Ito Markets public API. Access prediction market baskets, individual market data, historical orderbook snapshots, and run backtests — all with a single pip install.
Install
pip install ito-markets
# or with pandas support:
pip install ito-markets[pandas]
Quick Start
fromitoimportItoClientclient=ItoClient("ito_...") # your API key from Settings# List all basketsbaskets=client.baskets.list()
forbinbaskets["data"]:
print(f"{b['basket_id']}: ${b['stats']['current_price']:.2f}")
# Get a single marketmarket=client.markets.get("will-btc-reach-100k")
print(market["data"]["title"], market["data"]["last_price"])
# Price historyhistory=client.markets.history("will-btc-reach-100k", days=90)
forpointinhistory["data"]["series"]:
print(point["date"], point["close_price"])
# Bulk prices for multiple marketsprices=client.data.prices(["market-a", "market-b", "market-c"], days=30)
# Historical L2 orderbookbook=client.data.orderbook(
venue="polymarket",
market="will-btc-reach-100k",
start="2026-06-01T00:00:00Z",
end="2026-06-01T01:00:00Z",
limit=5000,
)
# Run a backtest on a thematic basketresult=client.backtests.run(
strategy_id="crypto_updown_roll_timing",
dataset_id="clickhouse:ito_hot.platform_orderbook_l2",
venues=["polymarket"],
date_range={"start": "2026-05-01T00:00:00Z", "end": "2026-06-01T00:00:00Z"},
basket_id="middle-east-conflict", # only markets in this basketparams={"roll_trigger": "liquidity_spread_score"},
)
print(f"P&L: ${result['data']['metrics']['pnl_usd']:.2f}")