# Prediction Market Odds - Polymarket & Kalshi Live Prices (`herbcoder/prediction-market-odds`) Actor

Live odds from Polymarket and Kalshi in one normalized dataset: implied probability, bid/ask, 24h volume, liquidity, open interest, close time, rules and links. Search by keyword, tag or series ticker. Official public APIs, no keys. Pay per market.

- **URL**: https://apify.com/herbcoder/prediction-market-odds.md
- **Developed by:** [HerbCode LLC](https://apify.com/herbcoder) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 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?

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 Market Odds - Polymarket + Kalshi

Live prediction-market prices from **Polymarket** and **Kalshi** in one normalized dataset. Search by keyword, pick a tag or series, or just take the most-traded markets - every row has the question, YES/NO prices (= implied probability), best bid/ask, spread, last trade, 24h and total volume, liquidity, open interest, close time, resolution rules, category/tags and a link back to the market.

Both platforms are read through their **official public market-data APIs** (Polymarket Gamma API, Kalshi Trade API v2 public endpoints). No account, no API key, no proxies, so runs finish in seconds and are reliable.

### What you can do with it

- **Track the odds of anything** - elections, Fed decisions, crypto price levels, sports, weather, entertainment - on a schedule, into a Google Sheet, Slack alert or your own database.
- **Compare platforms** - the same question is often listed on both exchanges at different prices; sort by `question` after a keyword search to spot gaps.
- **Research and journalism** - historical snapshots (run daily; each row carries `fetchedAt`) give you probability time series without trading-API access.
- **AI agents** - give an agent a fast, structured "what does the market think about X?" tool through the Apify MCP server.
- **Trading dashboards** - volume, liquidity and spread are enough to rank where the action is right now.

### Input

| Field | Type | Default | Notes |
|---|---|---|---|
| `platforms` | array | `["polymarket","kalshi"]` | One or both. |
| `query` | string | - | Keyword matched against market/event titles (Polymarket: server-side search; Kalshi: title, subtitle, ticker). Empty = top markets. |
| `maxMarkets` | integer | `200` | Max rows in total. Hard cost cap. |
| `sortBy` | `volume24h` / `volume` / `liquidity` / `closeTime` | `volume24h` | Order before the cap is applied. |
| `minVolume` | number | `0` | Drop thin markets. |
| `minLiquidity` | number | `0` | Drop markets with a thin order book. |
| `closingWithinDays` | integer | `0` | Only markets closing within N days. |
| `includeClosed` | boolean | `false` | Include resolved / closed markets. |
| `includeRules` | boolean | `true` | Add the resolution rules text. |
| `polymarketTags` | array | `[]` | Polymarket tag slugs, e.g. `politics`, `crypto`, `sports`, `fed`. |
| `kalshiSeriesTickers` | array | `[]` | Kalshi series, e.g. `KXHIGHNY`, `KXBTCD`, `KXNFLGAME`. |
| `kalshiEventTickers` | array | `[]` | Kalshi events, e.g. `KXHIGHNY-26SEP22`. |
| `kalshiScanLimit` | integer | `5000` | Open Kalshi markets scanned when no series/event filter is set. |

Example input - everything about Bitcoin on both platforms:

```json
{
    "platforms": ["polymarket", "kalshi"],
    "query": "bitcoin",
    "maxMarkets": 100
}
```

Example input - NYC daily high-temperature markets on Kalshi (a popular weather-trading series):

```json
{
    "platforms": ["kalshi"],
    "kalshiSeriesTickers": ["KXHIGHNY"],
    "sortBy": "closeTime"
}
```

### Output

One dataset item per market (a multi-outcome Polymarket event becomes one row per outcome market; `outcomeLabel` tells you which).

```json
{
    "platform": "polymarket",
    "marketId": "4052420",
    "ticker": "will-bitcoin-reach-87pt5k-in-september-2026",
    "eventTicker": "what-price-will-bitcoin-hit-in-september-2026",
    "eventTitle": "What price will Bitcoin hit in September?",
    "question": "Will Bitcoin reach $87,500 in September?",
    "outcomeLabel": "↑ 87,500",
    "outcomes": [{ "name": "Yes", "price": 0.805 }, { "name": "No", "price": 0.195 }],
    "yesPrice": 0.805,
    "noPrice": 0.195,
    "impliedProbability": 0.805,
    "bestBid": 0.8,
    "bestAsk": 0.81,
    "spread": 0.01,
    "lastTradePrice": 0.805,
    "volume": 539615.28,
    "volume24h": 221463.49,
    "liquidity": 59695.76,
    "openInterest": null,
    "status": "open",
    "openTime": "2026-09-01T05:07:15Z",
    "closeTime": "2026-10-01T04:00:00Z",
    "resolutionSource": null,
    "rules": "This market will immediately resolve to \"Yes\" if any Binance 1 minute candle for BTC/USDT ...",
    "category": null,
    "tags": ["Bitcoin", "Monthly", "Hit Price", "Crypto", "Crypto Prices", "Recurring"],
    "url": "https://polymarket.com/event/what-price-will-bitcoin-hit-in-september-2026/will-bitcoin-reach-87pt5k-in-september-2026",
    "fetchedAt": "2026-09-21T17:05:41.912Z"
}
```

Kalshi rows use the same fields: `marketId`/`ticker` is the Kalshi market ticker, `eventTicker` the event, `tags` holds the series ticker, prices are converted from cents to 0-1, `volume`/`openInterest` are in contracts, `liquidity` in USD.

### Pricing

Pay per event:

| Event | Price | What it means |
|---|---|---|
| Actor start | $0.005 | Once per run. |
| `market-result` | $0.0015 (= $1.50 per 1,000 markets) | One per market written to the dataset. Markets removed by your filters are free. |

A daily snapshot of the top 500 markets on both exchanges costs about $0.76 per run, or ~$23 per month. Comparable single-platform Actors charge $1-10 per 1,000 rows.

### Limits and notes

- Prices are a snapshot at `fetchedAt`; run on a schedule for time series.
- Kalshi has no server-side keyword search. With no `kalshiSeriesTickers` / `kalshiEventTickers`, the Actor scans up to `kalshiScanLimit` open markets and searches locally. For niche topics, pass the series ticker (find it in the Kalshi URL, e.g. `kalshi.com/markets/kxhighny/...`).
- Polymarket `liquidity` can be `null` for markets that have effectively resolved (price at 0 or 1).
- Kalshi `url` points to the series page (Kalshi market URLs need a human-readable slug that the API does not return); use `ticker` with the Kalshi API for exact routing.
- Only public market data is read. No trading, no account, no personal data.

### FAQ

**Why both platforms in one Actor?** Because most questions people ask ("what are the odds of X") do not care which exchange lists it, and price differences between the two are themselves interesting.

**Can I get order-book depth or price history?** Not yet - open an issue if you need it and it will be added as an optional, separately priced event.

# Changelog

This Actor's version history is a separate document: https://apify.com/herbcoder/prediction-market-odds/changelog.md

# Actor input Schema

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

Which exchanges to read.

## `query` (type: `string`):

Keyword matched against market and event titles (e.g. `bitcoin`, `fed`, `election`, `NFL`). Empty = top markets by 24h volume.

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

Maximum rows to return across all platforms. Caps your cost.

## `sortBy` (type: `string`):

Order of the results before the max-markets cap is applied.

## `minVolume` (type: `number`):

Drop markets with total traded volume below this (Polymarket: USD, Kalshi: contracts).

## `minLiquidity` (type: `number`):

Drop markets with less than this much USD in the order book.

## `closingWithinDays` (type: `integer`):

Only markets that close within this many days (0 = no limit).

## `includeClosed` (type: `boolean`):

By default only open markets are returned.

## `includeRules` (type: `boolean`):

Adds the market's resolution rules / description to each row.

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

Restrict Polymarket to event tags, e.g. `politics`, `crypto`, `sports`, `nba`, `fed`. Ignored when a search keyword is set.

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

Restrict Kalshi to series, e.g. `KXHIGHNY` (NYC high temperature), `KXBTC`, `KXNFLGAME`. Much faster than scanning every open market.

## `kalshiEventTickers` (type: `array`):

Restrict Kalshi to specific events, e.g. `KXHIGHNY-26SEP22`.

## `kalshiCategories` (type: `array`):

Restrict Kalshi to event categories: Politics, Elections, Sports, Financials, Economics, Crypto, Entertainment, Climate and Weather, Science and Technology, Companies, Commodities, Mentions, World, Health.

## `kalshiScanLimit` (type: `integer`):

Stop scanning Kalshi after this many open markets (0 = scan the whole exchange, ~100k markets in ~50 requests, about 10 seconds).

## Actor input object example

```json
{
  "platforms": [
    "polymarket",
    "kalshi"
  ],
  "query": "bitcoin",
  "maxMarkets": 200,
  "sortBy": "volume24h",
  "minVolume": 0,
  "minLiquidity": 0,
  "closingWithinDays": 0,
  "includeClosed": false,
  "includeRules": true,
  "polymarketTags": [],
  "kalshiSeriesTickers": [],
  "kalshiEventTickers": [],
  "kalshiCategories": [],
  "kalshiScanLimit": 0
}
```

# 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 = {
    "platforms": [
        "polymarket",
        "kalshi"
    ],
    "query": "bitcoin",
    "polymarketTags": [],
    "kalshiSeriesTickers": [],
    "kalshiEventTickers": [],
    "kalshiCategories": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("herbcoder/prediction-market-odds").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 = {
    "platforms": [
        "polymarket",
        "kalshi",
    ],
    "query": "bitcoin",
    "polymarketTags": [],
    "kalshiSeriesTickers": [],
    "kalshiEventTickers": [],
    "kalshiCategories": [],
}

# Run the Actor and wait for it to finish
run = client.actor("herbcoder/prediction-market-odds").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 '{
  "platforms": [
    "polymarket",
    "kalshi"
  ],
  "query": "bitcoin",
  "polymarketTags": [],
  "kalshiSeriesTickers": [],
  "kalshiEventTickers": [],
  "kalshiCategories": []
}' |
apify call herbcoder/prediction-market-odds --silent --output-dataset

```

## MCP server setup

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

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/nw4FABd2s1NokVOoh/builds/paExx90bElzM5HS70/openapi.json
