# Polymarket Wallet Portfolio & Trade History Scraper (`automation-lab/polymarket-wallet-portfolio-trade-history-scraper`) Actor

👛 Export public Polymarket wallets into clean positions, PnL, trades, activity, and portfolio snapshots. No login, signature, browser, or proxy required.

- **URL**: https://apify.com/automation-lab/polymarket-wallet-portfolio-trade-history-scraper.md
- **Developed by:** [Stas Persiianenko](https://apify.com/automation-lab) (community)
- **Categories:** Other
- **Stats:** 3 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use 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 Wallet Portfolio & Trade History Scraper

Export public Polymarket wallet positions, PnL, trades, activity, and portfolio value to clean CSV, JSON, Excel, or API-ready dataset records.

Give the Actor one or more Polymarket proxy-wallet addresses. It queries Polymarket's official public Data API, follows pagination, normalizes the response, removes duplicates, and stores analysis-ready rows.

No login, wallet signature, private key, browser, or proxy is required.

### What does Polymarket Wallet Portfolio & Trade History Scraper do?

The Actor turns a public wallet address into a complete wallet intelligence export.

It can collect:

- 👛 current open positions and token sizes
- ✅ closed positions and realized PnL
- 🔄 BUY and SELL trade history
- ⛓️ TRADE, SPLIT, MERGE, REDEEM, REWARD, and conversion activity
- 💵 aggregate current portfolio value
- 🎯 market, asset, condition, event, and transaction identifiers
- 👤 public trader profile fields attached to history rows

Select only the modes you need or combine them into one normalized wallet dataset.

### Why use this Polymarket wallet scraper?

Public Polymarket responses are useful but spread across several endpoints and use different field shapes.

This Actor gives you one stable contract.

- ✅ Submit several wallets in one run.
- ✅ Export positions, trades, activity, and value together.
- ✅ Filter trade/activity history by date and side.
- ✅ Filter records by market condition ID.
- ✅ Retain transaction hashes and raw join identifiers.
- ✅ Schedule recurring portfolio snapshots on Apify.
- ✅ Continue other wallets when one endpoint fails.
- ✅ Use conservative retries and concurrency against the public API.

The result is easier to load into spreadsheets, databases, notebooks, dashboards, and AI agents than raw endpoint responses.

### Who is it for?

**Prediction-market traders** can inspect a public account's exposure, entry prices, and PnL.

**Whale and copy-trading researchers** can maintain watchlists and compare wallet behavior over time.

**Portfolio analysts** can schedule snapshots and calculate changes between runs.

**Tax and reconciliation teams** can export transaction hashes, trades, redemptions, and realized outcomes.

**Quant researchers** can join trades to market or token datasets through condition and asset IDs.

**Bot and data teams** can consume typed records through the Apify API, webhooks, datasets, or MCP.

This Actor is for public research and data automation. It does not place orders, access private accounts, or provide investment advice.

### What data can you extract?

Every row includes a `recordType`, wallet, source URL, and scrape timestamp.

| Field | Description |
| --- | --- |
| `recordType` | `position`, `closed_position`, `trade`, `activity`, or `portfolio_value` |
| `wallet` | Normalized public Polymarket proxy-wallet address |
| `assetId` | Outcome token asset ID |
| `conditionId` | Market condition ID |
| `eventId` | Polymarket event identifier when supplied |
| `title` | Market title |
| `marketSlug` | Market slug |
| `eventSlug` | Parent event slug |
| `outcome` | Outcome name |
| `size` | Position, trade, or activity token size |
| `side` | BUY or SELL |
| `activityType` | On-chain activity category |
| `averagePrice` | Position average entry price |
| `currentPrice` | Current outcome price |
| `tradePrice` | Trade or activity price |
| `initialValue` | Initial position value |
| `currentValue` | Current position value |
| `portfolioValue` | Aggregate current position value |
| `cashPnl` | Unrealized cash PnL |
| `percentPnl` | Unrealized percentage PnL |
| `realizedPnl` | Realized PnL |
| `timestamp` | Upstream epoch timestamp |
| `timestampIso` | Normalized ISO timestamp |
| `endDate` | Market end date |
| `transactionHash` | Polygon transaction hash |
| `traderName` | Public profile name |
| `pseudonym` | Public Polymarket pseudonym |
| `sourceUrl` | Exact Data API URL used |
| `scrapedAt` | ISO extraction timestamp |

Fields that do not apply to a row type are omitted instead of filled with misleading values.

### Supported wallet record modes

#### Open positions

Returns active wallet exposure with token size, average price, current price, initial/current value, unrealized and realized PnL, outcome, and redeemability fields.

#### Closed positions

Returns settled or exited positions with total bought, realized PnL, close timestamp, market details, and outcome identifiers.

#### Trades

Returns BUY/SELL fills with size, price, timestamp, market metadata, public profile fields, and transaction hash.

#### Activity

Returns public on-chain activity such as trades, splits, merges, redemptions, rewards, and conversions.

#### Portfolio value

Returns the wallet's current aggregate Polymarket position value as one snapshot row.

### Input

The smallest useful input is:

```json
{
  "wallets": ["0x204f72f35326db932158cba6adff0b9a1da95e14"],
  "modes": ["positions", "portfolio_value"],
  "maxItemsPerWallet": 20
}
````

| Input | Type | Default | Purpose |
| --- | --- | --- | --- |
| `wallets` | string array | required | Public Polymarket proxy-wallet addresses |
| `modes` | string array | positions, trades, activity, value | Record families to export |
| `maxItemsPerWallet` | integer | 100 | Cap for each wallet and selected mode |
| `marketIds` | string array | none | Filter by condition IDs |
| `startDate` | string | none | ISO lower date bound for trades/activity |
| `endDate` | string | none | ISO upper date bound for trades/activity |
| `side` | BUY or SELL | both | Trade/activity side filter |
| `activityTypes` | string array | all | Activity categories to include |
| `minPositionSize` | number | 1 | Minimum open position token size |
| `maxConcurrency` | integer | 3 | Concurrent wallet-mode requests, maximum 5 |

`maxItemsPerWallet` applies independently to every mode. A cap of 100 with three selected history modes can therefore save up to 300 history records for one wallet, plus one value row.

### How to find a Polymarket proxy-wallet address

Open a public trader profile on Polymarket and copy its displayed wallet/profile address.

The required format is:

```text
0x + 40 hexadecimal characters
```

The Actor validates every address before making requests. It lowercases addresses for reliable deduplication.

Do not submit a private key or seed phrase. The Actor never needs one.

### Filter examples

Export SELL trades since January 1, 2026:

```json
{
  "wallets": ["0x56687bf447db6ffa42ffe2204a05edaa20f55839"],
  "modes": ["trades"],
  "side": "SELL",
  "startDate": "2026-01-01",
  "maxItemsPerWallet": 500
}
```

Monitor redemption and merge activity:

```json
{
  "wallets": ["0x56687bf447db6ffa42ffe2204a05edaa20f55839"],
  "modes": ["activity"],
  "activityTypes": ["REDEEM", "MERGE"],
  "maxItemsPerWallet": 250
}
```

Use `marketIds` when you need wallet records for known Polymarket condition IDs.

### Output example

A position row looks like this:

```json
{
  "recordType": "position",
  "wallet": "0x204f72f35326db932158cba6adff0b9a1da95e14",
  "assetId": "1234567890",
  "conditionId": "0x1234...abcd",
  "title": "Will this market resolve Yes?",
  "outcome": "Yes",
  "size": 120.5,
  "averagePrice": 0.42,
  "currentPrice": 0.58,
  "currentValue": 69.89,
  "cashPnl": 19.28,
  "percentPnl": 38.1,
  "sourceUrl": "https://data-api.polymarket.com/positions?...",
  "scrapedAt": "2026-07-14T02:00:00.000Z"
}
```

Actual values always come from the public upstream response.

### How to run the Actor

1. Open the Actor input page.
2. Paste one or more public wallet addresses.
3. Select the record modes you need.
4. Keep the first test cap low, such as 20.
5. Add optional date, market, side, or activity filters.
6. Click **Start**.
7. Export the dataset as JSON, CSV, Excel, XML, or RSS.

For scheduled monitoring, save the input as an Apify task and attach a schedule.

### How much does it cost to scrape Polymarket wallet history?

The Actor uses pay-per-event pricing:

- **$0.005** once when a run starts
- **$0.00004569 per wallet record** on the BRONZE plan
- automatic volume discounts down to **$0.000012793 per record** on DIAMOND

You pay only for records actually saved. A small 20-record snapshot costs about $0.0059 at the BRONZE price before platform plan details.

The HTTP-only implementation uses 256 MB memory and no paid proxy traffic, keeping compute overhead low.

Check the pricing tab for your current Apify plan's exact tier price.

### Scheduling wallet snapshots

A schedule turns the Actor into a simple portfolio monitor.

Recommended pattern:

1. Create a task with `positions` and `portfolio_value` modes.
2. Add the wallets in your watchlist.
3. Set a conservative per-mode cap.
4. Run hourly, daily, or weekly.
5. Send the dataset through a webhook or integration.
6. Compare the newest snapshot with the previous run.

For incremental activity exports, set `startDate` to the beginning of your required window and deduplicate downstream by `wallet`, `recordType`, and `transactionHash`.

### Integrations

Use built-in Apify integrations to connect wallet records to:

- **Google Sheets** for a research watchlist
- **Slack** for new trade or redemption alerts
- **Make** for no-code portfolio workflows
- **Zapier** for notifications and CRM actions
- **webhooks** for run-completion processing
- **Amazon S3** or cloud storage for archives
- **Python/R notebooks** for strategy research
- **database loaders** for historical analytics

A practical alert workflow filters new `trade` records after a scheduled run and sends only unseen transaction hashes.

### API usage with Apify

#### JavaScript

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('automation-lab/polymarket-wallet-portfolio-trade-history-scraper').call({
  wallets: ['0x56687bf447db6ffa42ffe2204a05edaa20f55839'],
  modes: ['trades', 'activity'],
  maxItemsPerWallet: 100,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

#### Python

```python
from apify_client import ApifyClient
import os

client = ApifyClient(os.environ['APIFY_TOKEN'])
run = client.actor('automation-lab/polymarket-wallet-portfolio-trade-history-scraper').call(run_input={
    'wallets': ['0x56687bf447db6ffa42ffe2204a05edaa20f55839'],
    'modes': ['positions', 'portfolio_value'],
    'maxItemsPerWallet': 50,
})
items = client.dataset(run['defaultDatasetId']).list_items().items
print(items)
```

#### cURL

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/automation-lab~polymarket-wallet-portfolio-trade-history-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"wallets":["0x56687bf447db6ffa42ffe2204a05edaa20f55839"],"modes":["trades"],"maxItemsPerWallet":50}'
```

### Use with MCP and AI agents

#### Claude Code

Connect Apify's MCP server with the exact Claude Code command:

```bash
claude mcp add --transport http apify \
  "https://mcp.apify.com/?tools=automation-lab/polymarket-wallet-portfolio-trade-history-scraper"
```

#### Claude Desktop

Add this server to Claude Desktop's `mcpServers` configuration:

```json
{
  "mcpServers": {
    "apify-polymarket-wallet": {
      "url": "https://mcp.apify.com/?tools=automation-lab/polymarket-wallet-portfolio-trade-history-scraper"
    }
  }
}
```

#### Cursor

Open Cursor MCP settings and add the same `mcpServers` JSON. Restart Cursor so the Polymarket wallet tool appears in the available tool list.

#### VS Code

In VS Code with MCP support, add the HTTP server URL to your workspace MCP configuration and enable the `apify-polymarket-wallet` server.

Example prompts:

- “Export open positions and portfolio value for these three public Polymarket wallets.”
- “Get SELL trades for this wallet since 2026-01-01 and summarize realized outcomes.”
- “Monitor redemption and merge activity for my public whale watchlist.”
- “Join these wallet trades by condition ID with my Polymarket market table.”

AI-generated analysis can be wrong; verify financial conclusions against source records.

### Reliability and pagination

The Actor follows each endpoint's documented offset pagination limits.

It uses:

- bounded concurrency of at most five requests
- exponential backoff for 429, 5xx, timeout, and network errors
- a 20-second timeout per attempt
- per-wallet and per-mode error isolation
- duplicate keys appropriate to each record family
- exact source URLs for traceability

If one wallet mode fails after retries, other wallet jobs continue. The run fails only when every requested wallet-mode job fails and no data can be saved.

Polymarket currently caps some API offsets at 10,000. The Actor logs a warning if a requested history reaches that upstream boundary.

### Data freshness and limitations

Results reflect the public Polymarket Data API at run time.

Keep these limitations in mind:

- Portfolio value is a snapshot, not account cash balance.
- Prices and PnL can move after extraction.
- Public history may be updated or corrected upstream.
- Very large histories are subject to Polymarket offset limits.
- Transaction-hash deduplication can collapse duplicate endpoint rows.
- The Actor does not calculate taxes, cost basis, win rate, or investment recommendations.
- This Actor targets the global Polymarket Data API, not private account data.

Use recurring runs when freshness matters.

### Tips for better results

- Start with `positions` and `portfolio_value` to verify an address.
- Add `trades` or `activity` after confirming the wallet is active.
- Use a date window for recurring history exports.
- Use `marketIds` to reduce broad histories.
- Set `minPositionSize` to `0` when tiny positions matter.
- Keep concurrency at 3 unless you have many wallets.
- Use transaction hashes and asset IDs as durable downstream keys.
- Preserve `sourceUrl` in audits and reconciliation exports.

### Legality of scraping public Polymarket wallet data

The Actor accesses Polymarket's documented, public, no-auth Data API.

Public availability does not remove your responsibilities. Follow applicable laws, Polymarket's terms, privacy requirements, and your organization's policies. Do not use the data for harassment, unlawful profiling, market manipulation, or deceptive claims.

Wallet activity is pseudonymous, not necessarily anonymous. Avoid claiming that a wallet belongs to a real person without reliable lawful evidence.

This Actor is an independent data tool and is not affiliated with or endorsed by Polymarket.

### FAQ

#### Does it require my Polymarket login or wallet signature?

No. It reads only public wallet data. Never submit a private key, seed phrase, session cookie, or API credential.

#### Why did a wallet return no open positions?

The wallet may have no current exposure, may use a different proxy-wallet address, or all positions may be smaller than `minPositionSize`. Try setting `minPositionSize` to `0` and include `closed_positions` or `trades`.

#### Why are some fields missing on a row?

Different Polymarket record families expose different fields. The Actor omits fields that do not apply instead of filling them with fake values.

#### Can I export complete historical trades?

Use `trades`, a positive start date far enough in the past, and a higher cap. Extremely large histories remain subject to the public API's offset boundary.

#### Can I monitor many wallets?

Yes. Submit up to 100 addresses and schedule the task. Keep the item cap and frequency proportional to the watchlist.

#### Does it place trades or score wallets?

No. It exports public records. Trading, scoring, copy-trading decisions, and alerts belong in your downstream workflow.

#### What should I do after an API rate-limit warning?

The Actor retries automatically. If failures persist, lower `maxConcurrency` or rerun later rather than increasing concurrency.

### Related Polymarket scrapers

Use [Polymarket Markets Scraper](https://apify.com/automation-lab/polymarket-markets-scraper) to discover markets, outcomes, prices, liquidity, and volume before joining them to wallet records.

Use [Polymarket Leaderboard Scraper](https://apify.com/automation-lab/polymarket-leaderboard-scraper) to discover ranked top traders before exporting selected wallets here.

Together they support a complete workflow:

1. discover active markets,
2. discover public top traders,
3. export arbitrary wallet records,
4. schedule snapshots,
5. join by wallet, condition ID, asset ID, or transaction hash.

### Support

If a valid public wallet produces unexpected output, open an issue from the Actor page.

Include:

- the public wallet address
- selected modes and filters
- the run URL
- the expected record family
- whether the upstream public profile still shows activity

Do not include private keys, seed phrases, or confidential account information.

# Actor input Schema

## `wallets` (type: `array`):

One or more public 0x proxy-wallet addresses shown on Polymarket profiles.

## `modes` (type: `array`):

Record families to fetch for every wallet. Closed positions are optional because large histories take longer.

## `maxItemsPerWallet` (type: `integer`):

Maximum records returned for each selected mode for each wallet. Portfolio value always emits at most one row.

## `marketIds` (type: `array`):

Optional 0x-prefixed Polymarket condition IDs. Applied to positions, closed positions, trades, and activity.

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

Optional ISO date or datetime for trades and activity, for example 2026-01-01.

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

Optional ISO date or datetime for trades and activity.

## `side` (type: `string`):

Optionally return only BUY or SELL trades/activity.

## `activityTypes` (type: `array`):

Optional filters for on-chain activity records.

## `minPositionSize` (type: `number`):

Minimum token size for open positions. Set 0 to include tiny positions.

## `maxConcurrency` (type: `integer`):

Higher values can finish multi-wallet exports faster. Capped at 5 to protect the public API.

## Actor input object example

```json
{
  "wallets": [
    "0x56687bf447db6ffa42ffe2204a05edaa20f55839"
  ],
  "modes": [
    "positions",
    "portfolio_value"
  ],
  "maxItemsPerWallet": 20,
  "minPositionSize": 1,
  "maxConcurrency": 3
}
```

# Actor output Schema

## `overview` (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 = {
    "wallets": [
        "0x56687bf447db6ffa42ffe2204a05edaa20f55839"
    ],
    "modes": [
        "positions",
        "portfolio_value"
    ],
    "maxItemsPerWallet": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("automation-lab/polymarket-wallet-portfolio-trade-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 = {
    "wallets": ["0x56687bf447db6ffa42ffe2204a05edaa20f55839"],
    "modes": [
        "positions",
        "portfolio_value",
    ],
    "maxItemsPerWallet": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("automation-lab/polymarket-wallet-portfolio-trade-history-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "wallets": [
    "0x56687bf447db6ffa42ffe2204a05edaa20f55839"
  ],
  "modes": [
    "positions",
    "portfolio_value"
  ],
  "maxItemsPerWallet": 20
}' |
apify call automation-lab/polymarket-wallet-portfolio-trade-history-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=automation-lab/polymarket-wallet-portfolio-trade-history-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Polymarket Wallet Portfolio & Trade History Scraper",
        "description": "👛 Export public Polymarket wallets into clean positions, PnL, trades, activity, and portfolio snapshots. No login, signature, browser, or proxy required.",
        "version": "0.1",
        "x-build-id": "VRY3EEgJRA7zfspvk"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/automation-lab~polymarket-wallet-portfolio-trade-history-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-automation-lab-polymarket-wallet-portfolio-trade-history-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/automation-lab~polymarket-wallet-portfolio-trade-history-scraper/runs": {
            "post": {
                "operationId": "runs-sync-automation-lab-polymarket-wallet-portfolio-trade-history-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/automation-lab~polymarket-wallet-portfolio-trade-history-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-automation-lab-polymarket-wallet-portfolio-trade-history-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "wallets"
                ],
                "properties": {
                    "wallets": {
                        "title": "Polymarket wallet addresses",
                        "minItems": 1,
                        "maxItems": 100,
                        "type": "array",
                        "description": "One or more public 0x proxy-wallet addresses shown on Polymarket profiles.",
                        "items": {
                            "type": "string",
                            "pattern": "^0x[a-fA-F0-9]{40}$"
                        }
                    },
                    "modes": {
                        "title": "Data modes",
                        "type": "array",
                        "description": "Record families to fetch for every wallet. Closed positions are optional because large histories take longer.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "positions",
                                "closed_positions",
                                "trades",
                                "activity",
                                "portfolio_value"
                            ],
                            "enumTitles": [
                                "Open positions",
                                "Closed positions",
                                "Trades",
                                "On-chain activity",
                                "Portfolio value"
                            ]
                        },
                        "default": [
                            "positions",
                            "trades",
                            "activity",
                            "portfolio_value"
                        ]
                    },
                    "maxItemsPerWallet": {
                        "title": "Maximum records per wallet and mode",
                        "minimum": 1,
                        "maximum": 5000,
                        "type": "integer",
                        "description": "Maximum records returned for each selected mode for each wallet. Portfolio value always emits at most one row.",
                        "default": 100
                    },
                    "marketIds": {
                        "title": "Market condition IDs",
                        "maxItems": 20,
                        "type": "array",
                        "description": "Optional 0x-prefixed Polymarket condition IDs. Applied to positions, closed positions, trades, and activity.",
                        "items": {
                            "type": "string",
                            "pattern": "^0x[a-fA-F0-9]{64}$"
                        }
                    },
                    "startDate": {
                        "title": "History start date",
                        "type": "string",
                        "description": "Optional ISO date or datetime for trades and activity, for example 2026-01-01."
                    },
                    "endDate": {
                        "title": "History end date",
                        "type": "string",
                        "description": "Optional ISO date or datetime for trades and activity."
                    },
                    "side": {
                        "title": "Trade side",
                        "enum": [
                            "BUY",
                            "SELL"
                        ],
                        "type": "string",
                        "description": "Optionally return only BUY or SELL trades/activity."
                    },
                    "activityTypes": {
                        "title": "Activity types",
                        "type": "array",
                        "description": "Optional filters for on-chain activity records.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "TRADE",
                                "SPLIT",
                                "MERGE",
                                "REDEEM",
                                "REWARD",
                                "CONVERSION",
                                "MAKER_REBATE",
                                "REFERRAL_REWARD"
                            ]
                        }
                    },
                    "minPositionSize": {
                        "title": "Minimum open position size",
                        "minimum": 0,
                        "type": "number",
                        "description": "Minimum token size for open positions. Set 0 to include tiny positions.",
                        "default": 1
                    },
                    "maxConcurrency": {
                        "title": "Maximum concurrent wallet-mode requests",
                        "minimum": 1,
                        "maximum": 5,
                        "type": "integer",
                        "description": "Higher values can finish multi-wallet exports faster. Capped at 5 to protect the public API.",
                        "default": 3
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
