# Prediction Markets API - Kalshi & Polymarket Odds, MCP (`martin10291/prediction-markets-kalshi-polymarket`) Actor

Read prediction-market odds from the official public APIs of Polymarket and Kalshi in one flat schema. One row per market: question, YES/NO price, implied probability, volume, 24h volume, liquidity, open interest (Kalshi), close time, status, category and link. Search by text or get the top markets

- **URL**: https://apify.com/martin10291/prediction-markets-kalshi-polymarket.md
- **Developed by:** [Martin Petrov](https://apify.com/martin10291) (community)
- **Categories:** AI, News, Agents
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.70 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 API - Kalshi & Polymarket Odds, MCP

**Prediction-market data is split across venues with different schemas.** Polymarket (Gamma API) and Kalshi (trade API) name, price and measure their markets differently, and most tools on the store cover only one venue each. This actor reads both **official public APIs** and returns one flat JSON row per market: question, YES/NO price, implied probability, volume, liquidity, close time, status, category and link. It can also pair the same question on both venues and report the price gap, and it can run as a monitor that outputs only new or moved markets.

**No API key, no login, no proxies.** It uses an honest User-Agent, polite pacing and retries with backoff on HTTP 429/5xx. It is usable from AI agents via MCP.

### What you get

- Top markets by volume, or a text search ("bitcoin", "election", "fed rates").
- Filters: venues, open/closed/all, category, minimum volume, maximum results (up to 2000).
- Cross-venue matching (`matchAcrossVenues`): Kalshi and Polymarket markets about the same question are paired by title similarity. Matched rows carry `matchedVenue`, `matchedMarketId`, `matchedYesPrice`, `matchScore` and `priceGapPts` (absolute YES probability difference in percentage points). Matching is a text heuristic, so check `matchedQuestion` before you trade on a gap.
- Only-new mode (`monitorId`) for price-move alerts.

### Quick start (Apify API)

```bash
curl -X POST "https://api.apify.com/v2/acts/martin10291~prediction-markets-kalshi-polymarket/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"query": "bitcoin", "venues": ["polymarket", "kalshi"], "maxResults": 50}'
```

### Use from AI agents (MCP)

Add the Apify MCP server and expose this actor as a tool:

```
https://mcp.apify.com?tools=martin10291/prediction-markets-kalshi-polymarket
```

Then ask your agent, for example: "What are the current odds that the Fed cuts rates, on Kalshi and Polymarket, and where do they disagree?" The agent calls the actor with `query: "fed rates"` and reads `impliedProbabilityPct` and `priceGapPts`.

### Input

| Field | Type | Default | Meaning |
|---|---|---|---|
| `query` | string | empty | Search text. Empty = top markets by volume. |
| `venues` | array | polymarket, kalshi | Venues to read. |
| `status` | open / closed / all | open | Market status. |
| `category` | string | empty | Keep markets whose category or tag contains this text. |
| `minVolume` | number | 0 | Minimum total volume in USD. |
| `maxResults` | integer | 50 | Rows in total (max 2000), highest volume first, shared fairly between venues. |
| `matchAcrossVenues` | boolean | true | Pair the same question on both venues and add `priceGapPts`. |
| `monitorId` | string | empty | Turns on only-new mode (see below). |
| `minPriceMovePts` | number | 5 | Only-new mode: minimum YES move in points to output a known market again. |

### Output example

```json
{
  "venue": "polymarket",
  "marketId": "561251",
  "eventId": "31552",
  "eventTitle": "Presidential Election Winner 2028",
  "question": "Will Bernie Sanders win the 2028 Democratic presidential nomination?",
  "outcomes": ["Yes", "No"],
  "yesPrice": 0.0065,
  "noPrice": 0.9935,
  "impliedProbabilityPct": 0.65,
  "volume": 12345678.9,
  "volume24h": 10234.5,
  "liquidity": 456789.1,
  "openInterest": null,
  "closeTime": "2028-11-08T04:59:00Z",
  "status": "open",
  "category": "Politics",
  "url": "https://polymarket.com/event/democratic-presidential-nominee-2028",
  "matchedVenue": "kalshi",
  "matchedMarketId": "KXPRESNOMD-28-BS",
  "matchedQuestion": "Will Bernie Sanders be the Democratic Presidential nominee in 2028?",
  "matchedYesPrice": 0.005,
  "matchScore": 0.857,
  "priceGapPts": 0.15,
  "fetchedAt": "2026-11-05T08:03:35Z"
}
```

Prices are between 0 and 1 (0.65 = 65 percent). `yesPrice` is the first outcome's price; for Polymarket markets with other outcome labels see `outcomes`. Kalshi prices are the last traded price (midpoint of bid and ask if there was no trade). `openInterest` is available for Kalshi only. Kalshi volume is in contracts, which settle at 1 USD, so it is comparable to Polymarket USD volume.

### Only-new mode

Set `monitorId` (for example `daily-election`). The actor stores the last seen YES price per market in a named key-value store `prediction-markets-<monitorId>`. The first run outputs everything with `changeType: "new"`. Later runs output only markets that are new (`new`) or whose YES price moved at least `minPriceMovePts` points (`moved`, with `previousYesPrice` and `priceChangePts`). Schedule it hourly or daily and connect a webhook.

### FAQ

**Do I need API keys?** No. Only public market data endpoints are used.

**How fast is it?** The default run (50 markets, both venues) takes about 30 seconds, because the Kalshi list is not sorted by volume and the actor reads all open Kalshi events at a polite pace.

**Can I trade with it?** No. It only reads data. This is not financial advice, and prices can change between the API call and your decision.

**Why is a market not matched?** Matching needs similar wording and the same numbers (years, thresholds) on both sides. Many questions exist on one venue only.

**What if one venue is down?** The other venue's rows are still returned and `RUN_SUMMARY.lastError` names the failure.

**Run summary:** the key-value record `RUN_SUMMARY` holds `itemsOut`, `perVenue`, `matchedPairs`, `lastError` and `durationSec`.

# Actor input Schema

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

Words to search for in market and event titles, for example bitcoin, election, fed rates. Leave empty to get the top markets by volume.

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

Which prediction markets to read. Both are official public APIs without login.

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

open = markets that can still be traded, closed = finished or settled markets, all = both.

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

Optional. Keep only markets whose category or tag contains this text, for example Politics, Crypto, Economics, Sports. Leave empty for all categories.

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

Skip markets with a total traded volume below this value in USD. 0 keeps everything.

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

Maximum number of market rows to output in total, highest volume first. Maximum 2000.

## `matchAcrossVenues` (type: `boolean`):

When both venues are selected, pair Kalshi and Polymarket markets that ask the same question (by title similarity) and add the other venue's price plus priceGapPts, the YES probability difference in percentage points.

## `monitorId` (type: `string`):

Optional. Set a name such as daily-election to turn on only-new mode: the actor remembers the prices of the last run with this ID and outputs only markets that are new or whose YES price moved by at least the minimum move. The first run outputs everything.

## `minPriceMovePts` (type: `number`):

Only-new mode: a known market is output again only if its YES probability changed by at least this many percentage points since the last run with the same Monitor ID.

## Actor input object example

```json
{
  "query": "",
  "venues": [
    "polymarket",
    "kalshi"
  ],
  "status": "open",
  "category": "",
  "minVolume": 0,
  "maxResults": 50,
  "matchAcrossVenues": true,
  "minPriceMovePts": 5
}
```

# Actor output Schema

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

One row per market from Polymarket and Kalshi: question, YES/NO price, implied probability, volume, liquidity, close time, link and the matching market on the other venue with the price gap.

# 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 = {
    "query": "",
    "venues": [
        "polymarket",
        "kalshi"
    ],
    "status": "open",
    "maxResults": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("martin10291/prediction-markets-kalshi-polymarket").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 = {
    "query": "",
    "venues": [
        "polymarket",
        "kalshi",
    ],
    "status": "open",
    "maxResults": 50,
}

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

```

## MCP server setup

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

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/ViYDt8wbQxkCWyNny/builds/ftus5reUTHxhqDxgH/openapi.json
