# Polymarket Scraper - Prediction Market Odds, Volume & Events (`hichemdev/polymarket-scraper`) Actor

Scrape Polymarket prediction markets: live odds per outcome, 24h and total volume, liquidity, bid/ask, price changes, end dates, tags and optional price history. Search by keyword or category, browse top events, or look up market URLs. No API key needed.

- **URL**: https://apify.com/hichemdev/polymarket-scraper.md
- **Developed by:** [Hichem Ben Moussa](https://apify.com/hichemdev) (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 $2.00 / 1,000 markets

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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 Scraper — Prediction Market Odds, Volume & Events

Export **live Polymarket prediction-market data** — the implied probability of every outcome, 24-hour and all-time trading volume, liquidity, best bid/ask, price moves, end dates, categories and, optionally, the full price history — into JSON, CSV or Excel.

Polymarket is the largest prediction market: traders bet real money on elections, central-bank decisions, crypto prices, sports, geopolitics and pop culture, and the resulting prices are widely quoted as crowd-sourced odds. This actor reads Polymarket's own public data API, so no account, API key or proxy is needed.

### Who it's for

- **Traders and quant / crypto researchers** — pull every active market with bid, ask, spread, liquidity and token IDs, or a price-history series to backtest against.
- **Journalists and analysts** — "What are the odds of a Fed cut in December?" Search a keyword and get the current probability, how it moved in the last 24 hours, and a link to the market.
- **Dashboards and newsletters** — schedule a run to track the most-traded markets of the day, or a watch-list of specific markets.
- **Academics** — closed markets come with the winning outcome, so you can study how well prediction markets forecast.

### Three modes

| Mode | What you get |
|---|---|
| **Markets** (default) | One row per market (a single question such as *"Will the Fed cut rates in December?"*). Browse all markets or search by keyword, filter by category tag, status, 24h volume and liquidity, sort by 24h volume, total volume, liquidity, ending soon or newest. |
| **Events** | One row per event (e.g. *"Democratic Presidential Nominee 2028"*) with its markets nested inside, sorted by probability, plus the event's leading outcome, total volume, liquidity, open interest and comment count. |
| **Specific markets** | Paste polymarket.com links, slugs, market IDs or condition IDs. An event link returns every market in that event. |

### Example input

Top 15 markets by 24-hour volume (the default prefill):

```json
{
  "mode": "markets",
  "status": "active",
  "sortBy": "volume24hr",
  "maxItems": 15
}
```

Search for Bitcoin markets with a week of hourly price history:

```json
{
  "mode": "markets",
  "searchQuery": "bitcoin",
  "includePriceHistory": true,
  "priceHistoryInterval": "1w",
  "maxItems": 50
}
```

Biggest crypto events with their nested markets:

```json
{
  "mode": "events",
  "tag": "crypto",
  "sortBy": "volume",
  "maxItems": 20
}
```

Specific markets:

```json
{
  "mode": "urls",
  "urls": [
    "https://polymarket.com/event/democratic-presidential-nominee-2028",
    "https://polymarket.com/event/presidential-election-winner-2024/will-donald-trump-win-the-2024-us-presidential-election"
  ]
}
```

Resolved politics markets, biggest first:

```json
{
  "mode": "markets",
  "status": "closed",
  "tag": "politics",
  "sortBy": "volume"
}
```

### Example output (market)

```json
{
  "recordType": "market",
  "marketId": "3215008",
  "question": "Will the Fed increase interest rates by 25 bps after the December 2026 meeting?",
  "slug": "will-the-fed-increase-interest-rates-by-25-bps-after-the-december-2026-meeting-20260729232808636",
  "url": "https://polymarket.com/event/fed-decision-in-december-20260729232808632/will-the-fed-increase-interest-rates-by-25-bps-after-the-december-2026-meeting-20260729232808636",
  "eventTitle": "Fed Decision in December?",
  "eventSlug": "fed-decision-in-december-20260729232808632",
  "eventId": "770450",
  "groupItemTitle": "25 bps increase",
  "outcomes": [
    {
      "outcome": "Yes",
      "price": 0.785,
      "tokenId": "111662129652828266889360374468657435151479595863413519836161861837506140152890"
    },
    {
      "outcome": "No",
      "price": 0.215,
      "tokenId": "94483965432909797688470702512207472940215538148754820061518518664128018848687"
    }
  ],
  "yesPrice": 0.785,
  "leadingOutcome": "Yes",
  "leadingPrice": 0.785,
  "lastTradePrice": 0.79,
  "bestBid": 0.78,
  "bestAsk": 0.79,
  "spread": 0.01,
  "oneHourPriceChange": 0.01,
  "oneDayPriceChange": 0.145,
  "oneWeekPriceChange": 0.08,
  "volume": 4985134.79,
  "volume24hr": 1141847.34,
  "volume1wk": 2821527.02,
  "volume1mo": 4243295.43,
  "liquidity": 267263.07,
  "startDate": "2026-07-30T00:55:13.207Z",
  "endDate": "2026-12-09T23:59:00.000Z",
  "createdAt": "2026-07-30T00:36:57.524Z",
  "active": true,
  "closed": false,
  "acceptingOrders": true,
  "negRisk": true,
  "tags": [
    "Fed",
    "fomc",
    "Trump",
    "Economy",
    "Fed Rates",
    "Kevin Warsh",
    "Global Rates",
    "Economic Policy",
    "Macro Indicators",
    "Recurring"
  ],
  "description": "The FED interest rates are defined in this market by the upper bound of the target federal funds range. The decisions on the target federal funds range are made by the Federal Open Market Committee…",
  "resolutionSource": "https://www.federalreserve.gov/monetarypolicy/fomccalendars.htm",
  "image": "https://polymarket-upload.s3.us-east-2.amazonaws.com/fed-decision-in-september-762-c4RyWuxRPo1L.jpg",
  "conditionId": "0x8a4196617dcb703e49d9bb36d3847bf6a75fd364dbd19f8d408ac944bf1a03d8",
  "questionId": "0xa74f5328517db0e030a5e62edc800e37bd36ca6e455571b14e8bb2b0dd38d703",
  "clobTokenIds": [
    "111662129652828266889360374468657435151479595863413519836161861837506140152890",
    "94483965432909797688470702512207472940215538148754820061518518664128018848687"
  ],
  "scrapedAt": "2026-11-06T18:46:12.202Z",
  "priceHistoryOutcome": "Yes",
  "priceHistory": [
    {
      "timestamp": "2026-11-06T18:00:31.000Z",
      "price": 0.775
    },
    {
      "timestamp": "2026-11-06T18:44:19.000Z",
      "price": 0.785
    }
  ]
}
```

*(Example from a real run with price history on; `description` and `priceHistory` shortened here.)*

### Market fields

| Field | Description |
|---|---|
| `question` | The market question |
| `url` | Link to the market on polymarket.com |
| `eventTitle`, `eventSlug`, `eventId` | The event the market belongs to |
| `groupItemTitle` | Short label inside a multi-market event, e.g. a candidate's name |
| `outcomes` | Array of `{ outcome, price, tokenId }` — price is the implied probability (0–1) |
| `yesPrice` | Probability of *Yes* for Yes/No markets (null for e.g. team-vs-team markets) |
| `leadingOutcome`, `leadingPrice` | The outcome with the highest price and its probability |
| `lastTradePrice`, `bestBid`, `bestAsk`, `spread` | Order-book prices |
| `oneHourPriceChange`, `oneDayPriceChange`, `oneWeekPriceChange` | Price moves, in probability points (0.05 = 5 points) |
| `volume`, `volume24hr`, `volume1wk`, `volume1mo` | Trading volume in USD |
| `liquidity` | Order-book liquidity in USD |
| `startDate`, `endDate`, `createdAt` | ISO 8601 timestamps |
| `active`, `closed`, `acceptingOrders`, `negRisk` | Status flags |
| `closedTime`, `winningOutcome` | Only on closed markets — when trading ended and which outcome settled at 1 |
| `tags` | Polymarket category tags, e.g. Politics, Crypto, Sports |
| `description` | Resolution rules (trimmed to 1,500 characters) |
| `resolutionSource`, `image` | Source used to resolve the market, and its image |
| `conditionId`, `questionId`, `clobTokenIds` | On-chain / CLOB identifiers for trading and joining with other data |
| `priceHistory`, `priceHistoryOutcome` | Optional: `[{ timestamp, price }]` for the first outcome (usually Yes) |

Event rows (Events mode) carry `eventTitle`, `url`, `leadingOutcome`, `leadingPrice`, `marketsCount`, `activeMarketsCount`, `volume`, `volume24hr`, `volume1wk`, `volume1mo`, `liquidity`, `openInterest`, `commentCount`, dates, `tags`, `description` and a nested `markets` array. `leadingOutcome` is filled only where it means something: single-market events and *winner-takes-all* events (e.g. who wins a nomination). Price-ladder events such as *"What price will Bitcoin hit in 2026?"* have independent markets and no single leader, so it is null there.

### Caveats

- Prices are probabilities between 0 and 1 (0.62 = 62%), as quoted on Polymarket at the time of the run. They move constantly; schedule the actor if you need snapshots over time.
- Volume and liquidity figures come straight from Polymarket. Occasionally Polymarket reports a brand-new market's 24h volume equal to its total volume; the actor does not alter source numbers.
- Keyword search uses Polymarket's own search, which matches events. In Markets mode the actor takes the markets of the best-matching events and ranks them by your sort order.
- Category tags are Polymarket's. Some markets carry many tags, including a few internal ones; the actor drops the obvious internal labels and keeps at most 12.
- Price history needs one extra request per market, so very large runs with history on are slower.

### FAQ

**Do I need a Polymarket account or API key?** No. The actor uses Polymarket's public read-only API.

**Can I place trades with it?** No. It only reads market data.

**How do I find a tag slug?** Open a category on polymarket.com — the last part of the link (e.g. `crypto`, `politics`, `sports`) is the slug.

**Does it include resolved markets?** Yes — set *Market status* to *Closed* or *All*. Closed markets include `winningOutcome` and `closedTime`.

**How fresh is the data?** Live: every run queries Polymarket at that moment.

# Actor input Schema

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

Markets: one row per market (a single Yes/No question or outcome) with its odds. Events: one row per event (e.g. 'Fed decision in December') with all its markets nested inside. Specific markets: look up the Polymarket URLs, slugs or IDs you list below.

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

Optional keyword, e.g. bitcoin, trump, fed, election, nba. Uses Polymarket's own search. Leave empty to browse all markets or events sorted by the order below.

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

Optional Polymarket tag slug to filter by, e.g. politics, crypto, sports, economy, tech, geopolitics, elections, bitcoin. This is the last part of a polymarket.com category link.

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

Active = still trading. Closed = trading ended (includes resolved markets with the winning outcome). All = both.

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

Order of results. Ending soon only returns markets or events whose end date is in the future.

## `urls` (type: `array`):

Polymarket links such as https://polymarket.com/event/<event-slug> (returns every market in the event) or https://polymarket.com/event/<event-slug>/<market-slug>, plus bare market or event slugs, numeric market IDs or 0x condition IDs.

## `minVolume24hr` (type: `integer`):

Optional. Skip markets or events that traded less than this many dollars in the last 24 hours.

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

Optional. Skip markets or events with less order-book liquidity than this.

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

Markets and specific-markets modes: add a priceHistory array (timestamp + probability of the first outcome, usually Yes) from Polymarket's CLOB. Adds one request per market, so runs are slower.

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

Time range for the price history. Points are hourly for 1 day and 1 week, every 6 hours for 1 month and daily for all time.

## `maxMarketsPerEvent` (type: `integer`):

Events mode: cap the nested markets array per event (sorted by probability, highest first). Large events such as presidential nominations hold 100+ markets.

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

Stop after this many dataset rows (markets or events).

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

Optional. A proxy is not required: Polymarket's public API works without one.

## Actor input object example

```json
{
  "mode": "markets",
  "status": "active",
  "sortBy": "volume24hr",
  "includePriceHistory": false,
  "priceHistoryInterval": "1w",
  "maxMarketsPerEvent": 50,
  "maxItems": 15
}
```

# Actor output Schema

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

All scraped items as JSON.

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

Browse results in the Apify 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 = {
    "mode": "markets",
    "status": "active",
    "sortBy": "volume24hr",
    "maxItems": 15
};

// Run the Actor and wait for it to finish
const run = await client.actor("hichemdev/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 = {
    "mode": "markets",
    "status": "active",
    "sortBy": "volume24hr",
    "maxItems": 15,
}

# Run the Actor and wait for it to finish
run = client.actor("hichemdev/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 '{
  "mode": "markets",
  "status": "active",
  "sortBy": "volume24hr",
  "maxItems": 15
}' |
apify call hichemdev/polymarket-scraper --silent --output-dataset

```

## MCP server setup

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