# Polymarket Scraper — Odds, Volume & Liquidity API (`cleanrows/polymarket-markets-scraper`) Actor

Screen Polymarket prediction markets by price movement or time to close, or fetch specific markets by slug or condition ID. Implied probability, favoured outcome, bid/ask spread, volume and liquidity come back as real numbers and arrays - not the JSON-encoded strings the source returns.

- **URL**: https://apify.com/cleanrows/polymarket-markets-scraper.md
- **Developed by:** [Abhinav Gupta](https://apify.com/cleanrows) (community)
- **Categories:** Automation, Developer tools, News
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 market scrapeds

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?

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

## Polymarket Scraper — odds, volume and liquidity in one clean schema

Scrape **Polymarket** prediction markets with the numbers already parsed: implied
probability, the favoured outcome, bid/ask spread, 24-hour and lifetime volume,
and resting liquidity.

### Why this one

Polymarket's API returns several fields as **JSON-encoded strings inside JSON**.
`outcomes` arrives as `'["Yes", "No"]'` and `outcomePrices` as
`'["0.0065", "0.9935"]'`. Prices and volumes arrive as strings too. Every buyer
ends up writing the same unwrapping code before they can do anything.

This does it once:

- **Real arrays and real numbers.** `outcomes` is an array, `outcomePrices` is an
  array of numbers, volumes are numbers you can sort on.
- **`impliedProbability`** — the Yes price as a percentage, which is the number
  most people actually want and no field gives you directly.
- **`topOutcome` and `topOutcomePrice`** — the favourite and its price, for *any*
  market. About a third of markets are not Yes/No (`Fritz vs Nakashima`), so a
  Yes-only field is blank for them. These are populated on every row.
- **A working `url`.** Built from the parent event slug, which the market object
  only carries in a nested array.
- **Stable columns.** Missing values are `null`, never absent, so CSV exports line
  up and downstream code does not break.

### Screening, not just listing

The two questions a trader actually asks are "what is moving" and "what closes
soon". Both are now filters rather than something you post-process:

- **`minPriceChangePct`** keeps markets that have moved at least N percentage
  points across any available window. Direction is ignored — a market down 8
  points passes a threshold of 5 — because a screen is about magnitude and the
  signed values are on the row anyway. `priceChangePct` carries the largest
  absolute move; the source has day, week and month windows, and despite the
  naming there is no hourly one.
- **`maxMinutesUntilEnd`** keeps markets closing within a window.
  `minutesUntilEnd` is on every row. Markets with no end date are excluded
  rather than treated as closing now — plenty have none, and the obvious
  implementation quietly sweeps them all into "closing soon".

**Direct lookup.** `marketSlugs` fetches specific markets by slug, one request
each, without walking the catalogue to filter it down. `conditionIds` does the
same by on-chain id, though that one has no server-side filter so it pages.

### Input

```json
{
  "status": "active",
  "searchQuery": "fed",
  "orderBy": "volume24hr",
  "minVolume": 1000,
  "minLiquidity": 0,
  "maxItems": 500
}
```

`status` is `active`, `closed` or `all`. `orderBy` is `volume24hr`, `volume`,
`liquidity` or `none`. `searchQuery` matches the question and the event title.

### Output

One row per market:

```json
{
  "marketId": "559651",
  "question": "Will the Fed decrease interest rates by 25 bps after the September meeting?",
  "url": "https://polymarket.com/event/fed-decision-in-september/fed-decrease-25-bps",
  "eventTitle": "Fed decision in September",
  "outcomes": ["Yes", "No"],
  "outcomePrices": [0.0105, 0.9895],
  "topOutcome": "No",
  "topOutcomePrice": 0.9895,
  "yesPrice": 0.0105,
  "noPrice": 0.9895,
  "impliedProbability": 1.05,
  "bestBid": 0.01, "bestAsk": 0.011, "spread": 0.001,
  "volumeTotal": 48211900.4, "volume24hr": 1458896.2, "liquidity": 402113.9,
  "startDate": "2026-07-30T00:00:00.000Z",
  "endDate": "2026-09-17T00:00:00.000Z",
  "active": true, "closed": false, "acceptingOrders": true,
  "conditionId": "0x7d0a...",
  "clobTokenIds": ["27146...", "33212..."]
}
```

`clobTokenIds` are included so you can go straight to the CLOB order book for a
specific outcome without a second lookup.

A `RUN_SUMMARY` record reports how many markets were scanned, matched and delivered.

### Who this is for

- **Traders and quants** tracking odds movement, spreads and liquidity
- **Researchers** studying prediction-market accuracy against real outcomes
- **Journalists and analysts** citing market-implied odds on elections, rates or sport
- **Arbitrage** against other venues, using bid/ask rather than last trade

### Notes

- Reads Polymarket's **public Gamma API**. No login, no cookies, no CAPTCHA
  solving, no proxies.
- Prices are point-in-time. Schedule the Actor if you want a series.
- `impliedProbability` is null for markets that are not Yes/No, by design. Use
  `topOutcome` and `topOutcomePrice` for those.

# Actor input Schema

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

Which markets to return. Active markets are open and still trading. Active excludes markets whose end date has already passed - Polymarket keeps flagging those active for weeks after they settle. Use closed or all to see them.

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

Keep only markets whose question or event title contains this text (case-insensitive). Leave empty for all.

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

Fetch specific markets by slug, the last path segment of a Polymarket URL. Any other filter then applies within that set.

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

Fetch specific markets by on-chain condition id. Combined with Market slugs if both are given.

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

Sort order requested from Polymarket, highest first.

## `minVolume` (type: `integer`):

Drop markets below this lifetime volume. Useful for filtering out dormant markets.

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

Drop markets with less than this much resting liquidity.

## `minPriceChangePct` (type: `integer`):

Keep only markets that have moved at least this much, in percentage points, across any available window - hour, day, week or month. Direction is ignored; a market down 8 points passes a threshold of 5. Markets with no price-change data are excluded rather than assumed still.

## `maxMinutesUntilEnd` (type: `integer`):

Keep only markets closing within this many minutes. Markets already past their end date, or with no end date at all, are excluded. 0 disables the filter.

## `tagId` (type: `integer`):

Restrict to one Polymarket tag (category). Leave empty for every category.

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

Stop after this many markets. 0 means no limit.

## Actor input object example

```json
{
  "status": "active",
  "searchQuery": "",
  "marketSlugs": [],
  "conditionIds": [],
  "orderBy": "volume24hr",
  "minVolume": 0,
  "minLiquidity": 0,
  "minPriceChangePct": 0,
  "maxMinutesUntilEnd": 0,
  "maxItems": 500
}
```

# Actor output Schema

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

One row per market: question, outcomes, prices, implied probability, spread, volume and liquidity.

## `runSummary` (type: `string`):

How many markets were scanned, matched the filters and were delivered.

# 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 = {};

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

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

```

## MCP server setup

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