# Kalshi & Polymarket Order Book, 24h Change & Price History (`scrapebench/kalshi-polymarket-orderbook-history-scraper`) Actor

Name a Kalshi or Polymarket market and get its price, 24h change, rules, order book, price history and trades, in one shape across both venues.

- **URL**: https://apify.com/scrapebench/kalshi-polymarket-orderbook-history-scraper.md
- **Developed by:** [ScrapeBench](https://apify.com/scrapebench) (community)
- **Categories:** News
- **Features:** Limited permissions
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.0012 / market

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Kalshi & Polymarket Order Book, 24h Change & Price History

### Pain points

- Kalshi's order book lists bids only: a list of yes bids and a list of no bids. The yes ask is one minus the best no bid, which nobody should have to remember when reading a book.
- Polymarket's book is a different shape again (bids and asks of one token) and its token ids are inside a JSON-encoded string on the market.
- Kalshi's price history lives under the series ticker, not the market ticker, and returns null prices for hours with no trade; a chart needs the last price carried forward.
- Polymarket's hourly history is refused for a window longer than 15 days, and its trades moved to a v2 data API that filters by condition id; the v1 address answers 410 'retired' (checked 2026-11-16).
- Kalshi has no keyword search endpoint, so finding 'fed rate' means searching 16,000 series titles by hand.

### What we solve

- One order-book shape for both venues: bids and asks of the YES contract, best first, with depth, spread and mid.
- 24h price change on every market row, from each venue's own figure.
- Price history with the last price carried across empty hours, in 14-day windows where Polymarket needs them.
- Trades per market, newest first, with size and side.
- Keyword search over Kalshi's series and Polymarket's search; tickers, slugs and polymarket.com links for exact markets.
- Resolution rules in the venue's words on every market row.

### Summary

Reads the markets you name on Kalshi and Polymarket and returns four kinds of row in one schema: the market (price, best bid and ask, spread, 24h change, volume, open interest, resolution rules), its order book (every resting yes bid and ask, best first, with depth), its price history (hourly or daily points; on Kalshi also open, high, low, volume, open interest and bid/ask) and its trades. Find markets by keyword ('fed rate', 'bitcoin', 'hurricane'), by Kalshi series, event or market ticker, or by Polymarket slug or link. Kalshi publishes only bids on each side and Polymarket publishes bids and asks; both come out as the same bids and asks of the YES contract, so one parser reads both. Both venues are public, keyless APIs: no login, no key, no browser.

### Who it's for

- Traders sizing an order against the real depth, not the top of book
- Quant researchers pulling price history and trades for backtests
- Analysts watching how fast a market moved in 24 hours
- Developers who need one parser for two prediction markets

### How to use

Set the input, run the actor, and collect results from the run's dataset (export to JSON/CSV/Excel, or pull via the Apify API). Example input:

```json
{
  "queries": [
    "fed rate"
  ],
  "venue": "both",
  "includeOrderbook": true,
  "includeHistory": true,
  "historyDays": 7,
  "maxMarkets": 5
}
```

See **Inputs** below for every available field.

### What you get

One row per record:

| Field | Description |
|---|---|
| `row_type` | market, orderbook, price-point or trade; venue and market_id are on every row so rows join to their market |
| `venue / market_id / event_id / series` | kalshi or polymarket, the ticker or id, the parent event, and the Kalshi series or Polymarket slug |
| `question / subtitle / category / status` | The market as the venue words it, which outcome it is, Kalshi's category (null on Polymarket), and its status |
| `yes_price / no_price / best_bid / best_ask / spread / last_price` | Prices 0-1 and the top of the book |
| `implied_probability / price_change_24h` | Last trade (else the mid of the book) and the move from 24 hours ago |
| `volume / volume_24h / open_interest / liquidity` | Contracts or dollars traded, 24h, open interest (Kalshi) and resting liquidity |
| `rules / resolution_source / close_time / result` | The resolution rules, Polymarket's stated source, when trading stops, and the result once settled |
| `bids / asks / bid_depth / ask_depth / mid` | Order-book rows: yes bids and asks as \[price, contracts], best first, with the contracts resting on each side |
| `time / price / open / high / low / volume / yes_bid / yes_ask` | Price-point rows: one per hour or day; Kalshi adds open, high, low, volume, open interest and bid/ask, Polymarket gives the price |
| `time / yes_price / no_price / size / taker_side / side / outcome / trade_id` | Trade rows: Kalshi gives the taker side, Polymarket buy or sell of an outcome |
| `market_url / source_url` | The venue's page and the endpoint the row came from |

Sample:

```json
{
  "source_url": "https://api.elections.kalshi.com/trade-api/v2/markets/KXFEDDECISION-26DEC-H26",
  "row_type": "market",
  "venue": "kalshi",
  "market_id": "KXFEDDECISION-26DEC-H26",
  "event_id": "KXFEDDECISION-26DEC",
  "series": "KXFEDDECISION",
  "question": "Will the Federal Reserve Hike rates by >25bps at their December 2026 meeting?",
  "subtitle": "Hike >25bps",
  "category": "Economics",
  "status": "active",
  "yes_price": 0.09,
  "no_price": 0.92,
  "best_bid": 0.08,
  "best_ask": 0.09,
  "spread": 0.01,
  "last_price": 0.09,
  "implied_probability": 0.09,
  "price_change_24h": -0.02,
  "volume": 4785925.55,
  "volume_24h": 54436.93,
  "open_interest": 2389289.58,
  "open_time": "2025-09-29T14:00:00Z",
  "close_time": "2026-12-09T18:59:00Z",
  "market_url": "https://kalshi.com/markets/kxfeddecision"
}
```

### Inputs

| Field | Required | Type | Default | Description |
|---|---|---|---|---|
| `queries` | no | array | `["fed rate"]` | Find markets by words: 'fed rate', 'bitcoin', 'hurricane', 'temperature'. Kalshi is matched on its series titles, Polymarket through its own search. Use tickers for an exact market. |
| `query` | no | string | — | One keyword. Kept alongside 'Keywords' for saved tasks and API callers. |
| `tickers` | no | array | `[]` | Exact Kalshi markets: a series (KXFED), an event (KXFED-26DEC) or a single market (KXFED-26DEC-T2.75). |
| `polymarketSlugs` | no | array | `[]` | Exact Polymarket markets or events: a slug ('will-bitcoin-reach-100k-in-november-2026') or the polymarket.com link. |
| `venue` | no | string | `"both"` | Where keywords are searched: Kalshi, Polymarket or both. Tickers and slugs always go to their own venue. |
| `includeOrderbook` | no | boolean | `false` | One row per market with every resting bid and ask of the YES contract, best first, in the same shape on both venues. Billed per row. |
| `includeHistory` | no | boolean | `false` | One row per point: price, and on Kalshi open/high/low, volume, open interest and bid/ask. Billed per point. |
| `historyDays` | no | integer | `7` | How far back the price history reaches. |
| `historyInterval` | no | string | `"hourly"` | One point per hour or per day. |
| `maxHistoryPoints` | no | integer | `500` | Cap per market; the most recent points are kept. |
| `includeTrades` | no | boolean | `false` | One row per trade: time, price, size and side. Billed per trade. |
| `maxTrades` | no | integer | `100` | Cap per market, newest first. |
| `includeClosed` | no | boolean | `false` | Also read settled markets, with their result. Off = open markets only. |
| `maxMarkets` | no | integer | `20` | Cap on markets for the whole run: your spend control. The busiest markets (by volume) are kept. Order book, history and trade rows follow the markets returned. |
| `proxyConfiguration` | no | object | `{"useApifyProxy": false}` | Optional and off by default: Kalshi and Polymarket are public, keyless APIs. |

### Pricing (Pay Per Event)

You pay per result (`market`) — **no charge for empty runs**. Example: **5 markets** at *$0.0012/result* ≈ **$0.006**.

$0.0012 per market and per order book, $0.0008 per price point and per trade, no start fee. The example input (fed rate, both venues, order book and a week of hourly history for 5 markets) is roughly 5 markets + 5 books + about 840 hourly points: about $0.68. 'Maximum markets' caps the run (default 20); each market's points and trades are capped per market.

### Use cases

- Fed: the busiest Fed rate markets on both venues with the order book and a week of hourly prices. Keyword 'fed rate', order book and history on.
- Bitcoin: price, 24h change and rules of every Bitcoin market, by volume. Keyword 'bitcoin', venue both.
- Depth before a trade: the full yes ladder of one market. Ticker KXFED-26DEC-T2.75, order book on.
- Backtest: 30 days of hourly prices and the trades of a Polymarket market. Slug or link, history 30 days, trades on.
- Hurricane and weather markets: keyword 'hurricane' or 'temperature' with 24h change, to see what moved overnight.
- Cross-venue check: the same question on both venues, one row each, with 24h change and spread side by side.

### Why this actor

- Both venues in one row shape, including the order book, which neither venue publishes in the same form.
- Four row types priced separately, so a market snapshot costs a market row and nothing else.
- 24h change, spread, mid and depth are computed for you.
- Keyword, ticker, slug or link: any of them finds the market.
- Free marker rows when something stops the run: a venue that did not answer, a cap reached, nothing matched.
- $0.0012 a market row; history points and trades at $0.0008.

### Limitations & updates

Reads the markets you name: a keyword search reaches the busiest 20 markets by default (up to 2,000 with 'Maximum markets') and, on Kalshi, up to 40 matching series. It does not sweep a whole exchange; use the Prediction Market Odds Scraper for that. Kalshi history starts when the market opened; trades are capped per market. Prices are the venues' own and nothing is modelled. Public market data only and not investment advice.

### FAQ

**How is the order book the same on both venues?**

Both come out as bids and asks of the YES contract, best price first. Polymarket publishes bids and asks directly. Kalshi publishes only bids, on the yes side and on the no side; a no bid at 0.005 is a yes ask at 0.995, so the actor converts them. Depth is the contracts resting on each side.

**How do keywords find Kalshi markets?**

Kalshi has no keyword search endpoint, so the actor searches the titles of Kalshi's series for your words and reads the open markets of up to 40 matching series, shortest title first. If no title holds all your words it falls back to the series matching the most of them. For an exact market use a ticker: a series (KXFED), an event (KXFED-26DEC) or a market (KXFED-26DEC-T2.75). Polymarket keywords use Polymarket's own search.

**What is price_change_24h?**

Polymarket's own one-day price change. For Kalshi it is the last price minus the market's previous_price, which Kalshi sets to the price a day earlier; it is empty on a market that opened today.

**How far back does the history go?**

Set 'History: days back' (default 7). Hourly points come in 14-day windows joined together on Polymarket, where one request cannot cover more; daily points come from the market's whole history, cut to your window. 'Points per market' (default 500) keeps the most recent points.

**Why does a Kalshi point sometimes repeat the last price?**

A candle for an hour with no trade has no price of its own. The row carries the previous price forward and shows volume 0, so a chart has no gaps.

**What do trades look like on each venue?**

Kalshi rows give the yes and no price, the size and the taker's side. Polymarket rows give the price, size, buy or sell and which outcome (Yes or No) was traded, plus the transaction hash. No trader identities are returned.

**Do I need an account or a proxy?**

No. Both venues are public, keyless APIs. The proxy input is off by default.

### Which actor to choose

Other Actors in the portfolio that pair with this one:

- **Kalshi & Polymarket Prediction Market Odds Scraper** — You want today's odds across every market on both venues, not a few named markets.
- **Kalshi & Polymarket Election Odds History Scraper** — The history you want is a whole election race, from listing to result.
- **Kalshi Weather Markets with NWS Forecast & Settlement** — The markets are temperature and rain brackets and you want the National Weather Service forecast beside the price.

### Guides & use cases

Written up on **[scrapebench.dev](https://scrapebench.dev)** — the bench that runs and verifies this actor against the live source every night:

- **How-to:** [How to run Kalshi & Polymarket Order Book, 24h Change & Price History](https://scrapebench.dev/guides/how-to-kalshi-polymarket-orderbook-history-scraper/)
- **Use case:** [Fed Rate Markets: Order Book and 7-Day Price History](https://scrapebench.dev/use-cases/fed-rate-markets-orderbook-and-history/)

More actors, coverage and nightly verification results: **[scrapebench.dev](https://scrapebench.dev)**

### Works with AI assistants (MCP)

Callable as an MCP tool, so Claude, Cursor, VS Code Copilot and other MCP clients can run it directly. Grab the config from the [MCP tab](https://apify.com/scrapebench/kalshi-polymarket-orderbook-history-scraper/api/mcp) on this page — Apify hosts the server and keeps that snippet current, and OAuth signs you in on first connect, so no API token goes in your config file.

Then just ask:

> "Show me the Fed rate markets on Kalshi and Polymarket with their 24h change, the order book and a week of hourly prices."

The keyword 'fed rate' with the order book and history on returned markets from both venues on 2026-11-16. Add a Kalshi ticker such as KXFED-26DEC-T2.75 for one exact market. Runs started this way bill exactly like any other run.

### Data & lawful use

This actor collects publicly available information that Kalshi or Polymarket publishes for public
lookup — licence records, business listings and the contact details professionals list there.
Some of it identifies individuals (sole proprietors, licence holders, agents), so treat any
names, phone numbers and emails in your results as personal data.

When you run this actor, you decide what is collected and what it is used for, so you are the
controller of that data and we act only as your processor (Apify Standard Actor Contract).
You need a lawful basis for your use, must honour opt-out and deletion requests, and must
follow the marketing rules that apply to you (CAN-SPAM, TCPA, GDPR, CCPA and similar).
Don't use the output for unsolicited bulk messaging, for screening covered by the FCRA, or
for anything the source's own terms forbid.

Your results are stored in your own Apify account. We don't keep a copy of your results and
don't sell or share them.

### Disclaimer

This is an independent tool. It is not affiliated with, endorsed by or sponsored by
Kalshi or Polymarket. Names and marks are used only to describe the data source. Records are
provided as published by the source and may be out of date or incomplete. For anything
consequential (hiring, a permit, a legal decision), confirm the record with the issuing
agency. You are responsible for making sure your use complies with applicable law and the
source's terms.

### Need help?

Open an issue on this actor's **Issues** tab and we'll respond there. Bug reports, missing
fields and feature requests are all welcome. Guides and examples: [scrapebench.dev](https://scrapebench.dev).

If you are a person named in this data and want your record removed from our copy, email
apify-help@scrapebench.dev; the source agency remains the official record.

Your run may be used to improve our services. If something looks off, or you want this actor to fit your use better, please share your run data with us: [Apify Console → Settings → Security → Share run data with developers](https://console.apify.com/settings/security). It lets us see exactly what went wrong and keep improving the actor.

If this actor saved you time, a short review on its Store page helps other buyers find it.

# Actor input Schema

## `queries` (type: `array`):

Find markets by words: 'fed rate', 'bitcoin', 'hurricane', 'temperature'. Kalshi is matched on its series titles, Polymarket through its own search. Use tickers for an exact market.

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

One keyword. Kept alongside 'Keywords' for saved tasks and API callers.

## `tickers` (type: `array`):

Exact Kalshi markets: a series (KXFED), an event (KXFED-26DEC) or a single market (KXFED-26DEC-T2.75).

## `polymarketSlugs` (type: `array`):

Exact Polymarket markets or events: a slug ('will-bitcoin-reach-100k-in-november-2026') or the polymarket.com link.

## `venue` (type: `string`):

Where keywords are searched: Kalshi, Polymarket or both. Tickers and slugs always go to their own venue.

## `includeOrderbook` (type: `boolean`):

One row per market with every resting bid and ask of the YES contract, best first, in the same shape on both venues. Billed per row.

## `includeHistory` (type: `boolean`):

One row per point: price, and on Kalshi open/high/low, volume, open interest and bid/ask. Billed per point.

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

How far back the price history reaches.

## `historyInterval` (type: `string`):

One point per hour or per day.

## `maxHistoryPoints` (type: `integer`):

Cap per market; the most recent points are kept.

## `includeTrades` (type: `boolean`):

One row per trade: time, price, size and side. Billed per trade.

## `maxTrades` (type: `integer`):

Cap per market, newest first.

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

Also read settled markets, with their result. Off = open markets only.

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

Cap on markets for the whole run: your spend control. The busiest markets (by volume) are kept. Order book, history and trade rows follow the markets returned.

## `proxyConfiguration` (type: `object`):

Optional and off by default: Kalshi and Polymarket are public, keyless APIs.

## Actor input object example

```json
{
  "queries": [
    "fed rate"
  ],
  "tickers": [],
  "polymarketSlugs": [],
  "venue": "both",
  "includeOrderbook": false,
  "includeHistory": false,
  "historyDays": 7,
  "historyInterval": "hourly",
  "maxHistoryPoints": 500,
  "includeTrades": false,
  "maxTrades": 100,
  "includeClosed": false,
  "maxMarkets": 20,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

One row per market: prices, bid/ask, 24h change, volume, rules.

## `history` (type: `string`):

One row per market per hour or day.

# 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 = {
    "queries": [
        "fed rate"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapebench/kalshi-polymarket-orderbook-history-scraper").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 = { "queries": ["fed rate"] }

# Run the Actor and wait for it to finish
run = client.actor("scrapebench/kalshi-polymarket-orderbook-history-scraper").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 '{
  "queries": [
    "fed rate"
  ]
}' |
apify call scrapebench/kalshi-polymarket-orderbook-history-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scrapebench/kalshi-polymarket-orderbook-history-scraper"
        }
    }
}
```

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/8oCNH3soYrga4Wy3f/builds/cFGykwiaSq3K3ImgY/openapi.json
