# Prediction Market Scanner: Polymarket + Kalshi Odds & Arbitrage (`varnmill/prediction-market-scanner`) Actor

Polymarket and Kalshi in one Actor: live odds, cross-platform arbitrage, whale trades, wallet PnL and positions, top traders, new and resolved markets, and price history. Official public APIs, no login.

- **URL**: https://apify.com/varnmill/prediction-market-scanner.md
- **Developed by:** [Jay Novello](https://apify.com/varnmill) (community)
- **Categories:** Developer tools, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.35 / 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.
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 Market Scanner: Polymarket + Kalshi Odds & Arbitrage

Live odds, cross-venue price gaps, whale trades, wallet PnL, the top-traders leaderboard, new and resolved market feeds and price history from Polymarket and Kalshi, through their official public APIs, with no login, API key or browser.

**Try it:** Click Start with the default input: 8 matched Polymarket/Kalshi pairs in 4.5 s for about $0.04 (run on October 21, 2026).

Default input: `mode: arbitrage`, keywords `bitcoin`, `fed`, `election`, 300 markets per venue. Real rows from that run (prices are dollars per share):

| Question (both venues) | Polymarket YES ask | Kalshi YES ask | Gap (points) | Cheapest YES+NO | Edge per $1 |
|---|---|---|---|---|---|
| Will Israel Katz be the next Prime Minister of Israel? | 0.003 | 0.059 | 3.7 | $0.983 (YES Polymarket + NO Kalshi) | +1.7¢ |
| Will Benny Gantz be the next Prime Minister of Israel? | 0.001 | 0.007 | 0.5 | $0.996 | +0.4¢ |
| Will Yariv Levin be the next Prime Minister of Israel? | 0.001 | 0.020 | 0.85 | $1.000 | 0 |
| Will Yair Lapid be the next Prime Minister of Israel? | 0.002 | 0.019 | 0.9 | $1.001 | −0.1¢ |

Every row carries both markets in full (bid, ask, implied probability, 24h volume, close time, URL) plus `matchScore`, `priceGap`, `bestStrategy`, `combinedCost` and `edge`. Edges are before fees; verify each pair yourself.

**Pricing:** $0.50 per 1,000 market rows (primary event); add-ons: matched pairs $5, whale trades $1, trader summaries $2, wallet records and leaderboard rows $0.30, price points $0.05 per 1,000. Platform usage included; failed runs are not charged.

### Eight modes

| Mode | What you get | Typical use |
|---|---|---|
| **Markets and odds** | Every open market with YES/NO bid and ask, implied probability, 24h volume, liquidity, close time and link, from both venues in one schema | Dashboards, research, feeding odds into a model or a Google Sheet |
| **Cross-platform arbitrage** | Markets that ask the same question on both venues, with the price gap, the cheapest YES+NO combination and the edge before fees | Spotting mispricings, cross-venue hedging |
| **Whale trades** | Polymarket trades above a dollar threshold with trader, side, outcome, price and size | Following smart money, alerts on large bets |
| **Trader analytics** (new in 0.2) | For Polymarket wallets, usernames or profile URLs: a summary (portfolio value, total / realized / unrealized PnL, volume, rank, 7 and 30-day PnL), open positions, closed positions with realized PnL, and trade history | Copy-trading research, tracking a list of sharp wallets, tax and PnL exports |
| **Top traders** (new) | The public Polymarket leaderboard by profit or volume, for today, this week, this month or all time, overall or by category (politics, sports, crypto, economics and more) | Finding wallets worth following, feeding trader analytics |
| **New markets** (new) | Markets created since a date or **since the last run**, both venues, with event, category, opening odds, close time | Being first to new markets, alerts on new questions in your niche |
| **Resolved markets** (new) | Recently resolved Polymarket markets and settled Kalshi markets with the winning outcome and resolution time | Settling bets in your own tools, backtests, model scoring |
| **Price history** (new) | Price time series per market at 1-minute, 1-hour or 1-day spacing: Polymarket prices and Kalshi OHLC candles with bid, ask, volume and open interest | Charts, backtesting, studying how odds moved before an event |

### More real output (October 13, 2026, UTC)

**Wallet PnL in one call**, run on October 13, 2026 (UTC) with `mode: traderAnalytics` and two inputs, a wallet address and a username (`BreakTheBank`). The summary row per trader:

| Trader | Portfolio value | Total PnL | Unrealized PnL | Realized PnL | All-time volume | 30-day PnL | Rank (all time) | Markets traded |
|---|---|---|---|---|---|---|---|---|
| BreakTheBank | $1,559,130 | $5,586,241 | $182,481 | $5,403,759 | $281.4M | $2,646,024 | 21 | 1,037 |
| e46m3 | $31,247 | $738,669 | −$51,911 | $790,580 | $19.5M | $2,692,225 | 256 | 52,667 |

Followed by one row per open position, closed position and trade, for example:

```json
{"recordType": "position", "trader": "e46m3", "marketTitle": "2026 Balance of Power: D Senate, D House",
 "outcome": "Yes", "shares": 6516.3556, "avgPrice": 0.3738, "currentPrice": 0.615, "costBasisUsd": 2436.24,
 "currentValueUsd": 4007.56, "unrealizedPnlUsd": 1571.32, "percentPnl": 64.5, "endDate": "2026-11-04",
 "url": "https://polymarket.com/event/balance-of-power-2026-midterms"}
```

```json
{"recordType": "activity", "trader": "e46m3", "time": "2026-10-13T00:04:24Z", "type": "TRADE", "side": "BUY",
 "marketTitle": "Will the Republican Party candidate win the 2026 KY-01 House election by 55% or more?",
 "outcome": "No", "price": 0.965, "shares": 8, "usdValue": 7.73, "transactionHash": "0xa9bb9d8e…c4962f"}
```

That run (2 traders, 62 rows) took 17 seconds.

**Top traders**, `leaderboardPeriod: MONTH`, overall, ranked by profit (50 rows in 8 seconds):

| Rank | Trader | 30-day PnL | 30-day volume |
|---|---|---|---|
| 1 | e46m3 | $2,692,225 | $2,288,936 |
| 2 | BreakTheBank | $2,646,024 | $45,732,511 |
| 3 | UpTheBlues | $1,881,450 | $133,230,698 |
| 4 | 00gringo00 | $1,739,969 | $19,407,750 |
| 5 | Kch-Temp | $1,699,028 | $14,652,334 |

**Resolved markets**, last 24 hours, `minTotalVolume: 100000`, excluding "up or down" (25 per venue in 40 seconds):

| Venue | Resolved (UTC) | Market | Winner | Volume |
|---|---|---|---|---|
| Polymarket | Oct 12 23:21 | US x Iran ceasefire continues through October 12? | Yes | $1,988,650 |
| Polymarket | Oct 12 21:12 | Will Newcastle United FC win on 2026-10-12? | No | $1,104,263 |
| Polymarket | Oct 12 23:44 | Los Angeles Dodgers vs. Milwaukee Brewers: O/U 8.5 | Over | $167,590 |
| Kalshi | Oct 13 00:07 | Torres vs Barrena: Alex Barrena wins | Yes | 908,645 contracts |
| Kalshi | Oct 13 00:02 | BTC price on Oct 12, 2026 at 8pm EDT: $82,000 or above | No | 185,113 contracts |

**Price history**, `marketIds: ["https://polymarket.com/event/fed-decision-in-december-20260729232808632", "KXFED-26DEC"]`, daily, 30 days (120 points in 17 seconds). Weekly samples of the YES price:

| Market | Sep 14 | Sep 21 | Sep 28 | Oct 5 | Oct 12 |
|---|---|---|---|---|---|
| Polymarket: Fed hikes 25 bps after the December 2026 meeting? | 0.57 | 0.675 | 0.675 | 0.715 | 0.745 |
| Polymarket: No change after the December 2026 meeting? | 0.395 | 0.305 | 0.295 | 0.255 | 0.225 |
| Kalshi: Upper bound above 4.50% after Dec 9, 2026? (Sep 15 → Oct 6) | 0.015 | 0.05 | 0.04 | 0.06 | – |

**New markets**, last 24 hours, excluding sports, esports, weather and "up or down" markets (local run, 15 per venue):

| Venue | Created (UTC) | Event | Market |
|---|---|---|---|
| Polymarket | Oct 12 23:40 | Ethereum above \_\_\_ on October 12, 9PM ET? | Ethereum above 2,430 (opened at 0.57) |
| Kalshi | Oct 13 00:12 | Palladium price on Oct 12, 2026 at 11:00 PM ET | Above $1137.99 USD/ounce |
| Kalshi | Oct 13 00:08 | Grammy Nominees: Best Pop Solo Performance | Sauvignon Blanc |

**New markets since the last run**: two scheduled runs with `sinceLastRun: true` returned 50 markets each with zero overlap; the second run started exactly one market after where the first stopped (Polymarket 21:25:06.909 → 21:25:07.069 UTC).

### How to use each mode

- **Trader analytics**: put wallet addresses (`0x…`, the proxy wallet shown in the profile URL), exact usernames, or profile links (`https://polymarket.com/@name`, `https://polymarket.com/profile/0x…`) in **Wallets or usernames**. Choose sections (summary, positions, closedPositions, activity), the max rows per section, and which activity types to include (trades and redemptions by default).
- **Top traders**: pick a period, category and ranking (profit or volume), and how many rows (up to about 2,000).
- **New markets / Resolved markets**: set **Since** (`2026-10-01` or `2026-10-12T08:00:00Z`) or a **Lookback** in hours, or tick **Only markets since the last run** and schedule the Actor. Use **Keywords**, **Exclude keywords** and **Minimum total volume** to cut the flood: Polymarket alone creates about 14,000 and resolves about 20,000 markets a day, mostly 5-minute crypto and live sports markets.
- **Price history**: paste market or event URLs, slugs, IDs, condition IDs or token IDs from Polymarket, and market, event or series tickers or URLs from Kalshi. Events expand to their highest-volume markets (up to **Max markets per event or series**). Choose 1-minute, 1-hour or 1-day spacing and how many days back. For a market that closed before the window, you get the last N days of its life.

### Output fields

- **Markets**: `platform`, `eventTitle`, `marketTitle`, `outcomeLabel`, `yesBid`, `yesAsk`, `noBid`, `noAsk`, `lastPrice`, `impliedProbability`, `volume24hUsd`, `totalVolumeUsd`, `liquidityUsd`, `openInterestContracts` (Kalshi), `closeTime`, `categories`, `url`, `marketId`, `eventId`.
- **New and resolved markets**: the market fields plus `createdAt`, `openTime`, `status`, `conditionId` and `outcomeTokenIds` (Polymarket), `rules` (Kalshi); resolved rows add `resolvedAt`, `winningOutcome`, `resolution` (`resolved`, `void`, `50-50`) and `settlementValue` (final value of the first outcome, 1 or 0). Kalshi volume is in contracts (each pays $1).
- **Trader summary**: `wallet`, `trader`, `pseudonym`, `xUsername`, `joinedAt`, `portfolioValueUsd`, `openPositions`, `openPositionsValueUsd`, `unrealizedPnlUsd`, `realizedPnlUsd`, `totalPnlUsd`, `totalVolumeUsd`, `allTimeRank`, `pnl30dUsd`, `volume30dUsd`, `pnl7dUsd`, `marketsTraded`, `resolvedUnredeemedPositions`, `unclaimedWinningsUsd`, `largestOpenPosition`, `positionsComplete`, `profileUrl`.
- **Positions / closed positions / activity**: market, outcome, shares, average and current price, cost basis, value, PnL, time, type and side, USD value, transaction hash, link.
- **Leaderboard**: `rank`, `trader`, `wallet`, `pnlUsd`, `volumeUsd`, `period`, `category`, `xUsername`, `profileUrl`.
- **Price history**: `platform`, `marketTitle`, `outcome`, `time`, `timestamp`, `price`, plus `open`, `high`, `low`, `close`, `yesBid`, `yesAsk`, `volumeContracts` and `openInterestContracts` for Kalshi.

Prices are in dollars per share (0 to 1). Multi-leg Kalshi parlays are excluded.

### Pricing

Pay per result, platform usage included:

| Event | Price |
|---|---|
| Market row (markets, new markets, resolved markets) | $0.50 per 1,000 |
| Matched pair (arbitrage) | $5 per 1,000 |
| Whale trade | $1 per 1,000 |
| Trader summary | $2 per 1,000 ($0.002 per wallet) |
| Wallet record (position, closed position or activity row) | $0.30 per 1,000 |
| Leaderboard row | $0.30 per 1,000 |
| Price point | $0.05 per 1,000 |

Examples: a full report on one wallet with 100 positions and 100 trades costs about $0.06; 30 days of daily prices for 10 markets costs about $0.015; the top 500 traders cost $0.15.

### Accuracy and limits

- **Total PnL** is Polymarket's own all-time profit figure (the number on the profile and leaderboard). **Unrealized PnL** is the mark-to-market PnL of open, unresolved positions. **Realized PnL** is derived as total minus unrealized. For wallets with more than 2,000 open positions only the 2,000 largest are counted (`positionsComplete: false`).
- Usernames must match exactly; Polymarket's search does not find random pseudonyms like "Grown-Fence", so use the wallet address for those.
- The public leaderboard goes about 2,000 rows deep.
- Polymarket price history is the traded price of the first outcome (YES); the other outcome is 1 minus it. Kalshi candles are only produced for completed periods, so a market that opened an hour ago has no hourly candle yet.
- New and resolved feeds scan at most 40,000 Polymarket and 60,000 Kalshi markets per run. That is about two days of Polymarket's flow but can be less than one day of Kalshi's (Kalshi lists tens of thousands of strike-ladder markets a day), so for Kalshi prefer windows of a few hours or "since last run" on a schedule; the log warns when a window was too big. In "since last run" mode a capped run delivers the oldest markets first and the next run continues from there, so nothing is skipped.
- "Since last run" state lives in your account's key-value store `prediction-market-scanner-state`, one key per mode and filter combination (or per **State key**).

### Use it with schedules and AI agents

- Schedule **newMarkets** or **resolvedMarkets** with `sinceLastRun` every 15 minutes and send the rows to Slack, email, Sheets or a webhook with Apify integrations.
- Schedule **traderAnalytics** on a watchlist of wallets to track their PnL and new trades daily.
- The output is small, flat JSON, which makes it a good tool for AI agents through the Apify MCP server: "what are the current odds on X", "where do Polymarket and Kalshi disagree", "what is wallet 0x… holding".

### FAQ

**Is this financial advice?** No. It reports public market data. Matching is automatic and can be wrong; verify each pair yourself.

**How are markets matched?** By normalized title similarity, with hard penalties when a named person, team, number or year appears on only one side, and when the questions use different relations (wins nomination vs. is on the ticket).

**Do I need a Polymarket or Kalshi account?** No. Every endpoint used here is public read-only data.

**Is wallet data private?** No. Polymarket positions and trades are public on-chain data and shown on every public profile page. Kalshi accounts are private and are not covered.

**Something wrong or missing?** Open an issue on this page. Problems are usually answered the same day.

### Changelog

- **0.2 (October 2026)**: five new modes: trader analytics (positions, realized and unrealized PnL, trade history for wallets or usernames), top-traders leaderboard, new markets and resolved markets feeds (both venues, with "since last run" state for schedules), and price history (Polymarket prices, Kalshi OHLC candles including settled markets). New exclude-keywords and volume filters. Faster handling of not-found errors.
- **0.1 (October 2026)**: first release. Markets, arbitrage and whale-trade modes.

# Actor input Schema

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

markets: live odds from Polymarket and Kalshi in one table. arbitrage: the same question matched across both platforms with price gaps and arbitrage edges. whaleTrades: large Polymarket trades. traderAnalytics: positions, PnL and trade history for Polymarket wallets or usernames. topTraders: the public Polymarket leaderboard. newMarkets: markets created since a date or since the last run. resolvedMarkets: recently resolved markets with the winning outcome. priceHistory: price time series for given markets.

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

Which venues to include in markets, newMarkets and resolvedMarkets modes. Arbitrage always uses both.

## `keywords` (type: `array`):

Only keep markets whose title, event or category contains any of these words, e.g. bitcoin, election, fed, nfl. Used by markets, arbitrage, whaleTrades, newMarkets and resolvedMarkets. Leave empty for everything.

## `excludeKeywords` (type: `array`):

Drop markets whose title, event or category contains any of these words, e.g. 'up or down', 'sports', 'esports'. newMarkets and resolvedMarkets modes.

## `maxMarketsPerPlatform` (type: `integer`):

Markets mode: fetched highest 24h volume first. newMarkets and resolvedMarkets: most rows per venue per run (newest first).

## `minVolume24hUsd` (type: `integer`):

Markets mode: skip thin markets. Kalshi volume is converted from contracts at the last price.

## `closesWithinDays` (type: `integer`):

Only markets that close within this many days. Leave empty for all.

## `minMatchScore` (type: `number`):

0 to 1. How similar two market titles must be to count as the same question. 0.55 is a good default; raise it for fewer, safer matches.

## `minPriceGap` (type: `number`):

Only output matched pairs whose implied probabilities differ by at least this much (0.03 = 3 points).

## `onlyArbitrage` (type: `boolean`):

Keep only pairs where buying YES on one venue and NO on the other costs less than $1.00 before fees.

## `minTradeUsd` (type: `integer`):

Whale trades mode: smallest trade to include.

## `maxTrades` (type: `integer`):

Whale trades mode: most recent trades first.

## `traders` (type: `array`):

traderAnalytics mode: Polymarket public proxy wallet addresses (0x..., the address shown in a profile URL; never a private key or seed phrase), exact usernames, or profile URLs such as https://polymarket.com/@name or https://polymarket.com/profile/0x.... All data returned is public on-chain activity.

## `traderData` (type: `array`):

Which rows to output per trader. summary: one row with portfolio value, total, realized and unrealized PnL, volume and rank. positions: open positions with mark-to-market PnL. closedPositions: closed positions with realized PnL. activity: trade history (trades, redemptions, merges and splits).

## `maxRecordsPerTrader` (type: `integer`):

Cap for positions, closed positions and activity rows per trader (newest or largest first).

## `activityTypes` (type: `array`):

Which activity to include in the activity section. Leave empty for all types.

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

topTraders mode: ranking window.

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

topTraders mode: overall or one market category.

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

topTraders mode: profit or volume.

## `maxTraders` (type: `integer`):

topTraders mode: how many leaderboard rows (the public leaderboard goes about 2,000 deep).

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

newMarkets and resolvedMarkets: only markets created (or resolved) after this time, e.g. 2026-10-01 or 2026-10-12T08:00:00Z. Overrides 'since last run' and 'lookback'.

## `lookbackHours` (type: `integer`):

newMarkets and resolvedMarkets: window used when 'since' is empty and there is no saved state yet. Polymarket alone creates about 14,000 and resolves about 20,000 markets a day, mostly short crypto and sports markets, so use keywords or a volume floor for long windows.

## `sinceLastRun` (type: `boolean`):

Remember where this feed stopped (in the named key-value store 'prediction-market-scanner-state') and output only markets that are new since the previous run. Ideal for schedules. The state is kept per mode, platforms, keywords and volume floor, or per 'state key'.

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

Optional name for the 'since last run' state, to run several independent feeds.

## `minTotalVolume` (type: `integer`):

newMarkets and resolvedMarkets: skip markets with less lifetime volume. USD on Polymarket, contracts on Kalshi (one contract pays $1). Useful to drop the thousands of tiny 5-minute markets.

## `marketIds` (type: `array`):

priceHistory mode: Polymarket market or event URLs, slugs, market IDs, condition IDs or token IDs, and Kalshi market, event or series tickers or URLs. Prefix with 'kalshi:' or 'polymarket:' if a value is ambiguous. Event links expand to their markets.

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

priceHistory mode: spacing of points. Polymarket returns the last traded price; Kalshi returns OHLC candles with bid, ask, volume and open interest.

## `historyDays` (type: `integer`):

priceHistory mode: how far back to go. Minute data is best kept to a few days.

## `maxMarketsPerInput` (type: `integer`):

priceHistory mode: when an input is an event or series, include up to this many of its markets (highest volume first).

## Actor input object example

```json
{
  "mode": "arbitrage",
  "platforms": [
    "polymarket",
    "kalshi"
  ],
  "keywords": [
    "bitcoin",
    "fed",
    "election"
  ],
  "maxMarketsPerPlatform": 300,
  "minVolume24hUsd": 0,
  "minMatchScore": 0.55,
  "minPriceGap": 0,
  "onlyArbitrage": false,
  "minTradeUsd": 5000,
  "maxTrades": 200,
  "traders": [
    "0x4f1d5ae26fc31472966e951af3183308736d8de2"
  ],
  "traderData": [
    "summary",
    "positions",
    "closedPositions",
    "activity"
  ],
  "maxRecordsPerTrader": 20,
  "activityTypes": [
    "TRADE",
    "REDEEM"
  ],
  "leaderboardPeriod": "MONTH",
  "leaderboardCategory": "OVERALL",
  "leaderboardOrderBy": "PNL",
  "maxTraders": 100,
  "lookbackHours": 24,
  "sinceLastRun": false,
  "minTotalVolume": 0,
  "marketIds": [
    "https://polymarket.com/event/fed-decision-in-december",
    "KXFED-26DEC"
  ],
  "historyInterval": "hour",
  "historyDays": 3,
  "maxMarketsPerInput": 3
}
```

# Actor output Schema

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

Markets, matched pairs, trades, trader rows, leaderboard rows, new or resolved markets, or price points, depending on the mode.

## `resultsCsv` (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": "arbitrage",
    "keywords": [
        "bitcoin",
        "fed",
        "election"
    ],
    "maxMarketsPerPlatform": 300,
    "traders": [
        "0x4f1d5ae26fc31472966e951af3183308736d8de2"
    ],
    "maxRecordsPerTrader": 20,
    "marketIds": [
        "https://polymarket.com/event/fed-decision-in-december",
        "KXFED-26DEC"
    ],
    "historyDays": 3,
    "maxMarketsPerInput": 3
};

// Run the Actor and wait for it to finish
const run = await client.actor("varnmill/prediction-market-scanner").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": "arbitrage",
    "keywords": [
        "bitcoin",
        "fed",
        "election",
    ],
    "maxMarketsPerPlatform": 300,
    "traders": ["0x4f1d5ae26fc31472966e951af3183308736d8de2"],
    "maxRecordsPerTrader": 20,
    "marketIds": [
        "https://polymarket.com/event/fed-decision-in-december",
        "KXFED-26DEC",
    ],
    "historyDays": 3,
    "maxMarketsPerInput": 3,
}

# Run the Actor and wait for it to finish
run = client.actor("varnmill/prediction-market-scanner").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": "arbitrage",
  "keywords": [
    "bitcoin",
    "fed",
    "election"
  ],
  "maxMarketsPerPlatform": 300,
  "traders": [
    "0x4f1d5ae26fc31472966e951af3183308736d8de2"
  ],
  "maxRecordsPerTrader": 20,
  "marketIds": [
    "https://polymarket.com/event/fed-decision-in-december",
    "KXFED-26DEC"
  ],
  "historyDays": 3,
  "maxMarketsPerInput": 3
}' |
apify call varnmill/prediction-market-scanner --silent --output-dataset

```

## MCP server setup

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

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/r6wP1EKelz7FEHvCE/builds/hlNMQ2DNTdVZ1zyvO/openapi.json
