docs

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.

Polymarket
Polymarket
Browse

Configuration

Polymarket

Public API — no key required

Discovery or market-data mode

Filter by category tag

Result Limit

Max markets returned (1–100)


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.

FieldDescriptionDefault
TagCategory filter (e.g. politics, crypto, sports, economics)
Statusactive, closed, or allactive
Sort Byvolume_24hr, volume, liquidity, end_date, start_datevolume_24hr
Min VolumeOnly include markets with total volume ≥ N
Min LiquidityOnly include markets with liquidity ≥ N
LimitMaximum markets to return (1–100)10

Free-text search using /public-search. Matches against market question text.

FieldDescription
QuerySearch terms (required). E.g. "fed rate cut", "world cup winner". Supports f(x) interpolation.
LimitMaximum results (1–100)

Lookup

Direct fetch by event slug or numeric event ID.

FieldDescription
Market IDEvent 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 its conditionId/tokenId, or use the numeric eventId for 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.

FieldDescription
MarketCondition 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.

FieldDescription
MarketMust resolve to a token ID (required)
IntervalCandle interval: 5m, 15m, 1h, 4h, or 1d — aligned to the UTC boundary
LookbackNumber 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.

FieldDescription
MarketMust resolve to a token ID (required)
Depth LevelsLevels 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.

Polymarket
Political Markets
Browse
Summarize Odds
Claude Sonnet 4.6
Morning Brief

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.

Polymarket
Fed Rate Search
Search
Filter Liquid
JavaScript
Any results?
1 rule
Alert

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.

Polymarket
Specific Event
Lookup
Extract Token IDs
JavaScript
Analyze Odds
Claude Sonnet 4.6

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[].

PathDescription
{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)

Market Object Structure

Each item in markets[] has:

FieldTypeDescription
questionstringThe market question text
slugstringMarket URL slug (note: a market slug does not round-trip into Lookup mode — use eventId or chain via conditionId)
eventIdnumberNumeric event ID on Polymarket — use this for Lookup mode
conditionIdstringOn-chain condition ID (for Portfolio Tracker node)
tokenIds.yesstringToken ID for the Yes outcome
tokenIds.nostringToken ID for the No outcome
outcomePrices.yesnumberCurrent implied probability for Yes (0–1)
outcomePrices.nonumberCurrent implied probability for No (0–1)
volumenumberTotal volume in USD
volume24hrnumber24-hour volume in USD
liquiditynumberAvailable liquidity in USD
endDatestringISO date string when the market resolves
tagsstring[]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

ErrorCauseFix
Polymarket Gamma resource not found (404)Invalid slug or event ID in Lookup modeVerify the slug from the Polymarket URL, e.g. polymarket.com/event/my-slug
Polymarket Gamma rate limit exceededToo many calls in a short windowSpace out calls or reduce schedule frequency
Polymarket Gamma request timed outSlow upstream responseRetry — the Gamma API is normally fast
Query is required for search modeMode is search but Query field is emptySet a search query or switch to Browse mode
Market ID is required for lookup modeMode is lookup but Market ID field is emptySet a slug or event ID
Market identifier is requiredA data mode (snapshot/history/depth) has an empty Market fieldPick a market, or pass a condition/token ID via f(x)
Lookback (number of intervals ≥ 1) is required for history modeHistory Lookback is empty or < 1Set 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 tokenProvide 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.