# Kalshi Market Scraper (MCP-ready) (`jovian_zabra_nk5/kalshi-market-scraper`) Actor

Normalized Kalshi prediction-market data from the official trade API: events, live prices, 24h volume, open interest, optional orderbook depth. No login, no proxies. Agent/MCP-friendly JSON.

- **URL**: https://apify.com/jovian_zabra_nk5/kalshi-market-scraper.md
- **Developed by:** [dev bro](https://apify.com/jovian_zabra_nk5) (community)
- **Categories:** Developer tools, AI, Agents
- **Stats:** 2 total users, 1 monthly users, 95.2% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.50 / 1,000 result market records

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 Market Scraper

Get normalized **Kalshi prediction-market data** from its official trade API — events, questions, live prices (last/bid/ask), 24h volume, open interest, close times, and optional **orderbook depth** for top markets. No login, no proxy, no scraping — pure public API.

### Why this Actor

- **Official API, stable output** — Kalshi's public trade API with normalized JSON. No HTML parsing, no anti-bot cat-and-mouse, cheap runs.
- **Prediction markets for agents & quants** — live odds across Politics, Economics, Sports, Crypto, Fed Decisions, Weather and more. Perfect ground truth for LLM agents, arbitrage scanners (Kalshi ↔ Polymarket), and dashboards.
- **Orderbook depth included** — most prediction-market scrapers stop at prices. This one can fetch Kalshi orderbook levels for the top markets by volume.
- **MCP/AI-agent ready** — clean flat JSON records, works great as a tool for AI agents via Apify MCP server.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `maxEvents` | integer | `1000` | How many open events to paginate (1000 ≈ 4-9k markets) |
| `category` | string | `""` (all) | Optional category filter: Politics, Economics, Sports, Crypto, Weather… |
| `minVolume24hUsd` | number | `0` | Skip markets below this 24h volume |
| `maxResults` | integer | `500` | Max records returned (top by 24h volume) |
| `includeOrderbook` | boolean | `false` | Fetch orderbook for top markets |
| `orderbookTopN` | integer | `3` | How many top markets get orderbook depth |

```json
{
  "maxEvents": 1000,
  "minVolume24hUsd": 1000,
  "maxResults": 500,
  "includeOrderbook": true,
  "orderbookTopN": 3
}
```

### Output

One JSON record per market, sorted by 24h volume:

```json
{
  "eventTitle": "Will the Fed cut rates at the next meeting?",
  "eventTicker": "KXFEDDECISION-...",
  "category": "Fed Decisions",
  "ticker": "KXFED-...",
  "question": "Will the Fed cut rates?",
  "yesOutcome": "Yes",
  "noOutcome": "No",
  "lastPrice": 0.72,
  "yesBid": 0.71,
  "yesAsk": 0.73,
  "volume24h": 1250000.0,
  "volumeTotal": 45000000.0,
  "openInterest": 8200000.0,
  "closeTime": "2026-11-05T19:00:00Z",
  "status": "active",
  "marketType": "binary",
  "url": "https://kalshi.com/markets/KXFEDDECISION",
  "orderbook": {"bidLevels": 5, "askLevels": 4, "bestBid": 0.71, "bestAsk": 0.73}
}
```

### Use cases

- **Kalshi ↔ Polymarket arbitrage** — combine with our Polymarket Market Scraper to find cross-venue price gaps
- **Election / macro dashboards** — live odds feeds without API keys
- **AI agents** — prediction-market ground truth via MCP
- **Research** — market-implied probabilities over time

### Pricing

Pay per result: **$1.50 per 1,000 market records** ($0.0015/record). Compute is included — runs are cheap (API-only, no proxies).

### Notes

- Data comes from Kalshi's official public trade API (`api.elections.kalshi.com`). Respects rate limits with small delays.
- Prices are in dollars (0.00–1.00 = implied probability).
- If Kalshi changes its API, the Actor is actively maintained — issues welcome.

# Actor input Schema

## `maxEvents` (type: `integer`):

How many open events to paginate through (each event may contain several markets; 1000 events ≈ 5 pages ≈ 4-9k markets). Raise for full-catalog coverage.

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

Optional Kalshi category filter (e.g. Politics, Economics, Sports, Crypto, Weather). Empty = all categories.

## `minVolume24hUsd` (type: `number`):

Skip markets with 24h volume below this value. 0 = no filter.

## `maxResults` (type: `integer`):

Maximum number of market records returned (top by 24h volume after filtering).

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

Fetch Kalshi orderbook (best bid/ask, depth levels) for the top markets by 24h volume.

## `orderbookTopN` (type: `integer`):

Number of top markets (by 24h volume) to fetch orderbook depth for.

## Actor input object example

```json
{
  "maxEvents": 1000,
  "minVolume24hUsd": 0,
  "maxResults": 500,
  "includeOrderbook": false,
  "orderbookTopN": 3
}
```

# Actor output Schema

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

One record per active Kalshi market, sorted by 24h volume, with prices, volume, open interest and (optionally) orderbook depth.

# 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 = {
    "maxEvents": 1000,
    "category": "",
    "minVolume24hUsd": 0,
    "maxResults": 500,
    "includeOrderbook": false,
    "orderbookTopN": 3
};

// Run the Actor and wait for it to finish
const run = await client.actor("jovian_zabra_nk5/kalshi-market-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 = {
    "maxEvents": 1000,
    "category": "",
    "minVolume24hUsd": 0,
    "maxResults": 500,
    "includeOrderbook": False,
    "orderbookTopN": 3,
}

# Run the Actor and wait for it to finish
run = client.actor("jovian_zabra_nk5/kalshi-market-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 '{
  "maxEvents": 1000,
  "category": "",
  "minVolume24hUsd": 0,
  "maxResults": 500,
  "includeOrderbook": false,
  "orderbookTopN": 3
}' |
apify call jovian_zabra_nk5/kalshi-market-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,jovian_zabra_nk5/kalshi-market-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/0Z1cAc3fhg8IjlSYG/builds/gF1xw7jthp2TPy0ir/openapi.json
