# Kalshi Market History (Candlesticks) Scraper (`literate_universe/kalshi-market-history`) Actor

Download historical OHLC price candlesticks, volume and open interest for any Kalshi markets - election odds, politics, crypto, sports, weather - by ticker or series, at 1-minute, 1-hour or 1-day resolution. For backtesting and research. Public API, no login.

- **URL**: https://apify.com/literate\_universe/kalshi-market-history.md
- **Developed by:** [John Rutherford](https://apify.com/literate_universe) (community)
- **Stats:** 2 total users, 1 monthly users, 83.3% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.20 / 1,000 candles

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?

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

## Kalshi Market History (Candlesticks) Scraper

Download **historical price candles for Kalshi markets**: open, high, low, close, best bid/ask at close, volume and open interest, at 1-minute, 1-hour or 1-day resolution. Built for backtesting, research and charting. No login, no API key.

Give it market tickers, or a series ticker and it fetches every market in the series.

### What you get

One row per candle per market:

| Field | Meaning |
|---|---|
| `ticker`, `series_ticker`, `title`, `subtitle` | Market identity |
| `period_minutes`, `time` | Candle size and end time (ISO) |
| `open`, `high`, `low`, `close` | YES price in dollars (0 to 1) |
| `yes_bid_close`, `yes_ask_close` | Best bid and ask at candle close |
| `volume`, `open_interest` | Contracts |

Sample row:

```json
{
  "ticker": "KXBTCD-26SEP1017-T85999.99",
  "series_ticker": "KXBTCD",
  "period_minutes": 60,
  "time": "2026-09-10T15:00:00.000Z",
  "open": 0.41,
  "high": 0.47,
  "low": 0.38,
  "close": 0.45,
  "volume": 12840,
  "open_interest": 33120
}
```

### Input

| Option | Default | What it does |
|---|---|---|
| **Market tickers** | | Exact markets to fetch |
| **Series ticker** | | Or every market in a series, e.g. `KXBTCD` |
| **Which markets in the series** | open | open, closed, settled or all |
| **Candle size** | 1 hour | 1 minute, 1 hour or 1 day |
| **Days back** | 30 | Window ending now |
| **Start / End date** | | Explicit ISO window instead |
| **Max markets** | 50 | Cap on markets from a series |
| **Max candles** | 100000 | Cap on rows |

Tip: to build a full history of a series, run with **Which markets = settled** and a long window.

### Pricing

Pay per event: one small charge per candle row. A 30-day hourly window is about 720 rows per market.

### Notes and limits

- Kalshi returns candles only for periods where the market existed. Short-lived markets return short series.
- 1-minute candles over long windows are large. Cap with **Max candles** or narrow the dates.
- This Actor never places orders and needs no Kalshi credentials.

### Related

- Kalshi Markets Scraper: current prices, volume, open interest and order books for every market.
- Polymarket vs Kalshi Matched Markets: same question on both venues with the price gap.

# Actor input Schema

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

Specific market tickers, e.g. KXBTCD-26SEP0913-T87299.99. Leave empty to use a series instead.

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

Fetch history for markets in this series, e.g. KXBTCD (Bitcoin hourly), KXHIGHNY, KXNBAGAME. Used when tickers is empty.

## `marketStatus` (type: `string`):

Only used with a series ticker.

## `periodMinutes` (type: `integer`):

Candle period in minutes. Allowed: 1, 60 or 1440 (anything else falls back to 60).

## `daysBack` (type: `integer`):

History window ending now (ignored if start and end dates are set).

## `startDate` (type: `string`):

Optional, e.g. 2026-01-01T00:00:00Z.

## `endDate` (type: `string`):

Optional, defaults to now.

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

Cap on the number of markets fetched from a series.

## `maxItems` (type: `integer`):

Stop after this many candle rows in total.

## Actor input object example

```json
{
  "seriesTicker": "KXBTCD",
  "marketStatus": "settled",
  "periodMinutes": 60,
  "daysBack": 7,
  "maxMarkets": 50,
  "maxItems": 100000
}
```

# Actor output Schema

## `candles` (type: `string`):

One row per candle per market. Append ?format=csv for CSV.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("literate_universe/kalshi-market-history").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("literate_universe/kalshi-market-history").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 '{}' |
apify call literate_universe/kalshi-market-history --silent --output-dataset

```

## MCP server setup

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

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/C3Dp8JLf6cod4PM7o/builds/4dRqnUCnhMDaWJ5sB/openapi.json
