# Prediction Markets Scraper - Kalshi & Polymarket (`kmscrape/prediction-markets-scraper`) Actor

Live Kalshi and Polymarket odds in one clean dataset: prices, implied probability, 24h and total volume, status, close time, optional order books. Most active markets first. No API key.

- **URL**: https://apify.com/kmscrape/prediction-markets-scraper.md
- **Developed by:** [kfir messika](https://apify.com/kmscrape) (community)
- **Categories:** Business, News
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 markets

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

## Prediction Markets Scraper - Kalshi & Polymarket

Collect public market data from Kalshi and Polymarket into one consistent dataset. Market rows include outcome prices as decimals from 0 to 1, implied probability, volume, liquidity, status, timestamps, and direct links. No account or API key is needed for these public endpoints.

### Use cases

- Compare prices and liquidity across prediction markets
- Research market activity and resolution timelines
- Monitor markets for journalism and reporting
- Build arbitrage monitoring workflows (prices are snapshots; this actor does not calculate executable arbitrage)
- Create scheduled data feeds for AI agents and MCP workflows

The default input checks both platforms and returns up to 20 markets, suitable for a run every few minutes. Larger runs can return up to 10,000 market rows.

### Input

```json
{
  "platforms": ["kalshi", "polymarket"],
  "search": "election",
  "status": "open",
  "category": "politics",
  "minVolumeUsd": 100,
  "maxMarkets": 20,
  "includeOrderbook": false,
  "includeComboMarkets": false
}
```

`search` matches title and question text. `category` is a keyword filter: Polymarket is matched against its reported category/tags; Kalshi is matched against any available category, series, ticker, and title text. `status` accepts `open`, `closed`, or `all`. Markets are split evenly between selected platforms when the maximum is reached. The actor scans up to ten Kalshi pages and three Polymarket pages, then sorts by 24-hour volume and total volume before selecting rows. Kalshi multivariate combo markets are excluded by default; set `includeComboMarkets` to `true` to include them. `includeOrderbook` retrieves the Kalshi market book or Polymarket CLOB books when token IDs are available and can make runs slower.

### Output

Every market is one charged `type: "market"` row in the unified schema. Summary and error rows are free. `yesPrice` and `noPrice` represent the yes/no contract prices when the exchange reports those outcomes; for Polymarket two-outcome markets with named outcomes, they reflect the first and second outcomes respectively. Multi-outcome markets keep all prices in `outcomes`.

Trimmed live Polymarket response example:

```json
{"type":"market","platform":"polymarket","marketId":"4884516","eventId":"663131","title":"Spread: Vancouver Whitecaps FC (-4.5)","question":"Spread: Vancouver Whitecaps FC (-4.5)","category":null,"outcomes":[{"name":"Vancouver Whitecaps FC","price":0.07,"probability":0.07},{"name":"Chicago Fire FC","price":0.93,"probability":0.93}],"yesPrice":0.07,"noPrice":0.93,"impliedProbability":0.07,"volumeUsd":9.99975,"volume24hUsd":null,"liquidityUsd":1751.0014,"openInterest":null,"status":"open","openTime":"2026-09-23T17:00:37Z","closeTime":"2026-10-07T00:30:00Z","resolution":"https://www.mlssoccer.com/schedule/scores","url":"https://polymarket.com/event/mls-chi-vwh-2026-07-16-spread-away-4pt5","scrapedAt":"2026-10-04T00:00:00.000Z"}
```

The Polymarket example uses prices from a live Gamma API response; `scrapedAt` is illustrative. Kalshi values are normalized from the public Trade API, including its floating point volume fields. Fields unavailable from a source are `null`.

### Pricing

**$1.00 per 1,000 market rows**, charged through Apify pay-per-event event `market-result`. Summary and error rows are free. The actor works locally when pay-per-event pricing is not configured.

### Limits and data notes

- Public Kalshi Trade API and Polymarket Gamma API endpoints are paginated; requests have 20-second timeouts and retry 429 and 5xx responses with exponential backoff.
- Requests are sequential and spaced between pages. Optional orderbook collection makes additional sequential calls.
- The requested maximum is shared across the selected platforms and split evenly when both are selected.
- Exchange fields can be missing, delayed, or updated between requests. Volume and liquidity are the values reported by each source and may not be directly comparable.
- Prices and implied probabilities are quotes, not guarantees of execution or forecasts. Binary price conversions use 0-1 decimals.
- Kalshi's public market object does not always include a category or liquidity value. In that case these output fields are null; category keyword filtering can also match ticker and title text.

### FAQ

**Do I need an API key?** No. This version uses public endpoints.

**Can it run on a schedule?** Yes. Set an Apify schedule to run every N minutes and consume the resulting dataset.

**Can I get order books?** Set `includeOrderbook` to `true`. Books are fetched per market where a public endpoint and token identifier are available.

**Are summaries charged?** No. Only `market` rows use the `market-result` charge event.

# Actor input Schema

## `platforms` (type: `array`):

Prediction market platforms to query. Choose Kalshi, Polymarket, or both.

## `search` (type: `string`):

Optional case-insensitive keyword filter applied to market titles and questions.

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

Return open markets, closed markets, or both statuses.

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

Optional category keyword filter. Polymarket uses its category field; Kalshi uses available category, series, ticker, and title text.

## `minVolumeUsd` (type: `number`):

Only include markets whose reported total volume is at least this USD amount.

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

Maximum number of market rows across all selected platforms.

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

Fetch a public order book for each market when the source provides a supported endpoint.

## `includeComboMarkets` (type: `boolean`):

Include Kalshi multivariate combo markets. Excluded by default because they often have no activity or meaningful price.

## Actor input object example

```json
{
  "platforms": [
    "kalshi",
    "polymarket"
  ],
  "search": "",
  "status": "open",
  "category": "",
  "minVolumeUsd": 0,
  "maxMarkets": 20,
  "includeOrderbook": false,
  "includeComboMarkets": false
}
```

# Actor output Schema

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

// Run the Actor and wait for it to finish
const run = await client.actor("kmscrape/prediction-markets-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("kmscrape/prediction-markets-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 '{}' |
apify call kmscrape/prediction-markets-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,kmscrape/prediction-markets-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/klUVChR6LowiRrTs4/builds/agJTGDe3MhquYXsp8/openapi.json
