{
  "openapi": "3.0.1",
  "info": {
    "title": "Polymarket Scraper - Prediction Market Odds, Volume & Events",
    "description": "Scrape Polymarket prediction markets: live odds per outcome, 24h and total volume, liquidity, bid/ask, price changes, end dates, tags and optional price history. Search by keyword or category, browse top events, or look up market URLs. No API key needed.",
    "version": "0.1",
    "x-build-id": "jvQAdv5e7R64WBhsB"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/hichemdev~polymarket-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-hichemdev-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/hichemdev~polymarket-scraper/runs": {
      "post": {
        "operationId": "runs-sync-hichemdev-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/hichemdev~polymarket-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-hichemdev-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": {
          "mode": {
            "title": "What to scrape",
            "enum": [
              "markets",
              "events",
              "urls"
            ],
            "type": "string",
            "description": "Markets: one row per market (a single Yes/No question or outcome) with its odds. Events: one row per event (e.g. 'Fed decision in December') with all its markets nested inside. Specific markets: look up the Polymarket URLs, slugs or IDs you list below.",
            "default": "markets"
          },
          "searchQuery": {
            "title": "Search keyword",
            "type": "string",
            "description": "Optional keyword, e.g. bitcoin, trump, fed, election, nba. Uses Polymarket's own search. Leave empty to browse all markets or events sorted by the order below."
          },
          "tag": {
            "title": "Category / tag",
            "type": "string",
            "description": "Optional Polymarket tag slug to filter by, e.g. politics, crypto, sports, economy, tech, geopolitics, elections, bitcoin. This is the last part of a polymarket.com category link."
          },
          "status": {
            "title": "Market status",
            "enum": [
              "active",
              "closed",
              "all"
            ],
            "type": "string",
            "description": "Active = still trading. Closed = trading ended (includes resolved markets with the winning outcome). All = both.",
            "default": "active"
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "volume24hr",
              "volume",
              "liquidity",
              "endingSoon",
              "newest"
            ],
            "type": "string",
            "description": "Order of results. Ending soon only returns markets or events whose end date is in the future.",
            "default": "volume24hr"
          },
          "urls": {
            "title": "Market URLs, slugs or IDs (Specific markets mode)",
            "type": "array",
            "description": "Polymarket links such as https://polymarket.com/event/<event-slug> (returns every market in the event) or https://polymarket.com/event/<event-slug>/<market-slug>, plus bare market or event slugs, numeric market IDs or 0x condition IDs.",
            "items": {
              "type": "string"
            }
          },
          "minVolume24hr": {
            "title": "Min 24h volume (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Optional. Skip markets or events that traded less than this many dollars in the last 24 hours."
          },
          "minLiquidity": {
            "title": "Min liquidity (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Optional. Skip markets or events with less order-book liquidity than this."
          },
          "includePriceHistory": {
            "title": "Include price history",
            "type": "boolean",
            "description": "Markets and specific-markets modes: add a priceHistory array (timestamp + probability of the first outcome, usually Yes) from Polymarket's CLOB. Adds one request per market, so runs are slower.",
            "default": false
          },
          "priceHistoryInterval": {
            "title": "Price history range",
            "enum": [
              "1d",
              "1w",
              "1m",
              "max"
            ],
            "type": "string",
            "description": "Time range for the price history. Points are hourly for 1 day and 1 week, every 6 hours for 1 month and daily for all time.",
            "default": "1w"
          },
          "maxMarketsPerEvent": {
            "title": "Max markets per event (Events mode)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Events mode: cap the nested markets array per event (sorted by probability, highest first). Large events such as presidential nominations hold 100+ markets.",
            "default": 50
          },
          "maxItems": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Stop after this many dataset rows (markets or events).",
            "default": 100
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Optional. A proxy is not required: Polymarket's public API works without one."
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}