# Prediction Markets API — Kalshi & Polymarket Odds (`lergassy/prediction-markets-api`) Actor

Kalshi and Polymarket in one table: implied probability, yes and no price, best bid and ask, 24h move, volume, liquidity and close date for every market. Election odds, sports and economic event contracts, with price history and order book. No API key.

- **URL**: https://apify.com/lergassy/prediction-markets-api.md
- **Developed by:** [Matvey](https://apify.com/lergassy) (community)
- **Categories:** News, Business, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.80 / 1,000 markets

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

**Prediction Markets API** puts Kalshi and Polymarket into one table. Every market comes back with the implied probability in per cent, the yes and no price, best bid and ask, the 24-hour move, volume, liquidity, the close date and a link — the same field names for both venues, so you can sort, filter and chart the whole prediction market at once instead of writing two clients.

![One run of Prediction Markets API: Kalshi and Polymarket side by side with probability, volume and liquidity.](https://raw.githubusercontent.com/lergassy/apify-actor-assets/main/prediction-markets-api/prediction-markets-api-output-table.png)

Five modes: **markets** (one row per tradable contract), **events** (one row per question with every outcome and its probability), **search** by keyword, **price history**, and the **order book**. Both APIs are public: no key, no proxy, no browser. A run over both venues takes a few seconds.

### What is Prediction Markets API?

It is a data feed for people who watch what the crowd actually prices: traders, journalists, researchers, dashboard builders and AI agents that get asked "what are the odds the Fed cuts in September". Kalshi is the CFTC-regulated US exchange; Polymarket is the global crypto-settled venue. Their questions overlap on the big themes — rates, elections, wars, crypto, sport — and their prices do not always agree.

### What data does it return?

#### Markets

| Field | Example |
|---|---|
| `platform`, `marketId`, `slug` | kalshi · KXOAIANTH-40-OAI · same ticker |
| `question`, `shortTitle`, `eventTitle` | Will OpenAI or Anthropic IPO first? — OpenAI |
| `probability`, `yesPrice`, `noPrice` | 6.0 (per cent) · 0.06 · 0.94 |
| `bestBid`, `bestAsk`, `spread`, `lastPrice` | 0.05 · 0.07 · 0.02 · 0.06 |
| `priceChange24h` | -0.03 — the move in price, so ±0.03 is three points of probability |
| `volume`, `volume24h`, `volume1w`, `liquidity`, `openInterest` | 171,344 · 4,120 · … |
| `status`, `result` | open · empty until it settles |
| `openTime`, `closeTime`, `endDate` | ISO 8601 |
| `category`, `tags` | Economics · \["Fed Rates", "Politics"] |
| `outcomes` | \[{name: "Yes", price: 0.06, probability: 6.0}, {name: "No", …}] |
| `rules`, `url` | resolution text · link to the market |

Polymarket rows also carry `image` and `clobTokenIds`; Kalshi rows carry `seriesTicker`, `marketType` and `strikeType`.

#### Events

One row per question with `outcomes` sorted most likely first, `favourite` and `favouriteProbability`, `outcomeCount`, total `volume` and `liquidity`, and a ready `summary` sentence. This is the shape for "who will win" questions: one row for *Brazil Presidential Election* with all five candidates and their probabilities, instead of five separate contracts.

#### Price history and order book

History returns one row per point with `time`, `price` and `probability` — a week at hourly resolution by default, up to 90 days. The order book returns both sides with price and size per level.

### How much does it cost?

Pay per row, and only for rows you actually get:

| Event | Price |
| --- | --- |
| Market | $0.004 |
| Event | $0.002 |
| Price point | $0.0004 |
| Order book snapshot | $0.003 |

**Error rows are never charged.** There is no browser and no proxy — two public JSON APIs —
so platform usage on top of that is negligible.

| Job | Cost |
| --- | --- |
| 500 markets across both venues | $2.00 |
| 100 markets with 30 days of price history | $1.60 |
| A daily 200-market snapshot for a month | $24.00 |

Comparable prediction-market Actors charge $0.004 to $0.012 per row and usually cover one
venue; this one returns Kalshi and Polymarket in the same schema.

### How to use it

1. Leave **🏛️ Platforms** on both, or pick one.
2. Choose **📋 What to get**: markets, events, search, history or order book.
3. Narrow with **🔍 Keyword** (`fed`, `election`, `bitcoin`), **🏷️ Category** — several at once, `Politics, Crypto` — and a depth filter: **💧 Minimum volume** for how much has traded, **💧 Minimum liquidity** for how much is resting in the book (Polymarket publishes this, Kalshi does not), or **📈 Minimum open interest** for how many contracts are still open (Kalshi's own measure). Both venues list thousands of near-empty contracts, and a volume floor of 1000 keeps the ones people actually trade.
4. Sort by 24-hour volume, total volume, liquidity, closing date, probability or biggest 24-hour move.
5. Click **Start**, then export as JSON, CSV or Excel, or read the dataset through the API.

### ⬇️ Input

```json
{
  "platforms": ["kalshi", "polymarket"],
  "mode": "markets",
  "query": "fed",
  "minVolume": 1000,
  "sortBy": "volume24h",
  "maxMarkets": 200
}
```

#### Events with all outcomes

```json
{ "mode": "events", "category": "Politics", "minVolume": 5000, "maxMarkets": 50 }
```

#### Price history for specific markets

```json
{ "mode": "history", "marketIds": ["KXOAIANTH-40-OAI"], "historyDays": 30 }
```

Leave `marketIds` empty and the Actor takes the most active markets instead.

### ⬆️ Output

```json
{
  "type": "market",
  "platform": "kalshi",
  "marketId": "KXOAIANTH-40-OAI",
  "question": "Will OpenAI or Anthropic IPO first? — OpenAI",
  "eventTitle": "Will OpenAI or Anthropic IPO first?",
  "category": "Companies",
  "probability": 6,
  "yesPrice": 0.06,
  "noPrice": 0.94,
  "bestBid": 0.05,
  "bestAsk": 0.07,
  "spread": 0.02,
  "lastPrice": 0.06,
  "priceChange24h": -0.01,
  "volume": 171344.62,
  "volume24h": 2840,
  "liquidity": 18220.5,
  "openInterest": 40639.56,
  "status": "open",
  "closeTime": "2027-12-31T15:00:00Z",
  "outcomes": [
    { "name": "Yes", "price": 0.06, "probability": 6 },
    { "name": "No", "price": 0.94, "probability": 94 }
  ],
  "url": "https://kalshi.com/markets/kxoaianth",
  "scrapedAt": "2026-09-04T01:00:00.000Z"
}
```

A venue that fails to answer arrives as a `type: "error"` row with the reason, never as a silently short list.

### Use cases

#### Watching a theme across both venues

Filter on `fed` or `election` and get every contract on both exchanges in one table, with the probability each one implies.

#### Dashboards and newsletters

Sort by 24-hour move to see what repriced overnight, or by closing date for what resolves this week.

#### Research

Pull price history for a set of markets and study how the crowd's estimate moved against the news.

#### Bots and alerts

Schedule the run and alert when a probability crosses a threshold you care about.

#### AI agents

An agent asked "what do prediction markets say about a September rate cut" runs the search mode and reads `probability` straight off the rows.

### 🤖 For AI Agents & LLM Apps

Compact reference for agents calling this Actor through the [Apify MCP server](https://mcp.apify.com) or the Apify API (`lergassy/prediction-markets-api`).

**Purpose:** returns what prediction markets currently price for a question, from Kalshi and Polymarket in one shape. Use it for "what are the odds of X", "which markets moved most today", "what does the crowd think about the election".

**Minimal input:**

```json
{ "query": "fed", "minVolume": 1000, "maxMarkets": 50 }
```

**Output:** one row per market — `platform`, `marketId`, `question`, `eventTitle`, `category`, `tags`, `probability` (per cent, the number to quote), `yesPrice`, `noPrice`, `bestBid`, `bestAsk`, `spread`, `lastPrice`, `priceChange24h`, `volume`, `volume24h`, `liquidity`, `openInterest`, `status`, `openTime`, `closeTime`, `outcomes`, `rules`, `url`, `scrapedAt`. Event mode returns `outcomes` sorted by probability with `favourite` and a `summary` sentence; history mode one row per price point; order-book mode one row per market with both sides.

**Behaviors an agent should know:**

- **`probability` is the field to quote**, in per cent. `yesPrice` is the same number as a price between 0 and 1, because one contract pays $1 if the event happens.
- `priceChange24h` is a change in *price*, so 0.03 means three percentage points of probability.
- Both venues list thousands of near-empty markets. Always pass `minVolume` (1000 is a good floor) or the answer fills with noise.
- Filters are applied by this Actor, not by the venues: `query` matches the question, event title and tags; `category` matches Kalshi categories and Polymarket tags.
- A run across both venues interleaves them so neither fills the page; the two report volume on different scales, so compare probabilities, not volumes.
- The venues word the same question differently, so do not assume a Kalshi market and a Polymarket market with similar wording are the same contract. Read both and say which venue each number came from.
- History needs `marketIds`; without them the Actor uses the most active markets. Polymarket history needs the market's CLOB token, which comes from the markets mode.
- Neither API needs a key and no proxy is used.

### Election odds and event contracts in one table

Kalshi and Polymarket price the same kinds of questions and format them differently. This Actor normalises
both into one row shape — implied probability, yes and no price, best bid and ask, 24-hour move, volume,
liquidity and close date — so election odds, economic releases and sports contracts can be compared side by
side without writing two parsers.

### Kalshi API and Polymarket API without keys

Both venues publish open endpoints, and both change shape often. The Actor handles pagination, the differing
price conventions and the end-of-list quirks, and returns the same fields whichever venue a market came from.

### ❓ FAQ

#### Is this financial advice or a trading tool?

No. It reads public market data and returns it as a table. It places no orders and holds no positions. What you do with the numbers is your business, and prediction markets are restricted or illegal in some jurisdictions.

#### Why do Kalshi and Polymarket disagree on the same event?

Different user bases, fees, settlement rules and wording. The gap is real information, but the questions are rarely identical — check the resolution rules in the `rules` field before treating two markets as the same bet.

#### Is the probability the true chance of the event?

It is what the market pays, which is the crowd's price after fees and risk appetite. Treat it as a market price, not a forecast from a model.

#### How fresh are the numbers?

Live at the moment of the run: both APIs serve current order-book state. Schedule the Actor for a time series of your own.

#### Do I need an account on either venue?

No. Both APIs used here are public and read-only.

#### Can I use it with the Apify API or an MCP server?

Yes. It runs from the API and the official clients, and AI agents reach it through the Apify MCP server without extra setup.

### Your feedback

Missing a field, or a venue you want added? Open an issue on the **Issues** tab — every one gets answered.

### You might also like

| Actor | What it does |
|---|---|
| [Sports Scores & Schedules API](https://apify.com/lergassy/sports-scores-api) | Live scores, schedules and betting lines for 33 leagues |
| [Google Flights Scraper](https://apify.com/lergassy/google-flights-scraper) | Live flight prices, layovers and booking options |
| [US New Business Leads](https://apify.com/lergassy/us-business-filings) | Newly registered US businesses with checked contacts |
| [Email Verifier & Phone Number Validator](https://apify.com/lergassy/email-phone-verifier) | Checks e-mails and phone numbers in bulk |

### Also known as

People look for this Actor as a prediction markets API, a Kalshi API, a Polymarket API, an event contracts feed, prediction market odds, election odds, implied probability data, and betting market data.

# Actor input Schema

## `platforms` (type: `array`):

Which venues to read. Keep both to get one table across the whole prediction market.

## `mode` (type: `string`):

<b>Markets</b> gives one row per tradable contract. <b>Events</b> collapses them into one row per question with every outcome and its probability, which is the shape you want for “who will win” questions.

## `query` (type: `string`):

Filter to markets whose question, event or tags contain this text: <code>fed</code>, <code>election</code>, <code>bitcoin</code>, <code>super bowl</code>.

## `category` (type: `string`):

Kalshi category or Polymarket tag: Politics, Economics, Crypto, Sports, Culture, Science. Several at once, comma separated — <code>Politics, Crypto</code> keeps a market matching either.

## `minVolume` (type: `integer`):

Drop thin markets. Both venues list thousands of near-empty contracts; 1000 keeps the ones people actually trade.

## `minLiquidity` (type: `integer`):

Drop markets with less than this much money resting in the book, in US dollars. Polymarket publishes this figure; Kalshi reports zero on almost every market, so on Kalshi use <b>Minimum open interest</b> instead.

## `minOpenInterest` (type: `integer`):

Drop markets with fewer than this many contracts still open. This is Kalshi's measure of how much is actually at stake in a market.

## `sortBy` (type: `string`):

How to order the result.

## `maxMarkets` (type: `integer`):

Cap on rows per run.

## `includeClosed` (type: `boolean`):

Off by default: only markets you can still trade.

## `marketIds` (type: `array`):

For the history and order-book modes: Kalshi tickers such as <code>KXOAIANTH-40-OAI</code> or Polymarket numeric ids. Leave empty to use the most active markets.

## `historyDays` (type: `integer`):

How far back the price history goes.

## `seriesTicker` (type: `string`):

Narrow Kalshi to one series, for example <code>KXPRESPARTY</code>.

## `orderbookDepth` (type: `integer`):

Price levels per side in the order-book mode.

## Actor input object example

```json
{
  "platforms": [
    "kalshi",
    "polymarket"
  ],
  "mode": "markets",
  "minVolume": 0,
  "minLiquidity": 0,
  "minOpenInterest": 0,
  "sortBy": "volume24h",
  "maxMarkets": 200,
  "includeClosed": false,
  "historyDays": 7,
  "orderbookDepth": 10
}
```

# Actor output Schema

## `markets` (type: `string`):

One row per market with the venue, the question, implied probability in per cent, yes and no prices, best bid and ask, 24h price move, volume, liquidity, close date and link. Compare mode returns one row per matched question with both probabilities and the gap; history mode one row per price point; order-book mode one row per market with both sides.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "query": ""
};

// Run the Actor and wait for it to finish
const run = await client.actor("lergassy/prediction-markets-api").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "query": "" }

# Run the Actor and wait for it to finish
run = client.actor("lergassy/prediction-markets-api").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "query": ""
}' |
apify call lergassy/prediction-markets-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,lergassy/prediction-markets-api"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/nfjcmv74wEU2Qtyhq/builds/V4r1WuexVCgKmHlNw/openapi.json
