# Kalshi Sports Markets (`barefoot_grade/kalshi-sports`) Actor

Track live Kalshi sports markets in one run: game lines, spreads, totals and prices, with the event, league, market type, line, yes/no prices, volume and liquidity per record. Source identifiers are preserved for cross-book comparison, and every run returns a fresh full-board snapshot.

- **URL**: https://apify.com/barefoot_grade/kalshi-sports.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 Sports Markets

### Quick Start

Collect normalized Kalshi sports markets with fixture context, market types, prices, and status.
Use it for sports market research, dashboards, and scheduled snapshots.
Start with this minimal input:

```json
{"seriesTickers":["KXEPLGAME"],"maxResults":250}
```

Every run returns a fresh full-board snapshot and needs no account.

### Input

| Name | Type | Default | What it does |
| --- | --- | --- | --- |
| `mode` | string | `markets` | Collects markets or discovers series names. |
| `seriesTickers` | array | `[]` | Limits collection to selected sports series. |
| `eventTicker` | string | empty | Limits collection to one event. |
| `statusFilter` | string | `open` | Selects market lifecycle state. |
| `minCloseTs` / `maxCloseTs` | integer | `0` / `1893456000` | Limits close times. |
| `pageSize` | integer | `200` | Markets requested per page. |
| `maxResults` | integer | `500` | Maximum market records. |
| `includeEventContext` | boolean | `true` | Adds parent event and league details. |
| `includeOrderbook` | boolean | `false` | Adds top-of-book details when available. |
| `includeRaw` | boolean | `false` | Retains source objects. |
| `requestDelaySecs` | number | `0.25` | Pause between requests. |

### Output

Each market record includes `ticker`, event and series context, `marketType`, lines, outcomes, prices, volume, liquidity, `orderbook`, and `canonical`.

```json
{"recordKey":"kalshi:KXEPLGAME-26SEP06EVEMUN","ticker":"KXEPLGAME-26SEP06EVEMUN","marketType":"spreads","status":"active","outcomes":[{"label":"Yes","price":0.55}],"orderbook":null}
```

### FAQ

**How fresh is the data?** Every run returns the current sports market board.

**What is the default scope?** Empty input uses currently available default sports series; explicit series or event filters take precedence.

**Can I discover valid series?** Set `mode` to `discover`, then use returned series tickers in a collection run.

**What happens when enrichment is unavailable?** The market remains in the dataset and the unavailable enrichment is `null` with a warning.

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

# Actor input Schema

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

markets collects market records; discover lists the valid series ticker values (read-only) that the Series tickers filter accepts. Copy seriesTicker from discovery rows into seriesTickers for collection runs.

## `seriesTickers` (type: `array`):

Optional Kalshi series tickers, for example KXEPLGAME or KXMLB. Each series is paged independently and rows are de-duplicated by ticker. Empty (with no eventTicker) uses the default sports scope (KXEPLGAME, KXNBAGAME) and fails clearly if none of them is available. In discover mode this scopes the listing, which verifies whether the values are valid.

## `eventTicker` (type: `string`):

Optional exact Kalshi event ticker for one fixture, for example KXEPLGAME-26SEP06EVEMUN.

## `statusFilter` (type: `string`):

Kalshi market status filter. open (default) matches tradable markets; all includes every status.

## `minCloseTs` (type: `integer`):

Optional Unix-seconds lower bound on market close time.

## `maxCloseTs` (type: `integer`):

Optional Unix-seconds upper bound on market close time.

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

Kalshi page size; its documented maximum is 1000.

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

Global cap after filters and series de-duplication. Unsupported multi-event combo shards are excluded before this budget, so it counts only useful fixture markets.

## `includeEventContext` (type: `boolean`):

Enrich rows with the parent event's title and league. A failed enrichment degrades to a warning, never a failed run.

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

Enrich rows with top-of-book bids (one request per market, bounded by maxResults). If enrichment is unavailable, it stops, rows keep a null orderbook and the run still succeeds with a warning.

## `includeRaw` (type: `boolean`):

Embed each original Kalshi market object for debugging.

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

Pause between requests.

## Actor input object example

```json
{
  "mode": "markets",
  "seriesTickers": [],
  "statusFilter": "open",
  "maxCloseTs": 1893456000,
  "pageSize": 200,
  "maxResults": 500,
  "includeEventContext": true,
  "includeOrderbook": false,
  "includeRaw": false,
  "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 = {
    "mode": "markets",
    "seriesTickers": [],
    "eventTicker": "",
    "statusFilter": "open",
    "minCloseTs": 0,
    "maxCloseTs": 1893456000,
    "pageSize": 200,
    "maxResults": 500,
    "includeEventContext": true,
    "includeOrderbook": false,
    "includeRaw": false,
    "requestDelaySecs": 0.25
};

// Run the Actor and wait for it to finish
const run = await client.actor("barefoot_grade/kalshi-sports").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 = {
    "mode": "markets",
    "seriesTickers": [],
    "eventTicker": "",
    "statusFilter": "open",
    "minCloseTs": 0,
    "maxCloseTs": 1893456000,
    "pageSize": 200,
    "maxResults": 500,
    "includeEventContext": True,
    "includeOrderbook": False,
    "includeRaw": False,
    "requestDelaySecs": 0.25,
}

# Run the Actor and wait for it to finish
run = client.actor("barefoot_grade/kalshi-sports").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 '{
  "mode": "markets",
  "seriesTickers": [],
  "eventTicker": "",
  "statusFilter": "open",
  "minCloseTs": 0,
  "maxCloseTs": 1893456000,
  "pageSize": 200,
  "maxResults": 500,
  "includeEventContext": true,
  "includeOrderbook": false,
  "includeRaw": false,
  "requestDelaySecs": 0.25
}' |
apify call barefoot_grade/kalshi-sports --silent --output-dataset

```

## MCP server setup

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

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/GQB3dxmE5CWX9OUny/builds/BgirFTD4fafVARzMB/openapi.json
