# Polymarket vs Kalshi API: Matched Markets, Gaps & Sports (`forgedata/prediction-markets-api`) Actor

The same prediction market on Polymarket and Kalshi, matched and verified, with both prices, the gap and alerts when a gap opens. Elections, economics, crypto and sports: winner, spread and total lines in 100+ leagues. Instant API. $3 per 1,000 rows.

- **URL**: https://apify.com/forgedata/prediction-markets-api.md
- **Developed by:** [Data Forge](https://apify.com/forgedata) (community)
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.10 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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

## Polymarket vs Kalshi API: matched markets, gaps, sports and alerts

The same prediction market on Polymarket and Kalshi, matched and verified, with both prices, the gap between them and alerts when a gap opens. Covers elections, politics, economics, crypto and sports: game winners, spreads and totals across 100+ leagues.

### What you get

- **Matched pairs.** The same question on both platforms, checked so the names, numbers, thresholds, teams and deadlines agree. Each pair has both Yes prices, the gap in cents, the pre-fee edge from buying Yes on one side and No on the other, volume on both sides and links to both markets.
- **Sports, line by line.** Around 1,300 games at a time (NFL, NBA, NHL, college football and basketball, MLS, Premier League, La Liga, Serie A, Champions League, esports and more). Game winner, spread and total markets are paired line by line, so "Raptors -3.5" on Polymarket meets "Toronto wins by over 3.5 points" on Kalshi.
- **Alerts.** `/alerts` returns gaps that just opened, newest first. Poll it from a bot, a sheet or a Discord webhook.
- **Every market in one format.** `/markets` lists every open market on both platforms with prices, volume and closing dates.
- **History.** `/history` returns 30 days of prices for any pair.

Gaps are only reported when both platforms show a live two-sided quote, so empty order books do not show up as fake opportunities.

### How to use it

**As an API (Standby mode).** Call the Actor's URL with your Apify token:

```
https://forgedata--prediction-markets-api.apify.actor/pairs?minGap=3&tradedToday=true&token=YOUR_APIFY_TOKEN
https://forgedata--prediction-markets-api.apify.actor/pairs?sports=only&league=nba&type=spread
https://forgedata--prediction-markets-api.apify.actor/alerts?minGap=3&hours=1
https://forgedata--prediction-markets-api.apify.actor/markets?q=bitcoin&platform=kalshi
https://forgedata--prediction-markets-api.apify.actor/history?pairId=PAIR_ID
```

**As a normal run.** Pick "Matched pairs", "Alerts" or "All markets" in the input, set filters, and get the rows in the dataset (JSON, CSV or Excel).

### Endpoints and filters

| Endpoint | What it returns | Main filters |
|---|---|---|
| `GET /pairs` | Same market on both platforms, biggest gap first | `q`, `category`, `sports` (only, exclude), `league` (nba, nfl, nhl, cfb, cbb, epl...), `type` (moneyline, spread, total), `minGap`, `minEdge`, `minVolume`, `tradedToday`, `tier`, `sort`, `limit`, `offset` |
| `GET /alerts` | Gaps that opened recently | `minGap` (default 3), `hours` (default 6, max 72), `newPairs`, plus the `/pairs` filters |
| `GET /markets` | Every open market on both platforms | `q`, `platform`, `category`, `minVolume`, `closesBefore`, `sort` |
| `GET /history` | Price history of one pair | `pairId` |

### Example pair

```json
{
  "id": "6392155-o0~KXNBASPREAD-26OCT30CHAWAS-WAS6",
  "title": "Hornets vs. Wizards: spread",
  "outcome": "Wizards (-5.5)",
  "category": "Sports",
  "gapPoints": 0.0,
  "edgePointsPreFee": 0,
  "game": { "league": "NBA", "date": "2026-10-30", "type": "spread", "line": -5.5 },
  "polymarket": { "yesPrice": 0.345, "yesBid": 0.33, "yesAsk": 0.36, "url": "https://polymarket.com/event/nba-cha-was-2026-10-30" },
  "kalshi": { "ticker": "KXNBASPREAD-26OCT30CHAWAS-WAS6", "question": "Charlotte vs Washington: Washington wins by over 5.5 points", "yesPrice": 0.345 }
}
```

### How matching works

Political, economic and other questions are matched on their wording with strict checks: numbers, years and dates must agree, words like "not", "before", "relegated" or a party name must appear on both sides, every named person or place must appear on both sides, and outcome labels must line up. Sports games are matched by league, date and both teams, then each winner, spread and total line is paired with the exact same line on the other platform. Pairs that are close but fail a check are kept as `candidate` with the reason in `notes`.

### Freshness

The database refreshes every hour. Each response includes `databaseUpdatedAt`.

### Notes

Data comes from the public market data both platforms publish. Not affiliated with Polymarket or Kalshi. Resolution rules can differ in the details between platforms, so read both before trading. Information only, not financial advice.

# Actor input Schema

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

Pairs: the same market on Polymarket and Kalshi with both prices and the gap. Markets: every open market on both platforms in one format.

## `q` (type: `string`):

Keep rows that mention all of these words, e.g. senate, fed rate, bitcoin, trump. Leave empty for everything.

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

Optional, e.g. Elections, Politics, Economics, Crypto, Financials, Science and Technology, Entertainment, Climate and Weather.

## `sports` (type: `string`):

Only sports games, no sports, or both.

## `league` (type: `string`):

Comma-separated Polymarket league codes, e.g. nba, nfl, nhl, cfb, epl, lal, cs2.

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

Game winner, spread or total points.

## `tier` (type: `string`):

Verified pairs passed every check: names, numbers, thresholds and deadlines agree. Candidates are close matches that failed at least one check, with the reason in notes.

## `minGap` (type: `integer`):

Only pairs whose Yes prices differ by at least this many cents.

## `minEdge` (type: `integer`):

Only pairs where buying Yes on one side and No on the other would lock in at least this many cents before fees.

## `hours` (type: `integer`):

Alerts: gaps that opened within this many hours (max 72).

## `tradedToday` (type: `boolean`):

Only pairs with volume in the last 24 hours and live quotes on both sides.

## `platform` (type: `string`):

Markets mode: which platform to list.

## `minVolume` (type: `integer`):

Dollars on Polymarket, contracts on Kalshi. For pairs, both sides must reach it.

## `closesBefore` (type: `string`):

Optional date, e.g. 2026-12-31.

## `sort` (type: `string`):

How to order the results.

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

Most rows to return.

## `signupUrl` (type: `string`):

Link for the Get early access button on the public page.

## `showApiUrl` (type: `boolean`):

Shows the API address at the bottom of the public page.

## `includeSports` (type: `boolean`):

On by default.

## `approvePairs` (type: `array`):

Pair ids like 516706~KXALIENS-27 to mark as verified. Saved for future runs.

## `rejectPairs` (type: `array`):

Pair ids that are not the same market. Saved for future runs.

## Actor input object example

```json
{
  "mode": "pairs",
  "q": "",
  "category": "",
  "sports": "",
  "league": "",
  "type": "",
  "tier": "verified",
  "minGap": 0,
  "minEdge": 0,
  "hours": 6,
  "tradedToday": false,
  "platform": "",
  "minVolume": 0,
  "closesBefore": "",
  "sort": "gap",
  "maxResults": 50,
  "signupUrl": "",
  "showApiUrl": false,
  "includeSports": true,
  "approvePairs": [],
  "rejectPairs": []
}
```

# 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 = {
    "mode": "pairs",
    "maxResults": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("forgedata/prediction-markets-api").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": "pairs",
    "maxResults": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("forgedata/prediction-markets-api").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": "pairs",
  "maxResults": 50
}' |
apify call forgedata/prediction-markets-api --silent --output-dataset

```

## MCP server setup

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

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/9macEFxMbsm3I9ycF/builds/wpln8O81O3bZboER8/openapi.json
