# Prediction Markets Scraper — Kalshi + Polymarket odds & volume (`scraper0917/prediction-markets-scraper`) Actor

Every open Kalshi and Polymarket market in one normalized feed: question, YES/NO price, bid/ask, spread, 24h volume, liquidity, open interest, close time, category, resolution rules, links. Optional order-book depth. Filter by text, category, volume, close time. No login, no proxies.

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

## Pricing

from $2.00 / 1,000 results

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

## Prediction Markets Scraper — Kalshi + Polymarket

One normalized feed of prediction-market data from the two largest venues. Every item has the same fields whether it came from Kalshi or Polymarket, so you can compare odds, spreads, volume and close times across exchanges without writing two parsers.

- **Kalshi** — every open (or closed / settled) market via the public trade API: YES/NO bid and ask with sizes, last price, previous price, 24h and lifetime volume, open interest, liquidity, open/close/expiration times, resolution rules, category.
- **Polymarket** — every active (or resolved) market via the public Gamma API: outcome prices, best bid/ask, spread, last trade, 24h / 1w / lifetime USD volume, liquidity, tags, neg-risk flag, images, CLOB token ids.
- **Order books** (optional) — top-N YES bids and asks with sizes from each venue's live book.
- **Filters** — text search, category/tag, status, min 24h volume, min liquidity, closing-within-N-hours, specific Kalshi series or Polymarket tags.
- **No login, no proxies, no browser.** Both venues publish this data openly; the Actor reads it politely with retries and backoff.

### Example output

```json
{
  "venue": "polymarket",
  "title": "Will the Fed decrease interest rates by 25 bps after the September 2026 meeting?",
  "subtitle": "25 bps decrease",
  "eventTitle": "Fed Decision in September?",
  "category": "fomc",
  "tags": ["fomc", "Economic Policy", "Fed Rates", "Politics", "Economy"],
  "status": "open",
  "yesPrice": 0.0035, "noPrice": 0.9965,
  "yesBid": 0.003, "yesAsk": 0.004, "spread": 0.001,
  "volume24h": 5239468.07, "volume": 29217587.62, "volumeUnit": "usd",
  "liquidity": 4433986.18,
  "closeTime": "2026-09-16T00:00:00Z",
  "url": "https://polymarket.com/event/fed-decision-in-september-762/will-the-fed-decrease-interest-rates-by-25-bps-after-the-september-2026-meeting-586",
  "orderbook": { "yesBids": [{ "price": 0.003, "size": 41200 }], "yesAsks": [{ "price": 0.004, "size": 18750 }] }
}
```

Kalshi items carry the same keys plus `seriesId`, `openInterest`, `yesBidSize`/`yesAskSize`, `canCloseEarly`, `expectedExpirationTime` and `result` (`yes`/`no` once settled). Kalshi volume is reported in **contracts** (`volumeUnit: "contracts"`), Polymarket in **USD** — the field tells you which.

### Input

| Field | Default | Notes |
|---|---|---|
| `venues` | both | `kalshi`, `polymarket` |
| `search` | — | substring match on title / subtitle / event title |
| `categories` | — | Kalshi categories (`Politics`, `Economics`, `Sports`, …) or Polymarket tag labels (`Crypto`, `Pop Culture`, …) |
| `status` | `open` | `open`, `closed`, `settled`, `all` |
| `minVolume24h`, `minLiquidity` | 0 | numeric floors |
| `closingWithinHours` | — | only markets closing in the next N hours |
| `maxMarketsPerVenue` | 500 | 0 = everything (~10k Kalshi, ~5k Polymarket) |
| `includeOrderbook` / `orderbookDepth` | off / 5 | one extra request per market |
| `kalshiSeriesTickers` | — | e.g. `KXBTC`, `KXFED`, `KXHIGHNY` |
| `polymarketTags` | — | tag slugs, e.g. `crypto`, `fomc`, `nfl` |

### Typical uses

- **Cross-venue odds comparison** — run with a `search` term and both venues, sort by `yesPrice`.
- **Volume/liquidity screens** — `minVolume24h: 100000` on Polymarket, `minLiquidity: 10000` on Kalshi.
- **Expiry watch** — `closingWithinHours: 24` on a schedule, feed the dataset into Sheets or a webhook.
- **Order-book snapshots** — `includeOrderbook: true` with a series filter, on a 5-minute schedule, for a depth history.
- **Research datasets** — `status: settled`, `maxMarketsPerVenue: 0`, for resolved outcomes with final prices.

### Notes

- Polymarket is read in descending 24h-volume order, so a cap keeps the liquid markets. Kalshi is read in exchange order; use `kalshiSeriesTickers` or `categories` to target.
- Polymarket `result` is inferred from final outcome prices on closed markets; Kalshi `result` is the exchange's own settlement value.
- Kalshi web links point at the series page (the exchange rate-limits deep links); `apiUrl` gives the exact market.
- A `SUMMARY` record in the key-value store lists scanned / matched / pushed counts per venue and any API error.

### Pricing

Pay per result. One result = one market (with or without order book). Price is shown on the Actor page; the free trial covers a first run.

### Support

Open an Issue on the Actor page — API shape changes at either venue get fixed fast.

# Actor input Schema

## `venues` (type: `array`):

Which exchanges to read. Both use public, no-login market-data APIs.

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

Keep only markets whose title, subtitle or event title contains this text (case-insensitive). Example: `Fed`, `Bitcoin`, `NFL`.

## `categories` (type: `array`):

Keep only markets whose category or tags match (case-insensitive substring). Kalshi categories: Politics, Economics, Financials, Sports, Science and Technology, Climate and Weather, Entertainment, Companies, World, Health, Social, Elections. Polymarket uses free-form tags such as `Crypto`, `Politics`, `Sports`, `Business`, `Pop Culture`.

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

Which markets to return. Kalshi supports open/closed/settled; Polymarket maps closed and settled to its resolved markets.

## `minVolume24h` (type: `integer`):

Drop markets below this 24-hour volume. Kalshi volume is in contracts, Polymarket in USD (see `volumeUnit` in output).

## `minLiquidity` (type: `integer`):

Drop markets whose quoted liquidity (USD) is below this.

## `closingWithinHours` (type: `integer`):

Keep only markets whose close time is within the next N hours. Leave empty for no limit.

## `maxMarketsPerVenue` (type: `integer`):

Stop after this many matching markets per venue. 0 = no limit (Kalshi has ~10k open markets, Polymarket ~5k). Polymarket is read in descending 24h-volume order, Kalshi in exchange order.

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

Attach the top of the YES order book (bids and asks with sizes) to each market. One extra request per market — slower, use with a sensible cap.

## `orderbookDepth` (type: `integer`):

How many price levels per side to keep when `includeOrderbook` is on.

## `kalshiSeriesTickers` (type: `array`):

Restrict Kalshi to specific series, e.g. `KXBTC`, `KXHIGHNY`, `KXFED`. Leave empty for all.

## `polymarketTags` (type: `array`):

Restrict Polymarket to tag slugs, e.g. `politics`, `crypto`, `sports`, `fomc`. Leave empty for all.

## Actor input object example

```json
{
  "venues": [
    "kalshi",
    "polymarket"
  ],
  "status": "open",
  "minVolume24h": 0,
  "minLiquidity": 0,
  "maxMarketsPerVenue": 500,
  "includeOrderbook": false,
  "orderbookDepth": 5
}
```

# 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 = {
    "venues": [
        "kalshi",
        "polymarket"
    ],
    "search": ""
};

// Run the Actor and wait for it to finish
const run = await client.actor("scraper0917/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 = {
    "venues": [
        "kalshi",
        "polymarket",
    ],
    "search": "",
}

# Run the Actor and wait for it to finish
run = client.actor("scraper0917/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 '{
  "venues": [
    "kalshi",
    "polymarket"
  ],
  "search": ""
}' |
apify call scraper0917/prediction-markets-scraper --silent --output-dataset

```

## MCP server setup

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