Polymarket Node
The Polymarket node works with prediction markets on Polymarket ↗ — the world's largest prediction market platform. It has six modes across two families: discovery (browse / search / lookup) finds markets and their identifiers via the Gamma API, and market data (snapshot / history / depth) fetches live pricing, price history, and orderbook depth for a single market via the CLOB API. Both APIs are free and require no API key. The output shape is discriminated on mode.
Configuration
Polymarket
Public API — no key required
Discovery or market-data mode
Filter by category tag
Result Limit
Max markets returned (1–100)
Polymarket API Data, Without Writing Code
Polymarket exposes its data through two public APIs, and this node wraps both. The Gamma API serves market discovery: questions, slugs, event IDs, tags, volume, liquidity, and current implied probabilities. The CLOB API serves market data for a single market: live bid/ask/mid pricing, candle-style price history, and full orderbook depth.
Neither API requires a key, and the node handles pagination, identifier resolution, and field normalization for you. What you would otherwise script against two endpoints becomes one configured node:
| You want | Mode | Upstream API |
|---|---|---|
| Top markets by volume or liquidity | Browse | Gamma |
| Markets matching a phrase | Search | Gamma |
| One known event's markets | Lookup | Gamma |
| Live price, bid/ask, spread | Snapshot | CLOB |
| Price history as a timeseries | History | CLOB |
| Full orderbook, both sides | Depth | CLOB |
Every mode returns normalized JSON you can pass straight to an LLM node, a Function node, or a Polymarket Order node downstream.
Discovery Modes (Gamma API)
These modes return a markets[] array. Use them to find markets and their identifiers (conditionId, tokenIds, slug).
Browse (default)
Filter-based discovery using the Gamma /events/keyset endpoint. All fields are optional — with no filters it returns the top markets sorted by 24h volume.
| Field | Description | Default |
|---|---|---|
| Tag | Category filter (e.g. politics, crypto, sports, economics) | — |
| Status | active, closed, or all | active |
| Sort By | volume_24hr, volume, liquidity, end_date, start_date | volume_24hr |
| Min Volume | Only include markets with total volume ≥ N | — |
| Min Liquidity | Only include markets with liquidity ≥ N | — |
| Limit | Maximum markets to return (1–100) | 10 |
Search
Free-text search using /public-search. Matches against market question text.
| Field | Description |
|---|---|
| Query | Search terms (required). E.g. "fed rate cut", "world cup winner". Supports f(x) interpolation. |
| Limit | Maximum results (1–100) |
Lookup
Direct fetch by event slug or numeric event ID.
| Field | Description |
|---|---|
| Market ID | Event slug (e.g. will-fed-cut-rates-in-2026) or numeric event ID (e.g. 12345). Required. |
Note: Lookup expects an event slug or event ID. Individual market slugs from discovery output (
markets[i].slug) do not round-trip here — Gamma returns 0. To drill into a discovered market, chain into a market-data mode (snapshot/history/depth) via itsconditionId/tokenId, or use the numericeventIdfor lookup.
Multi-outcome events (e.g. "How many rate cuts in 2026?") return multiple rows in markets[] — one per possible outcome.
Market-Data Modes (CLOB API)
These modes fetch detailed data for a single market per execution via the CLOB API. They share one Market field that accepts four formats, auto-detected at runtime: a condition ID (0x… + 64 hex), a CLOB token ID (~60–90 digit decimal), a slug (fed-rate-cut-2026), or a Polymarket URL. Flip the field to f(x) mode to pass an identifier from an upstream node — e.g. {discovery.markets[0].conditionId} or {loop.item.tokenIds.yes} — which is how you fan a discovery result (or a loop) into per-market data.
snapshot accepts a condition ID and returns both YES + NO. history and depth operate on a single outcome token — pick YES/NO in the UI, or pass a token ID directly.
Snapshot
Current pricing and orderbook summary for a market.
| Field | Description |
|---|---|
| Market | Condition ID, token ID, slug, or URL (required) |
Output: snapshot.market (metadata), snapshot.yes / snapshot.no (each { tokenId, price, bid, ask, mid, spread }, or null if the input resolved to a single opposite token).
History
Price timeseries for a single outcome token, by relative lookback.
| Field | Description |
|---|---|
| Market | Must resolve to a token ID (required) |
| Interval | Candle interval: 5m, 15m, 1h, 4h, or 1d — aligned to the UTC boundary |
| Lookback | Number of intervals back from now (required, default 24). Supports f(x). |
Output: history.points[] — [{ timestamp, price }] (aligned to the UTC interval boundary) — plus history.tokenId and history.fidelityMinutes.
Note: the most recent point is the in-progress (not-yet-closed) candle — its timestamp is the request time, not a boundary. (Trimming it to the last closed candle is a planned follow-up.)
Depth
Full orderbook for a single outcome token.
| Field | Description |
|---|---|
| Market | Must resolve to a token ID (required) |
| Depth Levels | Levels per side, 1–50 (optional, default 10) |
Output: depth.bids[] / depth.asks[] ([{ price, size }], sorted), depth.lastTradePrice, depth.tickSize, depth.minOrderSize, depth.totalBidSize, depth.totalAskSize.
Workflow Examples
Monitor Top Political Markets
Find the most active political prediction markets each morning and summarize them with an LLM.
Configure the Discovery node with tag=politics, sortBy=volume_24hr, limit=10. The LLM receives the markets array and formats a digest of the most liquid political bets with their current implied probabilities.
Search and Alert on New Markets
Search for markets matching a topic and alert when new ones appear above a liquidity threshold.
Use search mode with query="fed rate cut 2026". The Function node filters for markets with liquidity > 10000. The Conditional node checks if filtered.markets.length > 0 before sending a Telegram alert.
Lookup a Specific Market
Fetch all outcome markets for a known event by slug and pass identifiers to a downstream node.
Pricing & Credits
Each Polymarket call costs a flat 2 credits, regardless of mode (discovery or market data) or number of markets returned.
Output
The output is discriminated on mode. Discovery modes return markets[]; market-data modes return a snapshot / history / depth object instead. For discovery, markets are flattened from events — each child market (each possible outcome) is a separate row in markets[].
| Path | Description |
|---|---|
| {discovery.mode} | The mode that was executed |
| {discovery.markets} | (discovery) Array of matched markets (see structure below) |
| {discovery.totalMatched} | (discovery) Count of markets in the returned array |
| {discovery.snapshot} | (snapshot) { market, yes, no } |
| {discovery.history} | (history) { tokenId, fidelityMinutes, points[] } |
| {discovery.depth} | (depth) { tokenId, bids[], asks[], lastTradePrice, … } |
| {discovery.metadata.source} | polymarket-gamma (discovery) or polymarket-clob (data) |
| {discovery.metadata.endpoints} | Array of API endpoints called |
| {discovery.metadata.requestedAt} | ISO timestamp of the request |
| {discovery.metadata.dataPoints} | (discovery) Number of markets returned |
| {discovery.metadata.creditsUsed} | Credits charged (always 2) |
discovery with your edge label. If the connecting edge is labeled markets, use {markets.markets[0].question}.Market Object Structure
Each item in markets[] has:
| Field | Type | Description |
|---|---|---|
question | string | The market question text |
slug | string | Market URL slug (note: a market slug does not round-trip into Lookup mode — use eventId or chain via conditionId) |
eventId | number | Numeric event ID on Polymarket — use this for Lookup mode |
conditionId | string | On-chain condition ID (for Portfolio Tracker node) |
tokenIds.yes | string | Token ID for the Yes outcome |
tokenIds.no | string | Token ID for the No outcome |
outcomePrices.yes | number | Current implied probability for Yes (0–1) |
outcomePrices.no | number | Current implied probability for No (0–1) |
volume | number | Total volume in USD |
volume24hr | number | 24-hour volume in USD |
liquidity | number | Available liquidity in USD |
endDate | string | ISO date string when the market resolves |
tags | string[] | Category tags |
Example Output (Browse Mode)
{
"mode": "browse",
"markets": [
{
"question": "Will the Fed cut rates in September 2026?",
"slug": "will-the-fed-cut-rates-september-2026",
"eventId": 98712,
"conditionId": "0xabc123...",
"tokenIds": { "yes": "71321...", "no": "71322..." },
"outcomePrices": { "yes": 0.72, "no": 0.28 },
"volume": 4500000,
"volume24hr": 320000,
"liquidity": 180000,
"endDate": "2026-09-30T00:00:00Z",
"tags": ["economics", "fed", "rates"]
}
],
"totalMatched": 1,
"metadata": {
"source": "polymarket-gamma",
"endpoints": ["/events/keyset"],
"requestedAt": "2026-05-07T09:00:00Z",
"dataPoints": 1,
"creditsUsed": 2
}
}
Common Errors
| Error | Cause | Fix |
|---|---|---|
| Polymarket Gamma resource not found (404) | Invalid slug or event ID in Lookup mode | Verify the slug from the Polymarket URL, e.g. polymarket.com/event/my-slug |
| Polymarket Gamma rate limit exceeded | Too many calls in a short window | Space out calls or reduce schedule frequency |
| Polymarket Gamma request timed out | Slow upstream response | Retry — the Gamma API is normally fast |
| Query is required for search mode | Mode is search but Query field is empty | Set a search query or switch to Browse mode |
| Market ID is required for lookup mode | Mode is lookup but Market ID field is empty | Set a slug or event ID |
| Market identifier is required | A data mode (snapshot/history/depth) has an empty Market field | Pick a market, or pass a condition/token ID via f(x) |
| Lookback (number of intervals ≥ 1) is required for history mode | History Lookback is empty or < 1 | Set Lookback to a positive integer (count of intervals) |
| Could not resolve a YES token ID… | history/depth got a slug/condition that didn't yield a token | Provide a token ID directly (pick YES/NO or use f(x)) |
Next Steps
- LLM Node — Feed market data and implied probabilities into an LLM to generate trading analysis.
- Function Node — Filter, sort, or transform the
markets[]array with custom JavaScript. - Conditional Node — Branch your workflow based on odds thresholds or liquidity levels.