# Polymarket Scraper — Odds, Order Book & Trades (`blackfalcondata/polymarket-scraper`) Actor

Scrape polymarket.com prediction markets as structured JSON. Every row carries the question with its outcomes and live prices, the volume and liquidity behind them, plus tags and resolution dates. Filter before the run costs anything. Order book and trades on request.

- **URL**: https://apify.com/blackfalcondata/polymarket-scraper.md
- **Developed by:** [Black Falcon Data](https://apify.com/blackfalcondata) (community)
- **Categories:** Developer tools, Lead generation, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.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?

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

### What does Polymarket Scraper do?

Polymarket Scraper extracts prediction-market data from [polymarket.com](https://polymarket.com). Each market row carries the question, its outcomes and live prices, best bid and ask, and the spread. It also carries 24-hour and lifetime volume, liquidity, tags, the parent event and the resolution date. Filter by status, tag, volume, liquidity or end date before the run costs anything. Add the live order book, recent trades, price history or the largest holders when you need depth. Wallet mode lists every position a wallet holds, with its size, entry price and profit. Wallet P\&L analysis rebuilds a wallet's trading record over a window you choose. It returns realised profit, win rate and entry prices, plus a row for every market the wallet traded. Incremental runs then report only the positions a wallet opened, changed or closed. Output is structured JSON or CSV, so you can run the same query consistently over time.

### How to use this actor

- 👉 **Register for a free Apify account** — no credit card required.
- 🎉 Just click **[Sign up free on Apify →](https://console.apify.com/sign-up?fpr=1h3gvi)** and complete a quick signup.
- 💰 A free Apify account includes $5 in monthly credits — enough to test this actor.
- ⏳ Scrape during the free trial, with no commitment or upfront payment required.

### Key features

- **🔔 Notifications:** Telegram, Slack, Discord, WhatsApp Cloud API, and generic webhook out of the box. Pair with incremental for daily new-listing alerts without pipeline glue.
- **🎯 Batch searches:** pass `["term1", "term2"]` for query, location, or city to batch multiple searches in one run — shared dedup state, single dataset, one Actor-Start charge instead of N.
- **📦 Compact mode:** AI-agent and MCP-friendly payloads with core fields only.
- **✂️ Description truncation:** cap description length with `descriptionMaxLength` to control LLM prompt cost and dataset size — set 0 for full descriptions, or any char-limit to trim.
- **📌 Change classification:** each record carries a `changeType` of NEW / UPDATED / UNCHANGED / REAPPEARED / EXPIRED. Default emits NEW + UPDATED + REAPPEARED; opt into the others with `emitUnchanged` / `emitExpired`.
- **🔌 MCP connectors:** export your results into Notion via Apify's MCP connectors — a clean run-summary page, no glue code. Opt-in via the App connector field; deterministic field-mapping, no AI. Built on Apify's connector framework, so more destinations open up as their catalog grows.
- **📝 Description format selection:** pick a single description representation — `text`, `html`, or `markdown` — and the unused variants are dropped from each record. Halves payload size when your pipeline only consumes one format.
- **♻️ Incremental mode:** recurring runs emit and charge only for listings that are new or whose tracked content changed. First run builds the baseline; subsequent runs emit only NEW / UPDATED / REAPPEARED records (UNCHANGED + EXPIRED opt-in). Saves 80–95% on daily monitoring.
- **🧹 Empty-field stripping:** drop null, empty-string, and empty-array fields from each record before push. Smaller payloads for AI agents and dashboards that already handle missing fields gracefully.
- **📤 Export anywhere:** Download the dataset as JSON, CSV, or Excel from the Apify Console, or stream live via the Apify API and integrations (Make, Zapier, Google Sheets, n8n, …).

### What data can you extract from polymarket.com?

Each result includes Core listing fields (`marketId`, `conditionId`, `questionId`, `slug`, `url`, `portalUrl`, `question`, and `title`, and more) and extended fields (`description`, `outcomeDetails`, and `detailFetched`). In standard mode, all fields are always present — unavailable data points are returned as `null`, never omitted. In compact mode, only core fields are returned.

### Input

The main inputs are a search keyword and a result limit. Additional filters and options are available in the input schema.

Key parameters:

- **`query`** — What the markets should be about — e.g. "election", "bitcoin", "fed rate cut". Paste a JSON array like \["election","bitcoin"] to run several searches in one go.
- **`mode`** — Markets searches the Polymarket catalogue. Wallet positions reports what each wallet below holds — every position with its size, entry price, current value and profit, both realised and unrealised. Wallet P\&L analysis rebuilds each wallet's trading record over the window below: realised profit, win rate, entry prices and every market it traded, one summary row per wallet plus one row per market. Market filters and depth options apply to market searches only. (default: `"markets"`)
- **`walletAddresses`** — Polymarket wallet addresses (0x followed by 40 hex characters), one per line. Used when What to collect is Wallet positions or Wallet P\&L analysis. Every position each wallet holds is returned, including very small ones.
- **`pnlWindowDays`** — How many days of trading the Wallet P\&L analysis covers, counted back from now. Positions opened before the window are still priced on their full history. Used only with Wallet P\&L analysis. (default: `30`)
- **`status`** — Return only open markets (still trading), only closed ones (settled), or both. Default: both. (default: `"any"`)
- **`tagIds`** — Only markets carrying at least one of these Polymarket tag IDs. Several IDs widen the result (any match), they do not narrow it. Tag IDs appear on every row under "tags". (default: `[]`)
- **`marketSlugs`** — Fetch exactly these markets by slug, e.g. "xi-jinping-out-before-2027". Exact match. (default: `[]`)
- **`conditionIds`** — Fetch exactly these markets by on-chain condition ID (0x...). Exact match. (default: `[]`)
- **`minTotalVolume`** — Skip markets that have traded less than this in total. Leave empty for no floor.
- **`minVolume24h`** — Skip markets that traded less than this in the last 24 hours — the usual way to cut dormant markets.
- **`minLiquidity`** — Skip thin markets with less resting liquidity than this.
- **`endDateMin`** — Only markets resolving on or after this date (YYYY-MM-DD).
- ...and 33 more parameters

### Input examples

**Basic search** — Keyword-driven search with a result cap.

→ Full payload per result — all standard fields populated where the source provides them.

```json
{
  "mode": "markets",
  "query": "election",
  "maxResults": 50
}
```

**Incremental tracking** — Only emit listings that changed since the previous run with this `stateKey`.

→ First run builds the baseline state. Subsequent runs emit only records that are new or whose tracked content changed. Set `emitUnchanged: true` to include unchanged records as well.

```json
{
  "query": "election",
  "maxResults": 200,
  "incrementalMode": true,
  "stateKey": "election-tracker"
}
```

**Compact output for AI agents** — Return only core fields for AI-agent and MCP workflows.

→ Small payload with the most important fields — ideal for piping into LLMs without token overhead.

```json
{
  "query": "election",
  "maxResults": 50,
  "compact": true
}
```

### Output

Each run produces a dataset of structured listing records. Results can be downloaded as JSON, CSV, or Excel from the Dataset tab in Apify Console.

### Example listing record

```json
{
  "marketId": "2491900",
  "conditionId": "0x476ed5ed3b72d010a060063964553f4f8bcbd525a7751da7117448638b941f85",
  "questionId": "0x5575d258374e9f58857347c89999a4b6ab6527e6f49ad09a66aba0686d8ce300",
  "slug": "will-trump-endorse-likud-in-the-2026-israeli-election-20260608183908858",
  "url": "https://polymarket.com/event/which-party-will-trump-endorse-in-the-2026-israeli-election-20260610144125261/will-trump-endorse-likud-in-the-2026-israeli-election-20260608183908858",
  "portalUrl": "https://polymarket.com/event/which-party-will-trump-endorse-in-the-2026-israeli-election-20260610144125261/will-trump-endorse-likud-in-the-2026-israeli-election-20260608183908858",
  "question": "Will Trump endorse Likud in the 2026 Israeli Election?",
  "title": "Will Trump endorse Likud in the 2026 Israeli Election?",
  "description": "Legislative elections are scheduled to be held in Israel by October 27, 2026.\n\nThis market will resolve based on which party Donald Trump announces that he supports, endorses, or otherwise tells peopl...",
  "image": "https://polymarket-upload.s3.us-east-2.amazonaws.com/who-will-trump-endorse-in-the-2026-israeli-election-20260608183907960-QeXr8ObEt0Rg.jpg",
  "icon": "https://polymarket-upload.s3.us-east-2.amazonaws.com/who-will-trump-endorse-in-the-2026-israeli-election-20260608183907960-QeXr8ObEt0Rg.jpg",
  "active": true,
  "closed": false,
  "archived": false,
  "acceptingOrders": true,
  "featured": false,
  "restricted": true,
  "funded": false,
  "enableOrderBook": true,
  "negRisk": true,
  "startDate": "2026-06-10T16:03:48.539219Z",
  "endDate": "2026-10-28T03:59:00Z",
  "createdAt": "2026-06-10T15:49:38.931457Z",
  "updatedAt": "2026-09-08T21:44:05.111469Z",
  "volume": 17229.20892,
  "liquidity": 1848.7172,
  "bestBid": 0.29,
  "bestAsk": 0.3,
  "lastTradePrice": 0.29,
  "spread": 0.01,
  "oneWeekPriceChange": -0.01,
  "competitive": 0.9596698735634942,
  "orderPriceMinTickSize": 0.01,
  "orderMinSize": 5,
  "outcomes": [
    "Yes",
    "No"
  ],
  "outcomePrices": [
    0.295,
    0.705
  ],
  "clobTokenIds": [
    "53855593311428088838881249546258446872913007845421716442565670747391193029047",
    "52684132878394980741425622519684645910544827223191232352283006695924904716770"
  ],
  "outcomeDetails": [
    {
      "outcome": "Yes",
      "price": 0.295,
      "clobTokenId": "53855593311428088838881249546258446872913007845421716442565670747391193029047"
    },
    {
      "outcome": "No",
      "price": 0.705,
      "clobTokenId": "52684132878394980741425622519684645910544827223191232352283006695924904716770"
    }
  ],
  "ticker": "which-party-will-trump-endorse-in-the-2026-israeli-election-20260610144125261",
  "eventId": "580320",
  "eventSlug": "which-party-will-trump-endorse-in-the-2026-israeli-election-20260610144125261",
  "eventTitle": "Which party will Trump Endorse in the 2026 Israeli Election? ",
  "openInterest": 5582.783841999999,
  "commentCount": 6,
  "events": [
    {
      "id": "580320",
      "ticker": "which-party-will-trump-endorse-in-the-2026-israeli-election-20260610144125261",
      "slug": "which-party-will-trump-endorse-in-the-2026-israeli-election-20260610144125261",
      "title": "Which party will Trump Endorse in the 2026 Israeli Election? ",
      "description": "Legislative elections are scheduled to be held in Israel by October 27, 2026.\n\nThis market will resolve based on which party Donald Trump announces that he supports, endorses, or otherwise tells peopl...",
      "startDate": "2026-06-10T15:56:45.502194Z",
      "endDate": "2026-10-28T03:59:00Z",
      "creationDate": "2026-06-10T16:38:14.194215Z",
      "image": "https://polymarket-upload.s3.us-east-2.amazonaws.com/who-will-trump-endorse-in-the-2026-israeli-election-20260608183907960-QeXr8ObEt0Rg.jpg",
      "icon": "https://polymarket-upload.s3.us-east-2.amazonaws.com/who-will-trump-endorse-in-the-2026-israeli-election-20260608183907960-QeXr8ObEt0Rg.jpg",
      "active": true,
      "closed": false,
      "archived": false,
      "featured": false,
      "restricted": true,
      "liquidity": 117992.13928,
      "volume": 38945.104405,
      "volume24hr": 150.95,
      "openInterest": 5582.783841999999,
      "competitive": 0.9596698735634942,
      "commentCount": 6,
      "createdAt": "2026-06-10T15:49:38.712518Z",
      "updatedAt": "2026-09-08T21:42:34.186938Z"
    }
  ],
  "tags": [
    {
      "id": "126",
      "label": "Trump",
      "slug": "trump"
    },
    {
      "id": "180",
      "label": "Israel",
      "slug": "israel"
    },
    {
      "id": "339",
      "label": "election",
      "slug": "election"
    },
    {
      "id": "407",
      "label": "endorsements",
      "slug": "endorsements"
    },
    {
      "id": "104793",
      "label": "Israel Election",
      "slug": "israel-election"
    }
  ],
  "orderBooks": [
    {
      "tokenId": "53855593311428088838881249546258446872913007845421716442565670747391193029047",
      "outcome": "Yes",
      "bids": [
        {
          "price": 0.29,
          "size": 283.99
        },
        {
          "price": 0.28,
          "size": 1182.66
        },
        {
          "price": 0.27,
          "size": 207.49
        },
        {
          "price": 0.21,
          "size": 40
        },
        {
          "price": 0.13,
          "size": 10
        },
        "... 5 more items"
      ],
      "asks": [
        {
          "price": 0.3,
          "size": 40
        },
        {
          "price": 0.31,
          "size": 713.54
        },
        {
          "price": 0.32,
          "size": 102
        },
        {
          "price": 0.53,
          "size": 10
        },
        {
          "price": 0.59,
          "size": 550
        },
        "... 5 more items"
      ],
      "bestBid": 0.29,
      "bestAsk": 0.3,
      "spread": 0.01,
      "bidDepthUsd": 705.3617,
      "askDepthUsd": 2775.8545
    },
    {
      "tokenId": "52684132878394980741425622519684645910544827223191232352283006695924904716770",
      "outcome": "No",
      "bids": [
        {
          "price": 0.7,
          "size": 40
        },
        {
          "price": 0.69,
          "size": 713.54
        },
        {
          "price": 0.68,
          "size": 102
        },
        {
          "price": 0.47,
          "size": 10
        },
        {
          "price": 0.41,
          "size": 550
        },
        "... 5 more items"
      ],
      "asks": [
        {
          "price": 0.71,
          "size": 283.99
        },
        {
          "price": 0.72,
          "size": 1182.66
        },
        {
          "price": 0.73,
          "size": 207.49
        },
        {
          "price": 0.79,
          "size": 40
        },
        {
          "price": 0.87,
          "size": 10
        },
        "... 5 more items"
      ],
      "bestBid": 0.7,
      "bestAsk": 0.71,
      "spread": 0.01,
      "bidDepthUsd": 1076.7555,
      "askDepthUsd": 11650.1283
    }
  ],
  "recentTrades": [
    {
      "wallet": "0xcfff4295288ee29f75a38a7028611b7c1e93673d",
      "side": "BUY",
      "size": 10,
      "price": 0.71,
      "timestamp": 1788813244,
      "outcomeIndex": 1
    },
    {
      "wallet": "0xcfff4295288ee29f75a38a7028611b7c1e93673d",
      "side": "BUY",
      "size": 10,
      "price": 0.71,
      "timestamp": 1788813244,
      "outcomeIndex": 1
    },
    {
      "wallet": "0xc50c05d454f0681ea57b254df8ad97bc210f3017",
      "side": "BUY",
      "size": 18.507043,
      "price": 0.7099999714,
      "timestamp": 1788813225,
      "outcomeIndex": 1
    }
  ],
  "sourceApiUrl": "https://gamma-api.polymarket.com/markets/2491900",
  "listingId": "2491900",
  "searchQuery": "election",
  "contentQuality": "serp_only",
  "detailFetched": false,
  "scrapedAt": "2026-09-08T21:44:07.192Z",
  "source": "polymarket.com",
  "contentHash": "953c10935afbe8aa78965d11ab1d21e8c27d8027a3c2b0acdaf6a0bdabc27340"
}
```

### Incremental fields

When incremental mode is on, each record also carries:

- `changeType` — one of `NEW`, `UPDATED`, `UNCHANGED`, `REAPPEARED`, `EXPIRED`. Default output covers `NEW` / `UPDATED` / `REAPPEARED`; set `emitUnchanged: true` or `emitExpired: true` to opt into the others.
- `isRepost`, `repostOfId`, `repostDetectedAt` — populated when a new listing matches the tracked content of a previously expired one. Set `skipReposts: true` to drop detected reposts from the output.

### How to scrape polymarket.com

1. Go to [Polymarket Scraper](https://apify.com/blackfalcondata/polymarket-scraper?fpr=1h3gvi) in Apify Console.
2. Enter a search keyword.
3. Set `maxResults` to control how many results you need.
4. Click **Start** and wait for the run to finish.
5. Export the dataset as JSON, CSV, or Excel.

### Use cases

- Extract listing data from polymarket.com for market research and competitive analysis.
- Track pricing trends across regions and categories over time.
- Monitor new and changed listings on scheduled runs without processing the full dataset every time.
- Feed structured data into AI agents, MCP tools, and automated pipelines using compact mode.
- Export clean, structured data to dashboards, spreadsheets, or data warehouses.

### How much does it cost to scrape polymarket.com?

Polymarket Scraper uses [pay-per-event](https://docs.apify.com/platform/actors/paid-actors/pay-per-event) pricing. You pay a small fee when the run starts and then for each result that is actually produced.

- **Run start:** $0.0005 per run
- **Per result:** $0.0025 per listing record

Example costs:

- 10 results: **$0.026**
- 25 results: **$0.063**
- 100 results: **$0.25**
- 200 results: **$0.5**
- 500 results: **$1.25**

#### Example: recurring monitoring savings

These examples compare full re-scrapes with incremental runs at different churn rates. Churn is the share of listings that are new or whose tracked content changed since the previous run. Actual churn depends on your query breadth, source activity, and polling frequency — the scenarios below are examples, not predictions.

Example setup: 250 listings per run, daily polling (30 runs/month). Costs scale linearly with the number of listings.

| Churn rate | Full re-scrape run cost | Incremental run cost | Savings vs full re-scrape | Monthly cost after baseline |
|---|---:|---:|---:|---:|
| 5% — stable niche query | $0.63 | $0.03 | $0.59 (95%) | $0.95 |
| 15% — moderate broad query | $0.63 | $0.09 | $0.53 (85%) | $2.83 |
| 30% — high-volume aggregator | $0.63 | $0.19 | $0.44 (70%) | $5.64 |

Full re-scrape monthly cost at the same cadence: $18.76. First month with incremental costs $1.55 / $3.36 / $6.08 for the 5% / 15% / 30% scenarios because the first run builds baseline state at full cost before incremental savings apply.

Platform usage is included in the per-result fee shown above.

### FAQ

#### How many results can I get from polymarket.com?

The number of results depends on the search query and available listings on polymarket.com. Use the `maxResults` parameter to control how many results are returned per run.

#### Does Polymarket Scraper support recurring monitoring?

Yes. Enable incremental mode to only receive new or changed listings on subsequent runs. This is ideal for scheduled monitoring where you want to track changes over time without re-processing the full dataset.

#### Can I integrate Polymarket Scraper with other apps?

Yes. Polymarket Scraper works with Apify's [integrations](https://apify.com/integrations?fpr=1h3gvi) to connect with tools like Zapier, Make, Google Sheets, Slack, and more. You can also use webhooks to trigger actions when a run completes.

#### Can I use Polymarket Scraper with the Apify API?

Yes. You can start runs, manage inputs, and retrieve results programmatically through the [Apify API](https://docs.apify.com/api/v2). Client libraries are available for JavaScript, Python, and other languages.

#### Can I use Polymarket Scraper through an MCP Server?

Yes. Apify provides an [MCP Server](https://apify.com/apify/actors-mcp-server?fpr=1h3gvi) that lets AI assistants and agents call this actor directly. Use compact mode, `descriptionMaxLength`, a single `descriptionFormat`, and `excludeEmptyFields` to keep payloads manageable for LLM context windows.

#### Is it legal to scrape polymarket.com?

This actor extracts publicly available data from polymarket.com. Web scraping of public information is generally considered legal, but you should always review the target site's terms of service and ensure your use case complies with applicable laws and regulations, including GDPR where relevant.

#### Your feedback

If you have questions, need a feature, or found a bug, please [open an issue](https://apify.com/blackfalcondata/polymarket-scraper/issues?fpr=1h3gvi) on the actor's page in Apify Console. Your feedback helps us improve.

### You might also like

- [DNS Lookup - Bulk DNS Records & DNSSEC](https://apify.com/blackfalcondata/dns-lookup?fpr=1h3gvi) — Bulk DNS record lookup: A, AAAA, MX, TXT, CNAME, NS, SOA and CAA records plus DNSSEC status.
- [Domain Intelligence Scraper](https://apify.com/blackfalcondata/domain-intelligence-scraper?fpr=1h3gvi) — Bulk domain audit — DNS records, WHOIS, SSL certificates, HTTP status, email authentication.
- [Douyin Scraper \[Just 💰$0.5\] — Hot Search, Trending & Viral](https://apify.com/blackfalcondata/douyin-scraper?fpr=1h3gvi) — 💰 $0.50 per 1,000 results. Scrape douyin.com real-time trending boards — hot search, seeding &.
- [eBay Scraper — active & sold listings](https://apify.com/blackfalcondata/ebay-scraper?fpr=1h3gvi) — Scrape ebay.com — active & sold listings with price & condition · item specifics & images · seller.
- [eBay Sold Listings Scraper — final price, date & item](https://apify.com/blackfalcondata/ebay-sold-listings-scraper?fpr=1h3gvi) — Scrape ebay.com completed and sold listings — the final sold price and sold date that vanish.
- [Email Deliverability Checker](https://apify.com/blackfalcondata/email-deliverability-checker?fpr=1h3gvi) — Bulk email deliverability audit: SPF, DMARC, DKIM and DNSSEC records, MX configuration and domain.
- [Facebook Marketplace \[$0.9💰\] Scraper](https://apify.com/blackfalcondata/facebook-marketplace-scraper?fpr=1h3gvi) — Scrape facebook.com Marketplace listings by keyword, category or location with price, condition,.
- [Finn Torget Scraper — Norwegian Marketplace](https://apify.com/blackfalcondata/finn-torget-scraper?fpr=1h3gvi) — Scrape finn.no/torget — Norway's largest classifieds marketplace — filter by category · condition.

### Getting started with Apify

New to Apify? [Create a free account with $5 credit](https://console.apify.com/sign-up?fpr=1h3gvi) — no credit card required.

1. Sign up — $5 platform credit included
2. Open this actor and configure your input
3. Click **Start** — export results as JSON, CSV, or Excel

Need more later? [See Apify pricing](https://apify.com/pricing?fpr=1h3gvi).

### Disclaimer

This actor accesses only publicly available data on polymarket.com. You are responsible for how you use the extracted data — in particular any personal information such as names, phone numbers, or email addresses — and for complying with Polymarket's terms of use, applicable data-protection law (including the GDPR where it applies), and the anti-spam rules of your jurisdiction.

This actor is not affiliated with, endorsed by, or connected to Polymarket.

### Search keywords

polymarket scraper, polymarket api, apify polymarket, polymarket data extraction, polymarket.com scraper, polymarket.com data, polymarket.com api, polymarket open only, polymarket open only scraper, polymarket closed only, polymarket closed only scraper.

# Actor input Schema

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

What the markets should be about — e.g. "election", "bitcoin", "fed rate cut". Paste a JSON array like \["election","bitcoin"] to run several searches in one go.

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

Markets searches the Polymarket catalogue. Wallet positions reports what each wallet below holds — every position with its size, entry price, current value and profit, both realised and unrealised. Wallet P\&L analysis rebuilds each wallet's trading record over the window below: realised profit, win rate, entry prices and every market it traded, one summary row per wallet plus one row per market. Market filters and depth options apply to market searches only.

## `walletAddresses` (type: `array`):

Polymarket wallet addresses (0x followed by 40 hex characters), one per line. Used when What to collect is Wallet positions or Wallet P\&L analysis. Every position each wallet holds is returned, including very small ones.

## `pnlWindowDays` (type: `integer`):

How many days of trading the Wallet P\&L analysis covers, counted back from now. Positions opened before the window are still priced on their full history. Used only with Wallet P\&L analysis.

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

Return only open markets (still trading), only closed ones (settled), or both. Default: both.

## `tagIds` (type: `array`):

Only markets carrying at least one of these Polymarket tag IDs. Several IDs widen the result (any match), they do not narrow it. Tag IDs appear on every row under "tags".

## `marketSlugs` (type: `array`):

Fetch exactly these markets by slug, e.g. "xi-jinping-out-before-2027". Exact match.

## `conditionIds` (type: `array`):

Fetch exactly these markets by on-chain condition ID (0x...). Exact match.

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

Skip markets that have traded less than this in total. Leave empty for no floor.

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

Skip markets that traded less than this in the last 24 hours — the usual way to cut dormant markets.

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

Skip thin markets with less resting liquidity than this.

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

Only markets resolving on or after this date (YYYY-MM-DD).

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

Only markets resolving on or before this date (YYYY-MM-DD).

## `includeOrderBook` (type: `boolean`):

Add the live resting order book for every outcome — bids, asks, best prices, spread and the USD resting on each side. Cheap: the whole page is fetched in one batched request.

## `orderBookDepth` (type: `integer`):

How many price levels per side to keep. Best-priced first. The USD depth totals always describe the FULL book, not this slice.

## `includeRecentTrades` (type: `boolean`):

Add the most recent trades on each market — wallet, side, size, price and time. Costs one extra request per market.

## `recentTradesLimit` (type: `integer`):

How many recent trades to return per market.

## `includeTopHolders` (type: `boolean`):

Add the largest positions in each market — wallet, display name, which outcome they are on, and size. Costs one extra request per market.

## `topHoldersLimit` (type: `integer`):

How many of the largest holders to return per market, counted across both outcomes.

## `includePriceHistory` (type: `boolean`):

Add a price series per outcome. This is the most expensive switch: one request per outcome, so a two-outcome market costs two extra requests.

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

How far back the price series reaches. Hourly points.

## `includeRawData` (type: `boolean`):

Attach the untouched source record to every row. Useful when you want a field this actor does not map yet. It roughly doubles the row size.

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

Maximum number of markets to return. 0 means every market that matches — about 190,000 open markets, or roughly 490,000 including settled ones. A run also stops at your own cost limit and tells you, so narrow with the filters below and let incremental mode pick up the rest.

## `descriptionMaxLength` (type: `integer`):

Truncate the market's resolution rules to N chars. 0 = no truncation.

## `compact` (type: `boolean`):

Core market fields only — question, prices, volume, status (for AI-agent/MCP workflows).

## `incrementalMode` (type: `boolean`):

Compare against previous run state. stateKey is optional — defaults to a value derived from search inputs so different searches never share state.

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

Optional. Stable identifier for the tracked set of markets. Leave empty to auto-generate from search inputs.

## `skipReposts` (type: `boolean`):

When incremental, skip markets whose content matches an expired market from a prior run (cross-run duplicate detection).

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

Telegram bot token (from @BotFather). Required for Telegram notifications.

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

Telegram chat or channel ID (e.g. "-100123456789"). Required when telegramToken is set.

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

Discord incoming webhook URL. Server Settings → Integrations → Webhooks → New Webhook.

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

Slack incoming webhook URL. api.slack.com/messaging/webhooks.

## `notificationLimit` (type: `integer`):

Maximum number of markets included in each notification message (1–20).

## `notifyOnlyChanges` (type: `boolean`):

When Incremental Mode is on, only send notifications for NEW and UPDATED markets. Has no effect outside incremental mode.

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

WhatsApp Cloud API permanent access token (System User token from Meta Business). Recipient must have messaged the business number within the last 24h (service-conversation window — free since Nov 2024).

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

Your WhatsApp Business phone-number ID (numeric, from Meta dashboard). Required when whatsappAccessToken is set.

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

Recipient phone in E.164 format without + (e.g. "436641234567"). Recipient must have messaged your business number within last 24h.

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

Receives a JSON POST with {metadata, items} after each run. Universal escape hatch for n8n / Make / Zapier / custom backends.

## `webhookHeaders` (type: `object`):

Optional JSON object of custom headers (e.g. {"Authorization":"Bearer ..."}).

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

Optional. Pick a connected app under Settings → API & Integrations to receive your results. Best-effort across MCP connectors as Apify expands its catalog.

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

Only when the connected app is an issue tracker: the team (name or ID) the summary issue is created under, if that app requires one.

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

Pick a single description representation. Polymarket serves plain-text resolution rules, so `all` and `text` are equivalent here.

## `excludeEmptyFields` (type: `boolean`):

Drop null, empty-string, and empty-array fields from each record before push. Smaller payloads for AI agents and dashboards.

## `emitUnchanged` (type: `boolean`):

When incremental mode is on, also emit markets whose tracked content has not changed since the last run.

## `emitExpired` (type: `boolean`):

When incremental mode is on, also emit markets that were seen before but are no longer found.

## Actor input object example

```json
{
  "query": "election",
  "mode": "markets",
  "pnlWindowDays": 30,
  "status": "any",
  "tagIds": [],
  "marketSlugs": [],
  "conditionIds": [],
  "includeOrderBook": false,
  "orderBookDepth": 10,
  "includeRecentTrades": false,
  "recentTradesLimit": 20,
  "includeTopHolders": false,
  "topHoldersLimit": 10,
  "includePriceHistory": false,
  "priceHistoryInterval": "1w",
  "includeRawData": false,
  "maxResults": 50,
  "descriptionMaxLength": 0,
  "compact": false,
  "incrementalMode": false,
  "skipReposts": false,
  "notificationLimit": 5,
  "notifyOnlyChanges": false,
  "descriptionFormat": "all",
  "excludeEmptyFields": false,
  "emitUnchanged": false,
  "emitExpired": false
}
```

# 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 = {
    "query": "election",
    "tagIds": [],
    "marketSlugs": [],
    "conditionIds": [],
    "includeOrderBook": false,
    "includeRecentTrades": false,
    "includeTopHolders": false,
    "includePriceHistory": false,
    "includeRawData": false,
    "maxResults": 50,
    "descriptionFormat": "all",
    "excludeEmptyFields": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("blackfalcondata/polymarket-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 = {
    "query": "election",
    "tagIds": [],
    "marketSlugs": [],
    "conditionIds": [],
    "includeOrderBook": False,
    "includeRecentTrades": False,
    "includeTopHolders": False,
    "includePriceHistory": False,
    "includeRawData": False,
    "maxResults": 50,
    "descriptionFormat": "all",
    "excludeEmptyFields": False,
}

# Run the Actor and wait for it to finish
run = client.actor("blackfalcondata/polymarket-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 '{
  "query": "election",
  "tagIds": [],
  "marketSlugs": [],
  "conditionIds": [],
  "includeOrderBook": false,
  "includeRecentTrades": false,
  "includeTopHolders": false,
  "includePriceHistory": false,
  "includeRawData": false,
  "maxResults": 50,
  "descriptionFormat": "all",
  "excludeEmptyFields": false
}' |
apify call blackfalcondata/polymarket-scraper --silent --output-dataset

```

## MCP server setup

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