# Polymarket Price History Scraper (`piotrv1001/polymarket-price-history-scraper`) Actor

The Polymarket Price History Scraper exports the full price history of Polymarket markets at 1-minute, hourly or daily intervals, with every point labelled by market, outcome, token ID and resolution (winner, close time) — ideal for prediction-market research and backtesting.

- **URL**: https://apify.com/piotrv1001/polymarket-price-history-scraper.md
- **Developed by:** [FalconScrape](https://apify.com/piotrv1001) (community)
- **Categories:** Developer tools, Automation, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.02 / 1,000 price points

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 Price History Scraper

Get the full price history of any Polymarket market, from the day it opened to the moment it resolved. The **Polymarket Price History Scraper** exports one row per price point for every outcome, at 1-minute, 1-hour or 1-day intervals, with each row labelled with its market, outcome and resolution. It is built for researchers, data scientists and journalists who need clean historical odds.

### ✨ Features

- 📈 **Full history, not just the last month**: Covers the whole life of a market, including markets that resolved years ago.
- ⏱️ **1-minute, 1-hour or 1-day intervals**: Minute data is available across a market's entire life.
- 🏷️ **Outcome-labelled**: Every point says which outcome it prices (Yes/No, candidate, team), with its token ID.
- ✅ **Resolution included**: `resolved`, `winningOutcome` and `closedTime` are on every row, so no second lookup is needed.
- 🗂️ **Events expand to all markets**: Paste an event URL (e.g. an election with many candidates) to get every market in it, up to **Max markets**.
- 📅 **Date range**: Limit history to a start and end date.
- 📋 **Honest gaps**: Missing periods are never filled in. `RUN_SUMMARY` lists each price series with its point count, largest gap and whether any history exists.

### 🛠️ How It Works

1. **Enter markets**: Polymarket event or market URLs, market slugs or condition IDs.
2. **Pick an interval**: 1 minute, 1 hour or 1 day. Optionally set a start and end date.
3. **Run the scraper**: Get one row per outcome per timestamp, ready to export as CSV, JSON or Excel.

### 💰 Pricing

| Event       | Price    | When                   |
| ----------- | -------- | ---------------------- |
| Price point | $0.00002 | Each price point saved |

That is $0.02 per 1,000 points. A full year of daily prices for a Yes/No market (~730 points) costs about $0.015. A year of hourly prices costs about $0.35.

### 📊 Sample Output Data

```json
[
    {
        "marketId": "253591",
        "conditionId": "0xdd22472e552920b8438158ea7238bfadfa4f736aa4cee91a6b86c39ead110917",
        "question": "Will Donald Trump win the 2024 US Presidential Election?",
        "marketSlug": "will-donald-trump-win-the-2024-us-presidential-election",
        "eventSlug": "presidential-election-winner-2024",
        "eventTitle": "Presidential Election Winner 2024",
        "marketUrl": "https://polymarket.com/event/presidential-election-winner-2024/will-donald-trump-win-the-2024-us-presidential-election",
        "outcome": "No",
        "outcomeIndex": 1,
        "tokenId": "48331043336612883890938759509493159234755048973500640148014422747788308965732",
        "interval": "1m",
        "resolved": true,
        "winningOutcome": "Yes",
        "closedTime": "2024-11-06T15:17:41.000Z",
        "timestamp": "2024-11-06T15:17:02.000Z",
        "unixTime": 1730906222,
        "price": 0.0025
    }
]
```

### ❓ Good to Know

- **Prices are probabilities between 0 and 1** (0.58 = 58%).
- **Markets from 2020–2021 have no price history.** They are listed in `RUN_SUMMARY` with `historyAvailable: false` and are not charged.
- **Quiet periods can leave gaps**, especially on the less-traded side of a market. Check `maxGapHours` in `RUN_SUMMARY`.
- **Daily points are taken at midnight UTC.** The move on the day a market resolves shows up in hourly or minute data.
- **One minute of data is about 1,440 points per outcome per day.** Use a date range for long minute-level exports.

Explore how the odds moved with the **Polymarket Price History Scraper** today! 🚀

# Actor input Schema

## `markets` (type: `array`):

Polymarket event or market URLs (`https://polymarket.com/event/presidential-election-winner-2024`), market slugs or condition IDs (`0x…`). An event URL expands to all of its markets, up to **Max markets**.

## `interval` (type: `string`):

Time between price points. One minute gives about 1,440 points per outcome per day.

## `startDate` (type: `string`):

Only save prices from this date. Leave empty to start when the market opened.

## `endDate` (type: `string`):

Only save prices up to this date. Leave empty to end when the market closed (or now for open markets).

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

Maximum number of markets to save price history for. Each market has one price series per outcome.

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

Proxy servers used to reach Polymarket.

## Actor input object example

```json
{
  "markets": [
    "https://polymarket.com/event/presidential-election-winner-2024/will-donald-trump-win-the-2024-us-presidential-election"
  ],
  "interval": "1d",
  "maxMarkets": 10,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

No description

## `summary` (type: `string`):

No description

# 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 = {
    "markets": [
        "https://polymarket.com/event/presidential-election-winner-2024/will-donald-trump-win-the-2024-us-presidential-election"
    ],
    "interval": "1d",
    "maxMarkets": 10,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("piotrv1001/polymarket-price-history-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 = {
    "markets": ["https://polymarket.com/event/presidential-election-winner-2024/will-donald-trump-win-the-2024-us-presidential-election"],
    "interval": "1d",
    "maxMarkets": 10,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("piotrv1001/polymarket-price-history-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 '{
  "markets": [
    "https://polymarket.com/event/presidential-election-winner-2024/will-donald-trump-win-the-2024-us-presidential-election"
  ],
  "interval": "1d",
  "maxMarkets": 10,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call piotrv1001/polymarket-price-history-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,piotrv1001/polymarket-price-history-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/XtxWaHiChnLFBHch4/builds/Zmvoh2IxdOUiia5TD/openapi.json
