{
  "openapi": "3.0.1",
  "info": {
    "title": "Polymarket Scraper — Markets, Odds & Price History",
    "description": "Collect Polymarket markets with outcome odds, traded volumes, liquidity, event metadata and optional historical prices. Search by topic or tag, fetch market and event slugs, and export one record per market.",
    "version": "0.1",
    "x-build-id": "Ubh8bzWwHTFPRgnWE"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/s-r~polymarket-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-s-r-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/s-r~polymarket-scraper/runs": {
      "post": {
        "operationId": "runs-sync-s-r-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/s-r~polymarket-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-s-r-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": {
          "search": {
            "title": "Search",
            "maxLength": 500,
            "type": "string",
            "description": "Search public Polymarket events; matching markets are fetched with full metadata."
          },
          "tag": {
            "title": "Tag",
            "maxLength": 200,
            "type": "string",
            "description": "Category or tag slug, such as crypto, politics or sports."
          },
          "event_slugs": {
            "title": "Event slugs",
            "type": "array",
            "description": "Event slugs or full https://polymarket.com/event/<slug> URLs. Explicit selectors take priority over search and tag filters.",
            "items": {
              "type": "string"
            }
          },
          "market_slugs": {
            "title": "Market slugs",
            "type": "array",
            "description": "Market slugs to fetch. Explicit selectors take priority over list filters.",
            "items": {
              "type": "string"
            }
          },
          "condition_ids": {
            "title": "Condition ids",
            "type": "array",
            "description": "Market condition IDs, each 0x followed by 64 hexadecimal characters.",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "title": "Status",
            "enum": [
              "active",
              "closed",
              "all"
            ],
            "type": "string",
            "description": "active selects markets with closed=false; closed includes resolved markets; all includes both.",
            "default": "active"
          },
          "sort_by": {
            "title": "Sort by",
            "enum": [
              "volume_24h",
              "volume_1wk",
              "volume_1mo",
              "volume",
              "liquidity",
              "end_date",
              "start_date"
            ],
            "type": "string",
            "description": "Sort delivered markets numerically by volume or liquidity, or by date. Search and explicit selectors sort each delivered page.",
            "default": "volume_24h"
          },
          "ascending": {
            "title": "Ascending",
            "type": "boolean",
            "description": "Sort in ascending order.",
            "default": false
          },
          "min_volume": {
            "title": "Min volume",
            "minimum": 0,
            "type": "number",
            "description": "Minimum total traded volume in USD for list and search modes."
          },
          "min_liquidity": {
            "title": "Min liquidity",
            "minimum": 0,
            "type": "number",
            "description": "Minimum liquidity in USD for list and search modes."
          },
          "max_items": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum total markets to deliver. A request returns up to 100; continue with cursor for larger collections. Apify follows cursors automatically.",
            "default": 100
          },
          "include_price_history": {
            "title": "Include price history",
            "type": "boolean",
            "description": "Include price history for selected outcomes within each market row.",
            "default": false
          },
          "history_interval": {
            "title": "History interval",
            "enum": [
              "1h",
              "6h",
              "1d",
              "1w",
              "1m",
              "max"
            ],
            "type": "string",
            "description": "Price history interval. max uses a smaller request page to limit memory.",
            "default": "1w"
          },
          "history_fidelity": {
            "title": "History fidelity",
            "minimum": 1,
            "maximum": 10080,
            "type": "integer",
            "description": "History resolution in minutes. Minimum 5 for 1w, 10 for 1m, otherwise 1. Values below 60 use a smaller page.",
            "default": 60
          },
          "history_outcomes": {
            "title": "History outcomes",
            "enum": [
              "all",
              "first"
            ],
            "type": "string",
            "description": "Fetch all outcomes or only the first outcome in source order.",
            "default": "all"
          },
          "cursor": {
            "title": "Cursor",
            "maxLength": 2000000,
            "type": "string",
            "description": "Opaque next_cursor from the previous response. Repeat the same filters; the original total limit is preserved."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}