meshapi.app / guides / polymarket-api
Polymarket API Quickstart: Keys, Market Data, and Event Context
Pull live Polymarket data with nothing but an HTTP client, then go where the exchange API stops: checking what was actually said in the events these markets trade on.
Updated August 2026 · 12 min read
Part 1 · Polymarket setupRead market data with no key at all
Polymarket runs its markets as tokenized contracts on Polygon, settled in USDC, with a central limit order book. Two public APIs cover reading:
- The Gamma API (gamma-api.polymarket.com) serves market metadata, outcomes, and prices. No key, no wallet.
- The CLOB API (clob.polymarket.com) serves orderbooks, price history, and trading. Reading is open; placing orders requires signing with a Polygon wallet key, and the py-clob-client library derives the API credentials from it.
Your first call: the most active markets on the exchange right now.
# pip install requests
import requests, json
resp = requests.get("https://gamma-api.polymarket.com/markets", params={
"active": "true", "closed": "false",
"order": "volume24hr", "ascending": "false", "limit": 10,
})
for m in resp.json():
yes = json.loads(m["outcomePrices"])[0] # prices arrive as a JSON-encoded string
print(f'{m["question"][:52]:54} yes={yes} vol24h=${float(m["volume24hr"]):,.0f}')Prices are decimals between 0 and 1: a yes price of 0.43 is an implied 43% probability. (Kalshi's API quotes the same idea as dollar-decimal strings; if you build cross-venue, normalize early.) Setup done. The interesting question is what to point it at.
Part 2 · The marketsMention polymarkets: trading on what someone will say
Polymarket's mention markets resolve on whether a word or phrase gets said during a defined event. The catalog runs from politics to earnings calls to MrBeast videos:

Open the Walmart earnings-call event and the threshold structure is the whole game. The market is not asking whether Walmart says "customer". It is asking how many times:

How these markets resolve, and where the API stops
The rules are strict about the trigger and say nothing about the evidence. Resolution is "Yes" if the listed term is mentioned by anyone during the event; disputed outcomes go through the UMA optimistic oracle, where whoever proposes or disputes a resolution needs the receipts. Scroll down any mention market and you can watch traders doing this by hand:

That comment thread is the wall, stated by the users themselves. The Polymarket APIs give you prices, orderbooks, and per-token price history, but nothing about the event: no transcript, no counts, no way to check a threshold contract against what was actually said. Deeper history is thin too. Price series survive per token, but trade-level and orderbook history are not archived by the platform, and the event context behind a settled market was never there to begin with.
Part 3 · Event contextAdding the transcript layer with Mesh
Mesh carries the missing evidence: cleaned, timestamped transcripts of the events these markets resolve on (press conferences, hearings, earnings calls), with speaker resolution and topic tagging, queryable over REST. For a frequency-threshold market, the workflow is literally counting:
# 1. Polymarket: the "Customer 40+ times" contract is at 0.68
# 2. Mesh: how often has Walmart actually said "customer" per call?
import requests
from collections import Counter
segs = requests.get(
"https://api.meshapi.app/v1/segments/search",
params={"q": "customer", "event_type": "earnings_call", "limit": 200},
headers={"X-API-Key": "YOUR_KEY"},
).json()["data"]
per_call = Counter(s["event_title"] for s in segs)
for event, n in sorted(per_call.items()):
print(f"{event}: 'customer' said {n} times")If the phrase cleared 40 in six of the last eight calls, 68% is cheap; if it cleared 40 twice, 68% is a gift to the other side. The comment-section traders are reconstructing this base rate manually from videos. The transcripts make it a query.
Combining mention markets with company financial markets
Polymarket also prices what companies do. The same search that finds the Walmart mention market finds launch-cadence markets for SpaceX:

Say-markets and do-markets feed each other, and the event record is the bridge:
- Language moves the operational markets. When an executive says "we're accelerating launch cadence" on a call, the launch-count contracts reprice. You can search every past call for the phrase and see what actually followed.
- Operations move the mention markets. A launch failure mid-month makes "will they mention the anomaly?" tradeable, and the record of how the company addressed past incidents is the edge.
- When a mention contract spikes, the first question is whether something got said. Timestamped segments answer it without scrubbing through a two-hour video.
Polymarket prices the bet; the event decides it. Mesh gives you the event: transcripts with speakers and timestamps, going back through settled markets, through one API, for Polymarket and Kalshi both.
FAQ
Is the Polymarket API free?+
Reading is free: the Gamma and CLOB data endpoints need no key or account. Trading requires a funded account (USDC on Polygon, or the US app where available) and wallet-signed requests. The API itself has no fee.
How do Polymarket mention markets resolve?+
"Yes" if the listed term is mentioned by anyone during the defined event, per each market's rules; frequency contracts require the stated count. Contested outcomes go through the UMA optimistic oracle, where proposers and disputers back their claim with evidence from the event itself.
Can I get historical Polymarket data?+
Price history per token is available from the CLOB API. Trade-level and orderbook history are not archived by the platform, and the event context behind settled markets never was. Long-run research needs an external archive; this is one of the gaps Mesh's historical data covers.
Does Polymarket have a WebSocket API?+
Yes: the CLOB exposes a streaming feed for orderbook and trade updates on subscribed markets, which beats polling for live strategies. REST remains the interface for order placement.
Does this work for Kalshi too?+
Yes. Kalshi runs mention markets on many of the same events, including the same earnings calls, and Mesh's transcripts are venue-agnostic. The Kalshi quickstart covers that exchange's REST API and auth.
Screenshots are live Polymarket markets captured in August 2026. Also see the Kalshi API quickstart.