# Polymarket API Scraper (`devilscrapes/polymarket-markets-scraper`) Actor

Polymarket API Scraper: export Polymarket prediction markets as clean rows: question, outcomes, live Yes/No prices, best bid and ask, volume, liquidity, end dates, IDs and market URLs. Open or closed markets, sorted by volume, liquidity, newest or ending soon. Pay per market row.

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

## Pricing

from $2.64 / 1,000 result emitteds

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

<div align="center">
  <img src=".actor/icon.svg" width="160" alt="Devil Scrapes mark" />

## Polymarket Prediction Markets Scraper

**💰 $3.20 / 1 000 markets**  ·  pay per result, plus a $0.20 start fee per run, charged only once the first markets are in your dataset

*We do the dirty work so your dataset stays clean.* 😈

Export Polymarket prediction markets as clean rows: question, outcomes, live Yes/No prices, best bid and ask, volume, liquidity, end dates, IDs and market URLs. Open or closed markets, sorted by volume, liquidity, newest or ending soon. Pay per market row.

</div>

***

### 🎯 What this scrapes

Pulls Polymarket's public market catalogue into one typed dataset row per market: the question, its outcomes and current prices, best bid and ask, last trade, spread, volume, liquidity, open and close dates, the on-chain identifiers and the public market URL. Pick open or closed markets, a sort order and a row cap; we page through the source, continue past its offset ceiling, deduplicate and hand you a dataset ready for a model, a dashboard or a story.

### 🔥 What we handle for you

- 📄 **Pagination done right** - 100 markets per request, the source's offset ceiling handled by switching to cursor paging, duplicates removed by market id.
- 🔢 **Typed rows** - outcomes, prices and token ids arrive from the source as text inside text; you get real arrays, numbers and ISO-8601 dates, plus the public market URL.
- 🔁 **Retries with backoff** on temporary failures, Retry-After honoured, requests paced inside the source's published rate limit.
- 🧾 **Honest empty answers** - a filter that matches nothing finishes successfully with zero rows and no charge; a block or a changed response fails loudly instead.
- 💰 **Pay-Per-Event pricing** - the $0.20 start fee is charged only once the first batch of markets is in your dataset, then $0.003 per market row; a run that delivers nothing costs nothing.

### 💡 Use cases

- **Odds snapshots for models and dashboards** - export the open markets every morning and track how prices move on the questions you follow.
- **Cross-exchange comparison** - pair this dataset with our Kalshi Prediction Markets Scraper to compare odds on the same events across two exchanges.
- **Research datasets** - pull every open or closed market with volume, liquidity and dates for a study of forecasting accuracy or market behaviour.
- **Newsroom odds tables** - get the day's election, economics and geopolitics odds as rows you can sort, filter and quote.
- **Alerting pipelines** - schedule a run, push the dataset to your sheet or webhook, and flag markets whose price moved past a threshold.

### ⚙️ How to use it

1. Click **Try for free** at the top of the page.
2. Fill in the input form — most fields have sensible defaults.
3. Click **Start**. Output streams into the run's dataset.
4. Export from **Storage → Dataset** as JSON, CSV, or Excel — or fetch via the API.

### 📥 Input

| Field | Type | Required | Default | Notes |
|---|---|:--:|---|---|
| `marketStatus` | `string` | no | 'open' | Open markets are the ones trading now. Closed markets have ended or resolved; there are many of them, so set the market… |
| `sortBy` | `string` | no | 'volume' | The order in which markets are exported. Exact for the first 2,400 markets; beyond that the source only allows cursor… |
| `maxMarkets` | `integer` | no | 1000 | How many markets to export at most (1 to 20,000). Each market row is billed; 100 markets is one request to the source, 1,000 is ten. |
| `proxyConfiguration` | `object` | no | {'useApifyProxy': True} | Apify Proxy settings. The default datacenter proxy is sufficient for this public source; residential proxies cost more… |

#### Example input

```json
{
  "marketStatus": "open",
  "sortBy": "volume",
  "maxMarkets": 100,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

### 📤 Output

Every row is one dataset item.

| Field | Type | Notes |
|---|---|---|
| `market_id` | `string` | The market's id in the source catalogue, as text. Stable across runs; one row per market. |
| `question` | `string` | The question the market resolves, for example "Will the U.S. invade Iran before 2027?". |
| `slug` | `string` | The market's slug in the source; the last part of its public URL. |
| `market_url` | `string` | The public page of the market on polymarket.com. |
| `condition_id` | `['string', 'null']` | The market's on-chain condition identifier (0x-prefixed), or null when the source does not give one. |
| `event_id` | `['string', 'null']` | The id of the event this market belongs to, as text, or null. |
| `event_title` | `['string', 'null']` | The title of the event this market belongs to, or null. |
| `event_slug` | `['string', 'null']` | The slug of the event this market belongs to, or null. |
| `outcomes` | `['array', 'null']` | The market's outcomes in order, for example \["Yes", "No"], or null when the source gives none. |
| `outcome_prices` | `['array', 'null']` | The current price of each outcome (0 to 1, same order as outcomes), or null. |
| `yes_price` | `['number', 'null']` | The current price of the first outcome (usually Yes), 0 to 1, or null. |
| `best_bid` | `['number', 'null']` | Best bid on the first outcome, 0 to 1, or null. |
| `best_ask` | `['number', 'null']` | Best ask on the first outcome, 0 to 1, or null. |
| `last_trade_price` | `['number', 'null']` | Price of the last trade on the first outcome, 0 to 1, or null. |
| `spread` | `['number', 'null']` | Bid-ask spread on the first outcome, or null. |
| `volume_usd` | `['number', 'null']` | Total traded volume in USD, or null. |
| `volume_24h_usd` | `['number', 'null']` | Traded volume in the last 24 hours in USD, or null. |
| `volume_1wk_usd` | `['number', 'null']` | Traded volume in the last week in USD, or null. |
| `liquidity_usd` | `['number', 'null']` | Current liquidity in USD, or null. |
| `one_day_price_change` | `['number', 'null']` | Change of the first outcome's price over the last day, or null. |
| `active` | `boolean` | Whether the source lists the market as active. |
| `closed` | `boolean` | Whether the market has closed (ended or resolved). |
| `accepting_orders` | `['boolean', 'null']` | Whether the market accepts orders right now, or null. |
| `start_date` | `['string', 'null']` | When trading started, ISO 8601, or null. |
| `end_date` | `['string', 'null']` | When the market ends, ISO 8601, or null. |
| `created_at` | `['string', 'null']` | When the market was created in the source, ISO 8601, or null. |
| `updated_at` | `['string', 'null']` | When the source last updated the market, ISO 8601, or null. |
| `resolution_source` | `['string', 'null']` | The stated resolution source, or null when the source gives none. |
| `description` | `['string', 'null']` | The market's description and resolution rules, or null. |
| `image_url` | `['string', 'null']` | URL of the market's image, or null. |
| `clob_token_ids` | `['array', 'null']` | The order-book token id of each outcome, same order as outcomes, or null. |
| `scraped_at` | `string` | When this row was read, ISO 8601 UTC. |

#### Example output

```json
{
  "market_id": "665374",
  "question": "Will the U.S. invade Iran before 2027?",
  "slug": "will-the-us-invade-iran-before-2027",
  "market_url": "https://polymarket.com/event/will-the-us-invade-iran-before-2027/will-the-us-invade-iran-before-2027",
  "condition_id": "0x5db999fad322cea2914535aae5517060c3f80ad6d8c0231cde2124a434d16846",
  "event_id": "73130",
  "event_title": "Will the U.S. invade Iran before 2027?",
  "event_slug": "will-the-us-invade-iran-before-2027",
  "outcomes": [
    "Yes",
    "No"
  ],
  "outcome_prices": [
    0.185,
    0.815
  ],
  "yes_price": 0.185,
  "best_bid": 0.18,
  "best_ask": 0.19,
  "last_trade_price": 0.18,
  "spread": 0.01,
  "volume_usd": 75692053.46,
  "volume_24h_usd": 70931.49,
  "volume_1wk_usd": 788881.79,
  "liquidity_usd": 414711.38,
  "one_day_price_change": 0.01,
  "active": true,
  "closed": false,
  "accepting_orders": true,
  "start_date": "2025-11-05T17:52:17.414Z",
  "end_date": "2027-01-01T04:59:00Z",
  "created_at": "2025-11-04T19:52:57.799278Z",
  "updated_at": "2026-10-28T21:30:45.724392Z",
  "resolution_source": null,
  "description": "This market will resolve to \"Yes\" if the United States commences a military offensive intended to establish control over any portion of Iran by December 31, 2026, 11:59 PM ET. Otherwise, this market will resolve to \"No\".",
  "image_url": "https://polymarket-upload.s3.us-east-2.amazonaws.com/will-the-us-invade-iran-in-2025-0Eh3J0ku_Fbj.jpg",
  "clob_token_ids": [
    "55115078421062885512539156303747803058407616201213034911037320915726138659123",
    "19108300103875659716500983734885925174443565557548117405693580406153530846009"
  ],
  "scraped_at": "2026-10-28T21:30:50+00:00"
}
```

### 💰 Pricing

Pay-Per-Event — you pay only when these events fire:

| Event | USD | What it is |
|---|---:|---|
| `actor-start` | $0.20 | Charged once per run, when the first batch of market rows is written to your dataset. A run that delivers no rows is not charged. |
| `result` | $0.003 | Charged once for each market row written to your dataset. |

Examples: the 100-market default prefill costs $0.50; 1 000 markets cost **$3.20**; a run that matches nothing costs nothing.

### 🚧 Limitations

- Prices come from the source's public catalogue, which is served through an edge cache of up to five minutes; this is not a live order book or a trading tool.
- Sorting applies to the first 2,400 markets; beyond that the source paginates by cursor in its own order, and the Actor continues that way with duplicates removed.
- Closed markets are many: set maxMarkets with care when exporting them, since each market row is billed.
- Order-book depth, trade history, comments and holder positions are not exported; this Actor covers the market catalogue and its current prices.
- The source can change its public interface or its terms without notice; a changed shape fails the run loudly rather than delivering partial or wrong rows.

### ❓ FAQ

**How current are the prices?**

Each row carries the source's own updated_at stamp and our scraped_at time. The source serves its catalogue through an edge cache of up to five minutes, so a price can be a few minutes old. Schedule the Actor as often as you need a fresh snapshot.

**What is the difference between a market and an event?**

An event groups related markets (for example one question per candidate). Each row is one market and carries its event's id, title and slug, so you can group rows yourself.

**How many markets can one run export?**

Up to 20,000 (the maxMarkets input). The first 2,400 follow your chosen sort order exactly; beyond that the source only allows cursor paging in its own order, so we continue in that order, remove duplicates and tell you in the run status.

**What happens when nothing matches?**

If the source answers that no market matches your filters, the run finishes successfully with zero rows and a status message saying so, and nothing is charged. A blocked or broken response fails the run instead of pretending to be empty.

**Do I need a Polymarket account or API key?**

No. The catalogue is public data; nothing is read from your account and the Actor never trades.

### 💬 Your feedback

Spotted a bug, hit a weird edge case, or need a new field? Open an
issue on the Actor's **Issues** tab on Apify Console — we read every report.

***

<div align="center">

Built by **[Devil Scrapes](https://apify.com/DevilScrapes)** 😈 — a small fleet of
opinionated public-data Actors. Honest pricing, real engineering, zero fine print.

</div>

# Changelog

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

# Actor input Schema

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

Open markets are the ones trading now. Closed markets have ended or resolved; there are many of them, so set the market cap with care.

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

The order in which markets are exported. Exact for the first 2,400 markets; beyond that the source only allows cursor paging in its own order.

## `maxMarkets` (type: `integer`):

How many markets to export at most. Each market row is billed; 100 markets is one request to the source, 1,000 is ten.

## `proxyConfiguration` (type: `object`):

Apify Proxy settings. The default datacenter proxy is sufficient for this public source; residential proxies cost more and are not needed.

## Actor input object example

```json
{
  "marketStatus": "open",
  "sortBy": "volume",
  "maxMarkets": 100,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

All dataset items as JSON.

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

Same data exported to CSV.

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

Open the run dataset in the Console.

# 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 = {
    "maxMarkets": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("devilscrapes/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 = { "maxMarkets": 100 }

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

```

## MCP server setup

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