vike-polymarket-find-market
Two ids, never interchangeable. A market has one condition_id (0x + 64 hex) and one outcome TOKEN id per outcome (a long decimal number). polymarket market, market-trades and settlement take the condition id; orderbook, market-stats, tape and candles polymarket take a token id. This skill gets you both.
Call it
Use the first of these that is available:
- MCP:
searchwithqfor a name or a polymarket.com link;polymarket_marketswithview: "search",query, and the optionalactive(orclosed),limit,offset;polymarket_marketswithview: "market",condition_id. - CLI:
vike-data search "glucksmann french election" --json # `markets`: condition_id, question, end_date, volume_24h_usd vike-data polymarket markets --view search --query "btc updown 5m" --active false --limit 50 --json vike-data polymarket markets --view search --query btc-updown-5m-1796151300 --json # one market by its whole slug vike-data polymarket markets --view market --condition-id 0xa5ca27858ef5676943b3961ab3e14d9cd7c614fe33591c14e0f6023c7a9391c8 --json - curl: the credential is
VIKE_API_KEY, elseapi_keyoranon_tokenfrom~/.vike/config.json(Windows%USERPROFILE%\.vike\config.json); with none, get a free anonymous token withcurl -s -X POST https://data.vike.io/v1/anon -H 'Content-Type: application/json' -d '{"source":"skill-curl"}'and save itstokenthere as"anon_token"(seevike-core).curl -s "https://data.vike.io/v1/search?q=glucksmann&limit=5" -H "X-API-KEY: $TOKEN" curl -s "https://data.vike.io/v1/polymarket/markets?query=btc+updown+5m&active=false&limit=50" -H "X-API-KEY: $TOKEN" curl -s "https://data.vike.io/v1/polymarket/markets/0xa5ca27858ef5676943b3961ab3e14d9cd7c614fe33591c14e0f6023c7a9391c8" -H "X-API-KEY: $TOKEN"
| Flag (API name) | Default | Values |
|---|---|---|
--query |
none | words that must ALL appear in the slug, any order, case-insensitive (at most 8 words) |
--active |
both | true only open, false only closed (REST also takes closed, never both) |
--limit |
50 | at most 100 (a larger value is clamped) |
--offset |
0 | 0 to 10000 |
--condition-id |
- | --view market only, required there |
Output
search: themarketssection lists Polymarket markets by question (condition_id,question,end_date,volume_24h_usd); itspredictfunsection holds Predict.fun markets (market_id), andpolymarketholds Polymarket wallets.--view searchrows, newestend_datefirst:active,closed(1 or 0),condition_id,end_date(epoch ms),neg_risk(1 or 0),slug,tick_size,token_ids.--view market: a list of 0 or 1 such rows plussource:recorded(a market we recorded) orcatalog(Polymarket's full list, wheretick_sizeandneg_riskarenull). An unknown id is[], not an error.
Reading
- Each query word is a substring match:
5malso matches15m(checked 2026-12-02:btc updown 5mreturned abtc-updown-15m-...row first). For one market give its whole slug, timestamp included. token_idshas no outcome labels here. They follow the market's outcome order, which this row does not carry: take the labels fromvike-data polymarket market <condition_id>(outcomesbesideclob_token_ids) orpolymarket settlement(outcomesbesidetoken_ids). For up/down markets the order isUp,Down.--view searchcovers only the markets we recorded (since 2026-07-25: the most active markets and the up/down series). A market it does not find can still be in Polymarket's catalogue: look it up by condition id with--view market, or by name withvike-data search.closedcomes from the on-chain resolution or Polymarket's own closed flag;activeis its opposite. A market pastend_datethat nothing has closed yet still readsactive: 1: confirm withvike-polymarket-resolutions.neg_risk: 1marks a market of a multi-outcome event (one Yes/No market per candidate or bucket).- For trending markets with live quotes use
vike-polymarket-markets; for one market's holders, trades and stats,vike-polymarket-market-detail.
Errors
pass either 'active' or 'closed', not both: MCP and REST take both spellings; send one.- An offset above 10000 is refused: narrow the words instead.
- REST: errors are 400
{"error": "..."}, and an unknown parameter is refused:?condition_id=on/marketsanswers thatcondition_id is a path segment(use/markets/{condition_id});?q=getsdid you mean 'query'. - A token id passed as
condition_idmatches nothing:[]. - Exit code 3: the anonymous token's daily limit; tell the user to run
vike-data login, do not retry.
Anti-patterns
- Don't read the first token id as Yes or Up without checking the outcome labels.
- Don't call a market open because
activeis 1 after its end date.
Pairs well with
vike-polymarket-market-detail,vike-pm-market-diligence- one market in depthvike-polymarket-updown- the slug rule of the crypto up/down marketsvike-polymarket-order-book,vike-polymarket-tape,vike-candles- what to do with a token id
