{
  "openapi": "3.0.1",
  "info": {
    "title": "Polymarket Leaderboard Scraper",
    "description": "Scrape Polymarket top-trader leaderboards by volume and profit across 1d, 7d, 30d, and all-time windows. Wallet, PnL, profile URL + optional live portfolio value. MCP/API-ready.",
    "version": "1.0",
    "x-build-id": "DKOHufcM6yMTTsvrJ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/khadinakbar~polymarket-leaderboard-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-khadinakbar-polymarket-leaderboard-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/khadinakbar~polymarket-leaderboard-scraper/runs": {
      "post": {
        "operationId": "runs-sync-khadinakbar-polymarket-leaderboard-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/khadinakbar~polymarket-leaderboard-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-khadinakbar-polymarket-leaderboard-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",
        "properties": {
          "metrics": {
            "title": "Leaderboard metrics",
            "type": "array",
            "description": "Which leaderboard ranking(s) to scrape. 'volume' ranks traders by total USD traded; 'profit' ranks by realized PnL in USD. Select one or both (e.g. [\"volume\",\"profit\"]). Defaults to both. This is NOT a market or event filter — it selects the ranking dimension of Polymarket's trader leaderboard.",
            "items": {
              "type": "string",
              "enum": [
                "volume",
                "profit"
              ],
              "enumTitles": [
                "Volume (total traded USD)",
                "Profit / PnL (USD)"
              ]
            },
            "default": [
              "volume",
              "profit"
            ]
          },
          "windows": {
            "title": "Time windows",
            "type": "array",
            "description": "Time window(s) the leaderboard is computed over. Accepts 1d (last 24h), 7d, 30d, and all (all-time). Select one or more (e.g. [\"7d\",\"all\"]). Defaults to all-time. Each metric x window combination is fetched separately and tagged in the output. NOT a calendar date range.",
            "items": {
              "type": "string",
              "enum": [
                "1d",
                "7d",
                "30d",
                "all"
              ],
              "enumTitles": [
                "Last 24 hours",
                "Last 7 days",
                "Last 30 days",
                "All-time"
              ]
            },
            "default": [
              "all"
            ]
          },
          "limit": {
            "title": "Results per metric x window",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "How many top traders to return per metric x window. Range 1-50. The Polymarket leaderboard API hard-caps at 50, so values above 50 are clamped to 50. Defaults to 50. Total rows = metrics x windows x limit (e.g. 2 metrics x 1 window x 50 = 100 rows).",
            "default": 50
          },
          "addresses": {
            "title": "Specific wallets (optional)",
            "type": "array",
            "description": "Optional list of Polymarket proxy-wallet addresses (0x-prefixed) to look up directly instead of the top-N list (e.g. [\"0x204f72f35326db932158cba6adff0b9a1da95e14\"]). When set, the actor returns each wallet's volume/profit for the selected windows regardless of rank. Leave empty to scrape the top leaderboard. NOT usernames — must be on-chain wallet addresses.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "enrichPortfolioValue": {
            "title": "Enrich with live portfolio value",
            "type": "boolean",
            "description": "When true, each returned trader is enriched with their current live portfolio value in USD (open-position value) via Polymarket's data API. Adds one extra request per unique wallet and a small per-wallet charge. Defaults to false. Useful for spotting whales whose current holdings differ from historical volume.",
            "default": false
          },
          "maxResults": {
            "title": "Max total results (optional cap)",
            "minimum": 0,
            "type": "integer",
            "description": "Optional hard ceiling on the total number of dataset rows across all metric x window combinations, for cost control. 0 means no extra cap (natural limit is metrics x windows x 50). Example: set 100 to stop after the first 100 rows. Defaults to 0.",
            "default": 0
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy settings. The Polymarket API is a public JSON endpoint, so the default Apify datacenter proxy is sufficient and cheapest. You normally do not need to change this. Residential is unnecessary here.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}