API

Below is the full Prediction Market Intelligence catalog (Polymarket, Social): one POST URL, distinct agent_id per endpoint. Each block lists parameters from the official docs, a default JSON body, and a live response after you run it. For MCP, Python SDK, and COOK, use the links in the integration list.

Security

Live calls use a server route (/api/heisenberg-proxy) so the Heisenberg token stays in HEISENBERG_API_TOKEN on the server — not in the browser bundle. Run the app with next dev or next start; pure static hosting of out/ cannot serve this proxy.

Integration options

  • Prediction API Quickstart

    Log in to view your endpoints, tokens, and request examples for prediction-market intelligence.

  • Data Agents Quickstart

    Blueprints, instances, simulation, and deploy — the core Heisenberg Data Agents flow.

  • REST endpoints

    How instances expose API (and related) access after you deploy from COOK or the marketplace.

  • Model Context Protocol (MCP)

    Plug Data Agents into MCP-compatible clients and multi-step AI workflows.

  • Python SDK

    Build and extend agents programmatically with the Heisenberg Python SDK.

  • COOK launchpad

    Visual interface to configure, deploy, and retrieve integration endpoints.

Scopes (typical JWT)

Tokens often include launchpad scopes (agent create/read/update, echo-style flows), retriever scopes (semantic retrieval, echo generation, feature extraction), and user read/write. Match your calls to the operations enabled on your key.

Live requests

Requests go to POST /api/heisenberg-proxy on this app; the server forwards to Heisenberg with your HEISENBERG_API_TOKEN (no token in the browser — avoids CORS). Upstream: https://narrative.agent.heisenberg.so/api/v2/semantic/retrieve/parameterized

Setup

In .env.local set HEISENBERG_API_TOKEN=… (same JWT as in the Heisenberg dashboard). Restart next dev. Optional: HEISENBERG_API_BASE_URL if upstream URL changes.

Polymarket

Polymarket Markets

agent_id 574

Search markets on Polymarket using different filters including market_slug, min_volume, and etc.

Request body (JSON)

Parameters

NameTypeDescription
min_volumestringMinimum trading volume filter
condition_idstringEthereum condition ID for the market
market_slugstringMarket identifier or keyword search
event_slugstringFilter by event slug
end_date_minstringFilter markets ending after this timestamp (inclusive)
end_date_maxstringFilter markets ending before this timestamp (inclusive)
closedstringMarket status (false = open, true = closed)

Polymarket Trades

agent_id 556

Returns historical trade data from Polymarket with different filters such as trader's address and market slug.

Request body (JSON)

Parameters

NameTypeDescription
proxy_walletstringFilter by wallet address
condition_idstringEthereum condition ID for the market
market_slugstringFilter trades by specific market
sidestringTrade direction: "BUY" or "SELL"
start_timestringTrades after this timestamp (inclusive)
end_timestringTrades before this timestamp (inclusive)

Polymarket Candlesticks

agent_id 568

Retrieves past candlestick data for a token associated with a market given `token_id` across a specified time interval.

Request body (JSON)

Parameters

NameTypeDescription
token_idstringBlockchain token identifier for the specific market outcome
intervalstringInterval of the candlestick. Possible values are `1m` `5m` `15m` `1h` `4h` `1d` `1w` . <br> <br>There are range limits for interval and the end_time will be capped: <br> <br>`1m`: max range 7 days <br>`5m`: max range 15 days <br>`15m`: max range 30 days <br>`1h`: max range 90 days <br>`4h`: max range 180 days <br>`1d`: max range 360 days <br>`1w`: max range 360 days
start_timestringFilter after this timestamp
end_timestringFilter before this timestamp

Polymarket Price Jumps

agent_id 596

Detect significant price jumps on a Polymarket market by scanning candlestick data bucketed at a chosen resolution. Returns all candle-to-candle moves exceeding the configured threshold, sorted by magnitude.

Request body (JSON)

Parameters

NameTypeDescription
condition_idstringHex condition ID of the market. Use Polymarket Markets (574) to find it.
token_idstringOutcome token ID (side_a_token_id or side_b_token_id from Polymarket Markets for this condition).
outcomestringExact outcome label (e.g. 'Yes', 'No', 'Lakers') or 'ALL' for all outcomes.
resolutionstringCandle bucket size. Options: 1m, 5m, 15m, 1h, 4h, 1d
min_change_pctstringMinimum absolute % price change to qualify as a jump
lookback_hoursstringHours to scan back from now

Polymarket Orderbook

agent_id 572

Gets past order book snapshots for a specific `token_id` during a chosen time range.

Request body (JSON)

Parameters

NameTypeDescription
token_idstringToken ID of the associated Market.
start_timestringFilter after this timestamp
end_timestringFilter before this timestamp

Polymarket PnL

agent_id 569

Retrieves realized profit and loss (PnL) for a given wallet address over a specified time range and aggregation interval. You may optionally filter results to a single market using `condition_id`. Unlike Polymarket’s dashboard, which displays unrealized PnL, this API reports **realized gains only**, calculated from confirmed sell transactions or fully settled (closed) markets.

Request body (JSON)

Parameters

NameTypeDescription
granularitystringAggregation interval. Possible values are `1d` `3d` `1w` `1m` `all`
walletstringWallet Id.
start_timestringFilter after this timestamp
end_timestringFilter before this timestamp

Polymarket PnL Leaderboard

agent_id 579

# **Leaderboard API**

Request body (JSON)

Parameters

NameTypeDescription
wallet_addressstringWallet address filter. Use `"ALL"` to return all wallets, or provide a specific address to filter results to that wallet.
leaderboard_periodstringLeaderboard time window. Allowed values: `1d`, `3d`, `7d`, `30d`. Each period has an independent ranking.

Wallet Stats All Time

agent_id 586

# **Wallet Stats All Time on Our data (\~9mo)**

Request body (JSON)

Parameters

NameTypeDescription
wallet_addressstringWallet address filter. This is mandetory.

Heisenberg Leaderboard

agent_id 584

# Heisenberg Leaderboard API

Request body (JSON)

Parameters

NameTypeDescription
min_win_rate_15dstringMinimum 15-day win rate (0–1)
max_win_rate_15dstringMaximum 15-day win rate (0–1)
min_roi_15dstringMinimum 15-day ROI
min_total_trades_15dstringMinimum trades in 15 days
max_total_trades_15dstringMaximum trades in 15 days
min_pnl_15dstringMinimum realized PnL in USD over 15 days. Default: `"5000"`
sort_bystringSort metric. Default: `h_score`. Options: `h_score`, `roi`, `pnl`, `win_rate`, `trades`, `sharpe`

Wallet 360

agent_id 581

# Heisenberg Extensive Wallet Profile

Request body (JSON)

Parameters

NameTypeDescription
proxy_walletstringFilter by wallet address. Required field.
window_daysstringThe duration that the metrics are calculated over. Possible values are `"1"`, `"3"`, `"7"`, and `"15"`. Required field.

Polymarket Market 360

agent_id 575

# Market Quality & Structure Endpoint

Request body (JSON)

Parameters

NameTypeDescription
condition_idstringEthereum condition ID for the market. This is optional. If you don't pass it, you get insights about all markets ranked by current_volume_24h in desc order.
min_volume_24hstringMinimum 24-hour trading volume required for a market to be included. Use this to remove low-activity or noise markets.
min_liquidity_percentilestringMinimum liquidity percentile relative to all active markets. Higher values indicate deeper books and better exit quality.
volume_trendstringFilters markets by recent activity momentum. Allowed values: `Spiking`, `Normal`, `Declining`, `Dying Interest`, `No Trades`, `ALL`.
min_top1_wallet_pctstringMinimum percentage of total exposure controlled by the largest wallet. Higher values may indicate whale dominance and potential fragility.
max_unique_traders_7dstringMaximum number of unique traders over the last 7 days. Useful for detecting low-participation or weak-consensus markets.

Social Intelligence

Social Pulse

agent_id 585

## Social Pulse

Request body (JSON)

Parameters

NameTypeDescription
keywordsstringFilter by keywords
hours_backstringFilter by hours back