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

Scrapes all active prediction markets from Polymarket including prices, token IDs, volume, liquidity, end dates, and categories. Optionally fetches live CLOB prices. Filter by category tag, minimum volume, or minimum liquidity. See our Arb Scanner for Polymarket/Kalshi/PredictIt arbitrage.

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

## Pricing

from $1.00 / 1,000 results

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 Markets Scraper

Scrapes active prediction markets from [Polymarket](https://polymarket.com) via the Gamma API and returns clean, structured JSON data ready for analysis, trading bots, research, or dashboards.

### What you get per market

| Field | Description |
|-------|-------------|
| `market_id` | Unique Polymarket market ID |
| `condition_id` | On-chain condition ID (Polygon) |
| `event_title` | Parent event name |
| `question` | The market question |
| `tags` | Category tags (e.g. `temperature`, `crypto`, `politics`) |
| `token_yes` | YES token ID for CLOB trading |
| `token_no` | NO token ID for CLOB trading |
| `yes_price` | Current YES probability (0–1) |
| `no_price` | Current NO probability (0–1) |
| `clob_yes_price` | Live orderbook YES price (if `includeLivePrices=true`) |
| `volume_24h` | 24-hour trading volume in USDC |
| `volume_total` | All-time trading volume in USDC |
| `liquidity` | Current liquidity in USDC |
| `end_date` | Market close date/time (ISO 8601) |
| `time_remaining` | Human-readable time left (e.g. `12h 30m`) |
| `resolved` | Whether the market has resolved |
| `resolution_value` | Resolution outcome (if resolved) |
| `scraped_at` | Timestamp of this scrape |

### Input options

| Parameter | Default | Description |
|-----------|---------|-------------|
| `tags` | `[]` (all) | Filter by category: `temperature`, `crypto`, `politics`, `sports`, `economics`, etc. |
| `activeOnly` | `true` | Only return open markets |
| `includeResolved` | `false` | Include resolved markets for historical data |
| `includeLivePrices` | `false` | Fetch real-time CLOB prices (slower) |
| `maxMarkets` | `2000` | Cap on results returned |
| `minVolume24h` | `0` | Minimum 24h USDC volume filter |
| `minLiquidity` | `0` | Minimum USDC liquidity filter |

### Example use cases

- **Trading bots** — feed market data into your own strategy engine
- **Arbitrage scanners** — compare Polymarket prices to Kalshi or other platforms
- **Research & analytics** — export all markets to CSV for analysis
- **Price monitoring** — track specific market prices over time
- **Weather/temperature markets** — filter `tags: ["temperature"]` for all weather buckets

### Example output

```json
{
  "market_id": "12345",
  "event_title": "Highest temperature in London on March 24, 2026",
  "question": "Will the high be 14-14°C?",
  "tags": ["temperature"],
  "token_yes": "0xabc123...",
  "token_no": "0xdef456...",
  "yes_price": 0.18,
  "no_price": 0.82,
  "volume_24h": 450.50,
  "liquidity": 1200.00,
  "time_remaining": "11h 30m",
  "end_date": "2026-03-24T23:00:00Z",
  "resolved": false,
  "scraped_at": "2026-03-23T18:00:00+00:00"
}
```

### Notes

- Data is sourced from Polymarket's public Gamma API — no API key required
- Prices reflect the last traded price, not live orderbook mid. Use `includeLivePrices=true` for real-time orderbook prices
- Polymarket operates on Polygon blockchain; token IDs can be used directly with the py-clob-client SDK

### Related Actors

- **[Prediction Market Arb Scanner](https://apify.com/congism/polymarket-kalshi-predictit-arb-finder)** — same arbitrage-detection approach, extended to a third platform (PredictIt) with a stronger IDF-weighted matching algorithm that filters out false cross-candidate matches.

# Actor input Schema

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

Filter by Polymarket category tag slugs. Leave empty to scrape ALL categories. Examples: \['temperature', 'crypto', 'politics', 'sports', 'economics']

## `activeOnly` (type: `boolean`):

If true (default), only return markets that are currently open for trading.

## `includeResolved` (type: `boolean`):

If true, include markets that have already resolved. Useful for historical data.

## `includeLivePrices` (type: `boolean`):

If true, fetches real-time orderbook prices from the Polymarket CLOB API for each market. More accurate than snapshot prices but significantly slower and uses more compute units.

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

Maximum number of markets to return. Default 2000, max 10000.

## `minVolume24h` (type: `number`):

Only return markets with at least this much 24-hour trading volume in USDC. Use 0 for no filter.

## `minLiquidity` (type: `number`):

Only return markets with at least this much liquidity in USDC. Use 0 for no filter.

## Actor input object example

```json
{
  "tags": [],
  "activeOnly": true,
  "includeResolved": false,
  "includeLivePrices": false,
  "maxMarkets": 2000,
  "minVolume24h": 0,
  "minLiquidity": 0
}
```

# 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("congism/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("congism/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 congism/polymarket-markets-scraper --silent --output-dataset

```

## MCP server setup

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