# Kalshi Market Monitor (`barefoot_grade/kalshi-market-monitor`) Actor

Monitor live Kalshi prediction markets in one run: yes/no prices, bid-ask spreads, volume, liquidity and open interest, plus close dates and market status. Filter by status, series or event prefix and a creation window. Every run returns a fresh full-board snapshot; no account is needed.

- **URL**: https://apify.com/barefoot_grade/kalshi-market-monitor.md
- **Developed by:** [Philip Kirkbride](https://apify.com/barefoot_grade) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.40 / 1,000 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 Monitor

### Quick Start

Collect current Kalshi prediction markets with prices, status, timing, volume, and liquidity.
Use it for market research, monitoring, or downstream comparison with another prediction-market feed.
Start with this minimal input:

```json
{"maxMarkets": 200, "status": "open"}
```

Every run returns a fresh snapshot of the live board and needs no account.

### Input

| Name | Type | Default | What it does |
| --- | --- | --- | --- |
| `status` | string | `open` | Selects the market lifecycle state. |
| `seriesTicker` | string | empty | Limits results to one series. |
| `eventTickerPrefix` | string | empty | Keeps events beginning with this prefix. |
| `lookbackHours` | integer | `168` | Keeps recently created markets; `0` disables the window. |
| `pageSize` | integer | `100` | Number of markets requested per page. |
| `maxMarkets` | integer | `200` | Maximum records returned. |
| `maxPages` | integer | `6` | Maximum pages read. |
| `crossVenueMap` | object | `{}` | Adds an optional external market match. |
| `telegramChatId` | string | empty | Sends an optional digest when a Telegram bot is configured. |
| `alertMinUsd` | number | `1000` | Volume threshold for digest alerts. |
| `requestDelaySecs` | number | `0.25` | Pause between requests. |

### Output

Each dataset record includes `ticker`, `eventTicker`, `question`, `status`, `active`, `closed`, `openTime`, `closeTime`, `createdTime`, `lastPrice`, bid/ask fields, `outcomes`, `volume`, `volume24h`, `liquidity`, `openInterest`, and `crossVenue`.

```json
{"ticker":"KXBTCD-26SEP0712","question":"Bitcoin price...","status":"active","active":true,"closed":false,"lastPrice":0.52,"outcomes":[{"side":"yes","price":0.52}],"volume":12500}
```

### FAQ

**How fresh is the data?** Each run reads the current public market board.

**How many markets can I collect?** Set `maxMarkets` up to 2,000 and `maxPages` up to 30.

**Can I limit the scope?** Yes. Use `seriesTicker`, `eventTickerPrefix`, status, or the creation-time window.

**What happens if a value is unavailable?** It is returned as `null` rather than guessed.

For support, contact Apify support and include the Actor run ID.

# Actor input Schema

## `status` (type: `string`):

Status filter, one of unopened | open | closed | settled. 'all' or empty includes every status.

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

Exact Kalshi series ticker, for example KXBTCD (the whole Bitcoin price ladder) or KXETHD (Ethereum). Narrow a run to one market family. Empty disables.

## `eventTickerPrefix` (type: `string`):

Keep only markets whose event ticker starts with this prefix, case-insensitive. Empty disables.

## `lookbackHours` (type: `integer`):

Keep only markets created within this many hours (0..336; 0 disables the window). A market without a published creation time is skipped while the window is on.

## `pageSize` (type: `integer`):

Rows requested per page (1..1000).

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

Maximum market records returned after filters.

## `maxPages` (type: `integer`):

Maximum pages fetched per run.

## `crossVenueMap` (type: `object`):

Optional map of Kalshi market ticker OR event ticker -> Polymarket slug/conditionId (string -> string, up to 500 entries). Matching rows carry a crossVenue object (venue, matchedKey, polymarketId) — the join surface for the PK x Kalshi arb monitor. Both key forms are tried, market ticker first.

## `telegramChatId` (type: `string`):

Optional Telegram chat id for the digest (cross-venue pairs and markets with volume at or above alertMinUsd). Requires a Telegram bot to be configured. A failed or skipped send is a warning, never a failed run.

## `alertMinUsd` (type: `number`):

Markets with total volume at or above this USD value go into the Telegram digest (when configured); cross-venue pairs are always alerted regardless of volume.

## `requestDelaySecs` (type: `number`):

Pause between requests.

## Actor input object example

```json
{
  "status": "open",
  "lookbackHours": 168,
  "pageSize": 100,
  "maxMarkets": 200,
  "maxPages": 6,
  "crossVenueMap": {},
  "alertMinUsd": 1000,
  "requestDelaySecs": 0.25
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `summary` (type: `string`):

No description

# 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 = {
    "status": "open",
    "seriesTicker": "",
    "eventTickerPrefix": "",
    "lookbackHours": 168,
    "pageSize": 100,
    "maxMarkets": 200,
    "maxPages": 6,
    "crossVenueMap": {},
    "telegramChatId": "",
    "alertMinUsd": 1000,
    "requestDelaySecs": 0.25
};

// Run the Actor and wait for it to finish
const run = await client.actor("barefoot_grade/kalshi-market-monitor").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 = {
    "status": "open",
    "seriesTicker": "",
    "eventTickerPrefix": "",
    "lookbackHours": 168,
    "pageSize": 100,
    "maxMarkets": 200,
    "maxPages": 6,
    "crossVenueMap": {},
    "telegramChatId": "",
    "alertMinUsd": 1000,
    "requestDelaySecs": 0.25,
}

# Run the Actor and wait for it to finish
run = client.actor("barefoot_grade/kalshi-market-monitor").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 '{
  "status": "open",
  "seriesTicker": "",
  "eventTickerPrefix": "",
  "lookbackHours": 168,
  "pageSize": 100,
  "maxMarkets": 200,
  "maxPages": 6,
  "crossVenueMap": {},
  "telegramChatId": "",
  "alertMinUsd": 1000,
  "requestDelaySecs": 0.25
}' |
apify call barefoot_grade/kalshi-market-monitor --silent --output-dataset

```

## MCP server setup

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

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/fU0h3aQA1hZs7dZ1Q/builds/kspvRpfPbtGyfkh4l/openapi.json
