A prediction market API lets software retrieve event-contract data for research. Start with a market's exact question and identifier, then select the endpoint for the information you need. Preserve the original response and its retrieval time before calculating anything. Public data access alone does not establish trading eligibility or show that a strategy would have earned money.
Documentation and read-only example checked September 20, 2026, at 8:13 a.m. ET. This guide covers Kalshi and Polymarket's international APIs; Polymarket US has separate documentation. Educational material, not financial advice.
TL;DR
- Use official discovery endpoints to identify contracts before requesting prices.
- Keep outcome labels attached to identifiers. A Yes price and a No price answer different questions.
- Save raw responses with timestamps; a current order book cannot reconstruct yesterday's fills.
- Check pagination and schema changes before treating a sample as a complete dataset.
Which prediction market API should you use?
Choose according to the research task. Kalshi's market-data quickstart documents public endpoints that do not require authentication. They support a progression from a recurring series to individual markets and their order books.
Polymarket's API documentation separates market discovery through Gamma from prices and order books through its central limit order book, or CLOB. Its Data API covers account activity and positions. The international API should not be assumed interchangeable with Polymarket US.
| Research task | Kalshi starting point | Polymarket starting point |
|---|---|---|
| Identify a question | Series and market endpoints; retain ticker | Gamma; retain question, market ID and outcome mapping |
| Inspect available quotes | Market order book | CLOB order book for the chosen outcome token |
| Study earlier prices | Candlesticks; check historical cutoff | CLOB price-history endpoint |
| Review participant activity | Check the trade endpoint's documented fields | Data API; distinguish activity from book depth |
This map identifies where to begin. It does not promise equal coverage or compatible units across venues. For broader platform differences, see the Kalshi versus Polymarket comparison.
How the data workflow works
A binary event contract pays according to a defined Yes-or-No outcome under its settlement rules. The title alone may omit exceptions. Preserve the rule text alongside the data so a later analysis can establish what the contract actually measured.
Kalshi identifies an individual market by ticker. Polymarket groups markets within events and assigns each outcome its own token ID. When parsing raw Gamma fields such as clobTokenIds, retain the corresponding outcome labels. Do not join records merely because their titles resemble each other.
Order-book formats also differ. Kalshi's documentation describes Yes and No bid arrays in orderbook_fp, with dollar prices and quantities represented as strings. An implied Yes ask equals $1 minus the best No bid. An empty side is missing liquidity, not a zero-price offer.
Polymarket's price documentation describes bids and asks for an outcome token. Preserve decimal precision and check the documented sorting order before selecting a best price. A last trade may be older than the displayed quotes.
A reproducible read-only data exercise
Save the following as sample.mjs and run it with node sample.mjs in a directory where you can write files. It requires a recent Node.js version with built-in fetch. It requests a small Kalshi weather-market sample without credentials and never submits an order.
import { writeFile } from 'node:fs/promises';
import { createHash } from 'node:crypto';
const url = 'https://external-api.kalshi.com/trade-api/v2/markets?series_ticker=KXHIGHNY&status=open&limit=5';
const response = await fetch(url, { signal: AbortSignal.timeout(15000) });
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const raw = await response.text();
const retrieved_at = new Date().toISOString();
const data = JSON.parse(raw);
if (!Array.isArray(data.markets)) throw new Error('Unexpected schema');
const sha256 = createHash('sha256').update(raw).digest('hex');
await writeFile(`market-sample-${Date.now()}.json`, JSON.stringify({ url, retrieved_at, sha256, raw }, null, 2));
console.log({ retrieved_at, records: data.markets.length, more_pages: Boolean(data.cursor), sha256 });
The example returned five records and a nonempty pagination cursor when checked at 12:12:59 UTC on September 20. That establishes a successful sample request, not a complete download or an uptime guarantee. Re-running it will produce a new observation; the markets and response hash can change.
The SHA-256 hash is a fingerprint of the saved response text. It helps detect later file changes, but cannot prove the exchange's data was correct or independently certify the local clock.
Before using this sample for a decision exercise, complete the following audit worksheet:
| Check | Evidence to preserve | When to stop |
|---|---|---|
| Identity | Venue, ticker or token ID, outcome and full rules | Outcome mapping or settlement wording is unclear |
| Time | Retrieval time plus any source update time | The analysis treats them as the same clock without evidence |
| Completeness | Request filters, returned count and pagination cursor | A first page is being labeled the full market universe |
| Price meaning | Raw units and field definition | A midpoint or last trade is being treated as an executable fill |
For an original practice score, award one point per completed row. All four points mean the sample is documented enough for the next research step. This is a recordkeeping rubric, not a profitability score. Keep failed rows visible instead of silently dropping inconvenient records.
Potential positives vs negatives
Public APIs make repeatable research accessible without funding an account. A saved response lets someone inspect the exact inputs behind a calculation. Consistent identifiers can also reduce transcription errors when tracking a contract over time.
Incomplete downloads can produce selection bias. Polling misses changes between requests, and a historical price series generally lacks the information required to reproduce queue position. Fees and available size still matter when evaluating a hypothetical trade. The liquidity and slippage guide explains that execution distinction.
What could happen from here
Base scenario: the documented fields remain stable
Repeat the sample and compare its schema with the saved copy. Continue only if identifiers and units retain their meaning. A renamed field invalidates an unchanged parser even when the request returns HTTP 200.
Upside scenario: the dataset becomes more useful
After validating pagination, extend the exercise to a fixed historical window. Confirm the requested interval and coverage before comparing observations. Kalshi's candlestick reference directs older settled markets to a separate historical route. Successful current-market requests do not establish historical completeness.
Downside scenario: requests fail or data is incomplete
On a rate-limit response, pause and follow the provider's retry guidance. Treat schema failures and missing pages as explicit gaps. Do not substitute yesterday's response while labeling the result current.
What traders should watch next
Check official API change notices before each research session. Keep a small saved fixture to detect parser changes, and document any change in endpoint or time units. Public access does not override platform restrictions. This guide describes data collection, not permission to trade in a particular jurisdiction.
FAQ
Do I need an API key to begin?
The public Kalshi endpoints used here and Polymarket's public market-data requests do not require credentials. Private account requests and order placement have separate authentication requirements.
Can candlesticks prove a strategy would have filled?
No. Candlesticks summarize an interval. They do not establish your queue position or the size available when your hypothetical order would have arrived.
Does ChartDojo connect directly to these APIs?
This article does not describe a ChartDojo integration. The data exercise is separate from ChartDojo's trading practice and feedback workflow.
Sources
Official Kalshi and Polymarket documentation is linked beside the relevant claims. The read-only code and audit worksheet are original educational material. The cover is original ChartDojo artwork using the official logo; it illustrates a request path, not live prices.
Build real skills, not bad habits. Practice trading decisions with ChartDojo and AI-powered feedback. Start your free trial.