# Polymarket Markets Scraper (`mrbridge/polymarket-markets-scraper`) Actor

Scrape Polymarket prediction markets by tag, search, event or market slug. One row per market with probability, bid, ask, USD volume, liquidity, status, close time and optional price history. Closed and resolved markets too. Export to JSON, CSV or Excel. No API key.

- **URL**: https://apify.com/mrbridge/polymarket-markets-scraper.md
- **Developed by:** [MrBridge](https://apify.com/mrbridge) (community)
- **Categories:** Business, News
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.60 / 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

## Polymarket Markets Scraper

Polymarket Markets Scraper is a Polymarket scraper that collects prediction markets, with one row per market. It turns Polymarket market data into JSON, CSV or Excel. It reads the public Polymarket APIs with no account and no API key. You can also add the price history of each market.

The Console prefill uses no selector, sets `orderBy` to `volume24h` and `maxItems` to 20, and returns 20 open markets of the busiest events. The sample market is "2026 Balance of Power: R Senate, D House", with a probability of 0.225. Add a tag, a search term or an event slug to follow one subject.

### What is Polymarket Markets Scraper?

A Polymarket market is a question with two or more outcomes. The price of an outcome, in dollars per share from 0 to 1, reads as its probability.

Select markets by tag, title search, event slug or market slug, or walk the events of the whole site. Use `status` to filter markets and `orderBy` to order the events. Selectors add up, and a market found twice is returned once.

The first columns follow the same fixed prediction-market layout as the other prediction-market Actors of this family.

#### What data can I extract with it?

Each row includes the question, outcome, every outcome with its price, probability, best bid, best ask, last price, volume and 24-hour volume in USD, liquidity, status, resolution, times, tags, link and scrape time. Three Polymarket columns add `slug`, `clobTokenIds` and `resolutionSource`.

#### How can I use the results?

Track the probability of an event over time. Use closed and resolved markets to study how prices predicted outcomes. Compare the rows with other prediction-market data in one table, or load them into a dashboard or research notebook.

### How to use it

1. Choose one or more selectors, or leave them empty to walk the events of the whole site.
2. Set `status`, `orderBy` and `maxItems`. To add price history, enable `includeHistory` and choose `historyInterval` and `historyDays`.
3. Start the run, then read the default dataset or export its rows.

### Input

| Field | Meaning | Default |
|---|---|---|
| `tags` | Polymarket tags, as a slug (`crypto`) or a numeric id (`21`). Up to 100. One walk over the events of each tag | empty |
| `searchTerms` | Event title searches, any case. Up to 10. One walk over the matching events of each term | empty |
| `eventSlugs` | Events to collect. Up to 100. Every market of a named event is returned | empty |
| `marketSlugs` | Markets to collect. Up to 100 | empty |
| `status` | `active`, `closed` or `all`. Filters the walks and every market of a listed event | `active` |
| `orderBy` | Order of the events in a walk: `volume24h`, `liquidity` or `endDate` | `volume24h` |
| `maxItems` | Hard cap on market rows returned and billed, 1 to 10000 | 100 |
| `includeHistory` | Add the price history of each market | `false` |
| `historyInterval` | Size of one price point, `1h` or `1d` | `1d` |
| `historyDays` | Days of history, 1 to 365 | 30 |

The Console prefill uses this input:

```json
{
  "orderBy": "volume24h",
  "maxItems": 20
}
```

Each selector adds its own walk, and selectors add up. A market found by more than one selector is returned once.

`status` filters the walks and every market of a listed event. A named slug is returned whatever its status. Use `closed` to keep closed and resolved markets, or `all` to keep both active and closed markets.

Open events can contain placeholder markets with no price that cannot be traded. The Actor leaves them out and counts them in `filteredOut`.

`orderBy` sorts the events, not the markets inside an event. With `endDate`, `status` `active` and `all` start with the nearest end still to come. Events already past their end date are left out. For `closed`, the order starts with the most recent end. A market can already have ended while its event ends later.

Invalid input ends the run successfully with one `BAD_INPUT` row in the `errors` dataset. That row lists every problem, and the run returns no market row. This is separate from `stoppedBy` value `badInput`, which means Polymarket refused the first request as invalid.

### Output

| Field | Type | Meaning |
|---|---|---|
| `venue` | string | Always `polymarket` |
| `marketId` | string | Condition id of the market, the key of the row |
| `eventId` | string | Id of the Polymarket event the market belongs to |
| `eventTitle` | string or null | Title of that event |
| `question` | string or null | The market's own question |
| `outcome` | string or null | The side that `probability` prices, the first outcome label, `Yes` on a yes or no market |
| `outcomes` | array | Every outcome as an object `{ label, price }`. `[]` when absent |
| `probability` | number or null | 0 to 1. Midpoint of bid and ask when both exist and the spread is at most 0.10, else the last trade, else the Polymarket price of the first outcome. Null when the book has one side only, the market never traded and Polymarket gives no price |
| `bestBid`, `bestAsk`, `lastPrice` | number or null | Dollars per share, 0 to 1 |
| `volume`, `volume24h` | number or null | In US dollars, see `volumeUnit` |
| `volumeUnit` | string | Always `USD` |
| `liquidity` | number or null | In US dollars, as Polymarket reports it |
| `openInterest` | null | Always null, Polymarket does not serve it on the market listing |
| `status` | string or null | `open`, `closed` or `resolved` |
| `statusRaw` | string or null | The status as Polymarket writes it |
| `resolution` | string or null | The winning outcome label once resolved, null on a 50/50 resolution |
| `openTime`, `closeTime`, `resolvedAt` | string or null | ISO 8601 in UTC |
| `category` | null | Always null, a Polymarket market has no category. Use `tags` |
| `tags` | array | Tag labels of the event. `[]` when absent |
| `moneyType` | string | Always `real` |
| `url` | string or null | Polymarket page of the market |
| `history` | array or null | Price history, see below |
| `scrapedAt` | string | Time the row was built, ISO 8601 in UTC |
| `slug` | string or null | Slug of the market |
| `clobTokenIds` | array | Token ids of the outcomes, in the order of `outcomes`. `[]` when missing |
| `resolutionSource` | string or null | Resolution source written on the market, null when it has none |

The default dataset contains the market rows, with `overview` and `history` views. Problems go to the `errors` dataset and are never billed. The `OUTPUT` record of the key-value store summarizes the run.

Every field is always present. It is `null` when Polymarket gives no value. `outcomes`, `tags` and `clobTokenIds` use `[]` when empty.

Here is one sample row:

```json
{
  "venue": "polymarket",
  "marketId": "0x998bc71817b2d76921d1999ce0f3431cfd5945583667a371280ca2b430b0c06e",
  "eventId": "32228",
  "eventTitle": "Balance of Power: 2026 Midterms",
  "question": "2026 Balance of Power: R Senate, D House",
  "outcome": "Yes",
  "outcomes": [
    {
      "label": "Yes",
      "price": 0.225
    },
    {
      "label": "No",
      "price": 0.775
    }
  ],
  "probability": 0.225,
  "bestBid": 0.22,
  "bestAsk": 0.23,
  "lastPrice": 0.23,
  "volume": 7290511.065482998,
  "volume24h": 196782.699429,
  "volumeUnit": "USD",
  "liquidity": 2776386.1101,
  "openInterest": null,
  "status": "open",
  "statusRaw": "active",
  "resolution": null,
  "openTime": "2025-07-11T21:05:20.815Z",
  "closeTime": "2026-11-04T04:59:00.000Z",
  "resolvedAt": null,
  "category": null,
  "tags": [
    "United States",
    "Rewards 20, 4.5, 50",
    "Politics",
    "US Election",
    "Elections",
    "Midterms",
    "Earn 3.25%",
    "Main Election",
    "Global Elections",
    "Control & Seats",
    "Midterm Combos"
  ],
  "moneyType": "real",
  "url": "https://polymarket.com/event/balance-of-power-2026-midterms/2026-balance-of-power-r-senate-d-house-444",
  "history": null,
  "scrapedAt": "2026-11-02T13:00:00.000Z",
  "slug": "2026-balance-of-power-r-senate-d-house-444",
  "clobTokenIds": [
    "6302359956133594764084277082169634158291609371270652093164054687145970756151",
    "558600218792430158020964384658762756367786275998757133304987611939841005404"
  ],
  "resolutionSource": null
}
```

The sample comes from a fixture captured on 2026-11-02.

### Price history

The `history` column contains `{ t, price }` points sorted by `t`. Set `historyInterval` to `1h` or `1d`, and `historyDays` from 1 to 365 days.

For an open market, the window ends now. For a closed market, it ends at resolution or close. The window never starts before the market opened.

A row with a non-empty history is billed one extra `market-history` event. An empty list is not billed.

`history` is `null` in three cases:

1. You did not request history.
2. The market has no token id.
3. The history of that market could not be read.

An answer that cannot be parsed gives `null` and a `SCHEMA_CHANGED` row in the `errors` dataset, naming the market in `itemId`. The market row is still delivered and billed as a `market` only.

History uses one request per market, so 1 000 markets cost 1 000 more requests. Requests are at least 250 ms apart, or about 4 minutes for 1 000 histories. The run limit is 3 600 s, and collection stops 90 s before it. A run above about 5 000 markets with history can end on `deadline`. This is an estimate, not a measured threshold.

### Run it from code

You can start a run through the Apify API with a POST to the Actor's runs endpoint. After the run, read its rows as JSON from the dataset items endpoint.

If you are looking for Polymarket API documentation, this section shows how to get Polymarket market rows from this Actor in code. It is not Polymarket's documentation or a Polymarket API.

For Python, use the [Apify Python client](https://docs.apify.com/api/client/python/docs), the official library for the Apify REST API. Install it with `pip install apify-client`. It can start an Actor, wait for it to finish and list the items of its default dataset. Sync and async interfaces are available.

The Polymarket API Python workflow here uses that client to start this Actor and read its dataset, not to call a Polymarket API.

### Limits

- `status` filters the walks and every market of a listed event. A named slug is returned whatever its status.
- `orderBy` sorts the events, not the markets inside an event. For `endDate`, `active` and `all` start with the nearest future end, while `closed` starts with the most recent end. A market can already have ended while its event ends later.
- History adds one request per market, so 1 000 markets cost 1 000 more requests. Requests are at least 250 ms apart. The run limit is 3 600 s, with collection stopping 90 s before it. A run above about 5 000 markets with history can end on `deadline`, an unmeasured estimate.
- `probability` uses the bid-ask midpoint when the spread is 0.10 or less, else the last trade, else the Polymarket price of the first outcome. `probability` is null when the book has one side only, the market never traded and Polymarket gives no price.
- `openInterest` and `category` are always null.
- The request cap is 1 000 requests, plus `maxItems` when `includeHistory` is on. A run that needs more requests ends with `stoppedBy` set to `pageBudget`. This is a stop reason, not a setting or input.
- Cloudflare can refuse requests, producing `TARGET_BLOCKED` rows. Too many blocked responses in a row stop the run with `circuitOpen`. Network errors, timeouts, server errors and 429 responses get at most 3 attempts, with `Retry-After` respected.
- After a reboot, `marketsCharged` can count one row too many. The billed events are the reference. Each run is a snapshot.

### Billing

Each delivered row bills one `market` event. A row with a non-empty history bills one extra `market-history` event. Errors, duplicates, filtered-out listings and empty histories are never billed. Current prices are listed on the Pricing tab.

A moved or restarted run resumes. A market already returned is neither returned nor billed again.

### Run summary and early stops

The `OUTPUT` record summarizes the run. Its counters include `filteredOut`, `duplicatesSkipped` and `marketsCharged`.

A market listed by two walks is returned once, counted in `duplicatesSkipped`, and not billed again.

`stoppedBy` keeps only the first stop reason. Its 8 values are:

- `null`: all the requested work was done.
- `maxItems`: the cap was reached.
- `chargeLimit`: the maximum charge set for the run was reached.
- `deadline`: the run reached its internal time limit.
- `circuitOpen`: too many blocked responses arrived in a row.
- `pageBudget`: the request cap was spent.
- `badInput`: Polymarket refused the first request as invalid. This is not the input check that produces `BAD_INPUT`.
- `fetchFailed`: the last walk ended on a page that could not be fetched. `failedWalks` lists the first 20 failed walks.

The `errors` dataset has 8 error kinds, including a `NOT_FOUND` row with the slug in `itemId`.

### Frequently asked questions

#### Why did I get fewer rows than `maxItems`?

`maxItems` is a hard cap, not a guaranteed row count. Duplicate removal, placeholder markets, status filtering and early stops can leave fewer rows.

#### Why are markets missing from an open event?

Open events can contain placeholder markets with no price that cannot be traded. The Actor leaves them out and counts them in `filteredOut`.

#### Why is `probability` empty?

The Actor uses the bid-ask midpoint when the spread is 0.10 or less, else the last trade, else the Polymarket price of the first outcome. `probability` is null when the book has one side only, the market never traded and Polymarket gives no price.

#### Can I use this Actor through MCP?

Yes. Any Apify Actor can be called from an MCP client through the Apify MCP server. See the [Apify MCP documentation](https://docs.apify.com/platform/integrations/mcp) for the setup.

#### Need real-time interactive access?

For live questions from an AI assistant, such as the latest news and prediction market signals, use the [Latest News MCP Server](https://apify.com/mrbridge/latest-news-mcp-server). This Actor is built for batch runs and datasets.

#### Your feedback

We're always working on improving the performance of our Actors. So if you've got any technical feedback for Polymarket Markets Scraper or simply found a bug, please create an issue on the Actor's [Issues tab](https://apify.com/mrbridge/polymarket-markets-scraper/issues).

An honest review helps the next users decide. You can also bookmark this Actor, and use the Issues tab for bugs or other problems.

More free tools, scrapers, MCP servers and data studies from the same team: [mr-bridge.com](https://mr-bridge.com).

### Related Actors

- [`kalshi-markets-scraper`](https://apify.com/mrbridge/kalshi-markets-scraper) is a separate MrBridge Actor that collects markets from Kalshi.
- [`kalshi-weather-markets-scraper`](https://apify.com/mrbridge/kalshi-weather-markets-scraper) is a separate MrBridge Actor that collects weather markets from Kalshi.

### Legal & responsible use

The Actor reads the public Polymarket APIs. Polymarket is a trademark of its owner. This Actor is not affiliated with or endorsed by Polymarket.

Polymarket's terms may restrict automated access, commercial reuse or access from some countries. Check those terms and the law that applies to you. Prices are information, not financial advice.

# Changelog

This Actor's version history is a separate document: https://apify.com/mrbridge/polymarket-markets-scraper/changelog.md

# Actor input Schema

## `tags` (type: `array`):

Polymarket tags, as a slug (crypto) or a numeric id (21). Up to 100. One walk over the events of each tag.

## `searchTerms` (type: `array`):

Event title searches, any case. Up to 10. One walk over the matching events of each term.

## `eventSlugs` (type: `array`):

Events to collect, for example which-party-will-win-the-house-in-2026. Up to 100. Every market of a named event is returned whatever its status.

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

Markets to collect, for example will-the-democratic-party-control-the-house-after-the-2026-midterm-elections. Up to 100. A named market is returned whatever its status.

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

Status filter of the event walks (no selector, tags, search terms). It also applies to every market of a listed event: active keeps the open markets that can be traded, closed keeps the closed and resolved ones. A slug you name is returned whatever its status.

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

Order of the events in a walk: 24-hour volume (largest first), liquidity (largest first) or end date. With the end date, active and all markets start with the nearest end still to come (events already past their end date are left out), closed markets start with the most recent end. It orders the events, not the markets inside an event.

## `maxItems` (type: `integer`):

Hard cap on the market rows returned and billed, from 1 to 10000. The run stops once that many rows are delivered.

## `includeHistory` (type: `boolean`):

Fill the history column with the price of the market over time, one request per market. A row whose history is not empty is billed one extra market-history event. A row with no price points (history is an empty list) is not billed. Without this option, or when the history of a market cannot be read, history is null.

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

Size of one price point, one hour or one day. Used only when price history is on. It does not change the number of requests: there is one per market.

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

How many days back the history goes, from 1 to 365. Used only when price history is on. For a closed market the window ends at its resolution or close time.

## Actor input object example

```json
{
  "tags": [],
  "searchTerms": [],
  "eventSlugs": [],
  "marketSlugs": [],
  "status": "active",
  "orderBy": "volume24h",
  "maxItems": 20,
  "includeHistory": false,
  "historyInterval": "1d",
  "historyDays": 30
}
```

# Actor output Schema

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

Direct link to all dataset items produced by the run.

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

Direct link to the OUTPUT record: requests made, markets read, returned and billed, errors by kind and the reason of an early stop.

# 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 = {
    "orderBy": "volume24h",
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("mrbridge/polymarket-markets-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 = {
    "orderBy": "volume24h",
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("mrbridge/polymarket-markets-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 '{
  "orderBy": "volume24h",
  "maxItems": 20
}' |
apify call mrbridge/polymarket-markets-scraper --silent --output-dataset

```

## MCP server setup

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