{
  "openapi": "3.0.1",
  "info": {
    "title": "Polymarket Scraper: Markets, Order Book, Trades, Price History",
    "description": "Bulk scrape Polymarket prediction markets by category, keyword, tag, slug, or condition ID. One row per market with outcomes, YES and NO prices, 24h volume, liquidity, end date, plus optional order book, recent trades, and price history. No third party API key. Pay per row.",
    "version": "0.1",
    "x-build-id": "79xoCc42T90cxJ72h"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapemint~polymarket-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapemint-polymarket-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/scrapemint~polymarket-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapemint-polymarket-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/scrapemint~polymarket-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapemint-polymarket-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": {
          "searchQueries": {
            "title": "Search queries",
            "type": "array",
            "description": "Keyword search across market questions and descriptions. Each query runs separately and results merge.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "title": "Categories",
            "type": "array",
            "description": "Top level Polymarket categories. Resolves to internal tag IDs.",
            "items": {
              "type": "string",
              "enum": [
                "sports",
                "politics",
                "crypto",
                "tech",
                "music",
                "entertainment",
                "elections",
                "basketball",
                "football",
                "blockchain"
              ],
              "enumTitles": [
                "Sports",
                "Politics",
                "Crypto",
                "Tech",
                "Music",
                "Entertainment",
                "Elections",
                "Basketball",
                "Football",
                "Blockchain"
              ]
            },
            "default": []
          },
          "tagIds": {
            "title": "Tag IDs",
            "type": "array",
            "description": "Direct numeric tag IDs from Polymarket (advanced). Useful when a category is not in the dropdown.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "marketSlugs": {
            "title": "Market slugs",
            "type": "array",
            "description": "Direct market slugs to scrape, e.g. \"will-trump-win-2024\". Found in the Polymarket URL after /event/.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "conditionIds": {
            "title": "Condition IDs",
            "type": "array",
            "description": "Direct hex condition IDs (0x...). Bypasses search and pulls the exact market.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "status": {
            "title": "Market status",
            "enum": [
              "active",
              "closed",
              "resolved",
              "all"
            ],
            "type": "string",
            "description": "Active = currently trading. Closed = no longer accepting orders. Resolved = outcome decided.",
            "default": "active"
          },
          "minVolume24h": {
            "title": "Minimum 24h volume (USD)",
            "minimum": 0,
            "type": "number",
            "description": "Drop markets below this 24h trading volume.",
            "default": 0
          },
          "minTotalVolume": {
            "title": "Minimum total volume (USD)",
            "minimum": 0,
            "type": "number",
            "description": "Drop markets below this lifetime volume.",
            "default": 0
          },
          "minLiquidity": {
            "title": "Minimum liquidity (USD)",
            "minimum": 0,
            "type": "number",
            "description": "Drop markets below this on book liquidity. Useful for filtering thin markets.",
            "default": 0
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "volume24hr",
              "liquidity",
              "endDate",
              "startDate"
            ],
            "type": "string",
            "description": "Order applied before maxItemsTotal cap.",
            "default": "volume24hr"
          },
          "includeOrderbook": {
            "title": "Include order book",
            "type": "boolean",
            "description": "Pull the live CLOB order book per outcome (top bids and asks with size). Adds 1 request per outcome.",
            "default": false
          },
          "orderbookDepth": {
            "title": "Order book depth",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Max number of bid + ask levels to keep per outcome.",
            "default": 10
          },
          "includeRecentTrades": {
            "title": "Include recent trades",
            "type": "boolean",
            "description": "Pull the most recent trades for each market from the public data API. Adds 1 request per market.",
            "default": false
          },
          "recentTradesLimit": {
            "title": "Recent trades per market",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Max number of recent trades to attach per market.",
            "default": 25
          },
          "includePriceHistory": {
            "title": "Include price history",
            "type": "boolean",
            "description": "Pull the YES outcome price history time series for each market. Adds 1 request per market.",
            "default": false
          },
          "priceHistoryInterval": {
            "title": "Price history interval",
            "enum": [
              "1h",
              "6h",
              "1d",
              "1w",
              "1m",
              "max"
            ],
            "type": "string",
            "description": "Time window for price history. Polymarket samples within the window.",
            "default": "1d"
          },
          "maxItemsPerSource": {
            "title": "Max items per source",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Hard cap per (search query, category, tag) combination. Stops paging once reached.",
            "default": 100
          },
          "maxItemsTotal": {
            "title": "Total maximum items",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Hard cap on rows pushed per run across all sources. 0 means unlimited.",
            "default": 200
          },
          "dedupe": {
            "title": "Deduplicate across runs",
            "type": "boolean",
            "description": "Skip condition IDs already pushed in previous runs. Persisted in a key value store. Turn off to refresh.",
            "default": true
          },
          "concurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 16,
            "type": "integer",
            "description": "Number of enrichment requests fetched in parallel.",
            "default": 4
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify proxy. Polymarket public APIs work fine on datacenter or unproxied; residential is only needed if you hit aggressive rate limits.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": []
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}