Documentation Index
Fetch the complete documentation index at: https://mathematicalcompany.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Market Discovery
Horizon provides built-in market discovery for Polymarket, Kalshi, Limitless, Alpaca, and IBKR. Search by keyword, filter by volume or category, and get backMarket objects ready to use with hz.run().
Discovery queries are public API calls - no exchange credentials needed. The returned
Market objects include token IDs, condition IDs, and all metadata needed for trading.Overview
Search Markets
hz.discover_markets() searches by keyword with volume, category, and sort filters.Top Markets
hz.top_markets() returns the highest-volume active markets.Discover Events
hz.discover_events() finds multi-outcome events with all outcomes populated.All Exchanges
Works with Polymarket, Kalshi, Limitless, Alpaca, and IBKR.
hz.discover_markets
Search for markets across exchanges.Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
exchange | str | "polymarket" | "polymarket", "kalshi", "limitless", "alpaca", or "ibkr" |
query | str | "" | Search text (market title/slug/ticker) |
active | bool | True | Only return active (open) markets |
limit | int | 20 | Max number of results |
min_volume | float | 0.0 | Minimum 24h volume filter (Polymarket only) |
category | str | "" | Category/tag filter (exchange-specific) |
sort_by | str | "volume" | Sort order |
Sort Options
| Value | Description |
|---|---|
"volume" | 24h trading volume (default) |
"newest" | Most recently created |
"liquidity" | Deepest orderbook liquidity |
"" | No specific ordering |
Exchange-Specific Behavior
Polymarket:querymatches market question text and slugs (client-side filtering on/marketsendpoint)categoryuses server-side tag filtering via the/eventsendpoint (e.g.,"crypto","politics","sports"). Returns all markets from matching events. This is the recommended way to browse by topic.min_volumefilters markets below the USD threshold- Returns
Marketobjects withyes_token_id,no_token_id, andcondition_id
querywith an uppercase ticker prefix (e.g.,"KXBTC") uses server-side series filtering for fast results. Lowercase text queries use client-side matching over paginated results, which may miss markets deep in the listing.categoryis the recommended way to search Kalshi. Maps to series tickers (e.g.,"KXBTC"for all BTC markets,"KXETH"for ETH,"INX"for S&P 500).min_volumeis not supported (Kalshi API limitation)- Returns
Marketobjects withtickerfield
- Searches the Alpaca assets API (
/v2/assets) for US equities querymatches symbol or company name (client-side)- Returns
Marketobjects withexchange="alpaca"andasset_class="equity" - Requires
APCA_API_KEY_IDandAPCA_API_SECRET_KEYenvironment variables
- Searches via the IBKR symbol search endpoint
querymatches symbol or company name- Returns
Marketobjects withexchange="ibkr"and contract ID as the market ID - Requires IBKR Client Portal or TWS running locally
hz.top_markets
Convenience wrapper to get the highest-volume active markets.| Parameter | Type | Default | Description |
|---|---|---|---|
exchange | str | "polymarket" | Exchange to query |
limit | int | 10 | Number of markets |
category | str | "" | Category filter |
discover_markets(active=True, sort_by="volume", ...).
hz.discover_events
Discover multi-outcome events from Polymarket. ReturnsEvent objects with all outcomes populated, including YES/NO token IDs and current prices.
| Parameter | Type | Default | Description |
|---|---|---|---|
exchange | str | "polymarket" | Currently only "polymarket" supported |
query | str | "" | Search text |
active | bool | True | Only active events |
limit | int | 10 | Max events |
min_volume | float | 0.0 | Minimum total volume across outcomes |
Event discovery only returns events with 2+ outcomes. Single-outcome binary markets are returned by
discover_markets() instead.Using Discovered Markets with hz.run
The main purpose of discovery is to getMarket objects for trading: