# Polymarket Scraper (`vashiiq/polymarket`) Actor

Polymarket prediction-market prices, bid/ask, volume and liquidity by event, market or topic, plus price history per outcome.

- **URL**: https://apify.com/vashiiq/polymarket.md
- **Developed by:** [anthony leblanc](https://apify.com/vashiiq) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.80 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

Get Polymarket prediction-market prices as clean rows: outcome prices, best bid and ask, 24-hour and total volume, liquidity and end date, by topic, event or market. History mode returns price history for each outcome.

### What it does

- Reads Polymarket’s public market API (no login, no wallet, no key).
- Filters by topic tag (politics, crypto, sports…), event or market slug, status and keyword.
- Parses outcome prices into numbers (the raw API returns them as text).
- Sorts by 24-hour volume so the busiest markets come first.
- History mode returns price points for each outcome over a day, week, month or all time.

**Why this one:** Snapshot and per-outcome price history in one Actor, outcome prices parsed into numbers (the raw API returns them as text), topic and keyword filters, sorted by 24-hour volume.

In our last check, 20 runs over varied inputs succeeded 100% of the time.

### Use cases

- Tracking odds on elections, crypto, sports and world events
- Charting how a market moved after news
- Comparing Polymarket with Kalshi or polls

### Input example

```json
{
  "tagSlugs": [
    "crypto"
  ],
  "maxItems": 5
}
```

- mode: snapshot or history
- eventSlugs / marketSlugs / tagSlugs: what to fetch
- keyword: filter by question
- status: active, closed or all
- historyRange: day, week, month or all

### Output sample

Real results from a run of this Actor:

```json
[
  {
    "id": "561229",
    "question": "Will JD Vance win the 2028 US Presidential Election?",
    "eventTitle": "Presidential Election Winner 2028",
    "eventSlug": "presidential-election-winner-2028",
    "slug": "will-jd-vance-win-the-2028-us-presidential-election",
    "outcome": "JD Vance",
    "outcomes": [
      {
        "name": "Yes",
        "price": 0.184
      },
      {
        "name": "No",
        "price": 0.816
      }
    ],
    "yesPrice": 0.184,
    "bestBid": 0.18,
    "bestAsk": 0.188,
    "lastTradePrice": 0.18,
    "spread": 0.008,
    "oneDayPriceChange": -0.0145,
    "volume": 17243385.237591997,
    "volume24h": 28338.430958,
    "liquidity": 454347.74483,
    "startDate": "2025-07-11T19:05:46.369Z",
    "endDate": "2028-11-08T04:59:00.000Z",
    "active": true,
    "closed": false,
    "tags": [
      "president",
      "united-states",
      "us-presidential-election",
      "elections",
      "politics",
      "world-elections",
      "global-elections",
      "earn-4",
      "main-election"
    ],
    "conditionId": "0x7ad403c3508f8e3912940fd1a913f227591145ca0614074208e0b962d5fcc422",
    "url": "https://polymarket.com/event/presidential-election-winner-2028/will-jd-vance-win-the-2028-us-presidential-election",
    "sourceUrl": "https://polymarket.com/event/presidential-election-winner-2028/will-jd-vance-win-the-2028-us-presidential-election",
    "scrapedAt": "2026-10-27T20:02:54.460Z"
  },
  {
    "id": "561230",
    "question": "Will Gavin Newsom win the 2028 US Presidential Election?",
    "eventTitle": "Presidential Election Winner 2028",
    "eventSlug": "presidential-election-winner-2028",
    "slug": "will-gavin-newsom-win-the-2028-us-presidential-election",
    "outcome": "Gavin Newsom",
    "outcomes": [
      {
        "name": "Yes",
        "price": 0.1195
      },
      {
        "name": "No",
        "price": 0.8805
      }
    ],
    "yesPrice": 0.1195,
    "bestBid": 0.119,
    "bestAsk": 0.12,
    "lastTradePrice": 0.119,
    "spread": 0.001,
    "oneDayPriceChange": 0.0045,
    "volume": 18780170.342862006,
    "volume24h": 8032.278021,
    "liquidity": 325305.96817,
    "startDate": "2025-07-11T19:05:48.736Z",
    "endDate": "2028-11-08T04:59:00.000Z",
    "active": true,
    "closed": false,
    "tags": [
      "president",
      "united-states",
      "us-presidential-election",
      "elections",
      "politics",
      "world-elections",
      "global-elections",
      "earn-4",
      "main-election"
    ],
    "conditionId": "0x4567b275e6b667a6217f5cb4f06a797d3a1eaf1d0281fb5bc8c75e2046ae7e57",
    "url": "https://polymarket.com/event/presidential-election-winner-2028/will-gavin-newsom-win-the-2028-us-presidential-election",
    "sourceUrl": "https://polymarket.com/event/presidential-election-winner-2028/will-gavin-newsom-win-the-2028-us-presidential-election",
    "scrapedAt": "2026-10-27T20:02:54.534Z"
  }
]
```

**Fields:**

- id, question, eventTitle, eventSlug, slug, outcome
- outcomes \[{name, price}], yesPrice, bestBid, bestAsk, lastTradePrice, spread, oneDayPriceChange
- volume, volume24h, liquidity (USD numbers)
- startDate, endDate (ISO), active, closed, tags, conditionId, url
- History rows: outcome, time, price

### Pricing

Pay per result: **$1.80 per 1,000 results**. You pay only for results you get; Apify platform costs are included. Set a maximum charge for a run and the Actor stops cleanly when it's reached, keeping everything collected so far.

### Tips

- The slug is the last part of a Polymarket URL: polymarket.com/event/<slug>.
- A keyword scan can check up to about 2,300 events (Polymarket’s paging limit); use tags to narrow it.

### FAQ

**Do I need an account on Polymarket?** No. It only reads public pages and data.

**Can I trade with this?** No. It only reads public market data.
**Something broke or a field is missing?** Open an issue on the Issues tab and include your run link. We fix scrapers quickly when sites change.

### Legal

This Actor collects publicly available data only. You're responsible for using it lawfully and in line with Polymarket's terms.

# Actor input Schema

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

Snapshot: current prices for each market. History: price history per outcome.

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

Events from the Polymarket URL, e.g. fed-decision-in-december (polymarket.com/event/<slug>).

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

Single markets by slug. Overrides events and tags.

## `tagSlugs` (type: `array`):

Topics, e.g. politics, crypto, sports, economy. Leave empty for all.

## `keyword` (type: `string`):

Keep only markets whose question or event title contains this text.

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

Active (open) markets, closed ones, or both.

## `historyRange` (type: `string`):

History mode only: last day, week, month or all time.

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

Stop after this many rows. You're only charged for rows you get.

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

Not usually needed; Polymarket's market API is public.

## Actor input object example

```json
{
  "mode": "snapshot",
  "tagSlugs": [
    "crypto"
  ],
  "status": "active",
  "historyRange": "week",
  "maxItems": 500,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

One row per market (or per price point in history mode).

# 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 = {
    "tagSlugs": [
        "crypto"
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("vashiiq/polymarket").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 = {
    "tagSlugs": ["crypto"],
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("vashiiq/polymarket").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 '{
  "tagSlugs": [
    "crypto"
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call vashiiq/polymarket --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,vashiiq/polymarket"
        }
    }
}
```

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/jG3br8oN878sgUmcI/builds/gCBPE7s9B74S0rVzh/openapi.json
