{
  "openapi": "3.0.1",
  "info": {
    "title": "Stack Exchange & Stack Overflow Scraper",
    "description": "Scrape Stack Overflow and 180+ Stack Exchange sites via the official API: full Q&A threads with answers and comments, edit history, bounties, tags, top answerers and user profiles. No login, no proxy.",
    "version": "0.1",
    "x-build-id": "bfvhdebxAY9YkDHl8"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/powernaner~stack-exchange-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-powernaner-stack-exchange-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/powernaner~stack-exchange-scraper/runs": {
      "post": {
        "operationId": "runs-sync-powernaner-stack-exchange-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/powernaner~stack-exchange-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-powernaner-stack-exchange-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": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "What to scrape",
            "enum": [
              "search",
              "questions",
              "threads",
              "bounties",
              "tags",
              "users",
              "sites"
            ],
            "type": "string",
            "description": "Search = keyword/tag search. Browse questions = latest/top questions, optionally by tag. Threads = specific questions by URL or id. Bounties = questions with an open bounty (reputation reward). Tags = tag details (wiki, synonyms, related tags, top answerers and askers). Users = profiles (top users by reputation, or by URL/id). Sites = every site in the Stack Exchange network with live statistics.",
            "default": "search"
          },
          "sites": {
            "title": "Sites",
            "type": "array",
            "description": "One or more Stack Exchange sites. Use the short name (stackoverflow, superuser, serverfault, askubuntu, math, unix...) or the domain (math.stackexchange.com). Each site is scraped separately and gets up to 'Max results' rows. Ignored in the 'Sites' mode. In 'Threads' and 'Users' modes, a pasted URL already says the site.",
            "default": [
              "stackoverflow"
            ],
            "items": {
              "type": "string"
            }
          },
          "query": {
            "title": "Search keywords",
            "type": "string",
            "description": "Free-text search in title and body (Search mode only). Example: asyncio, kubernetes ingress, \"null pointer\"."
          },
          "tags": {
            "title": "Tags",
            "type": "array",
            "description": "Stack Exchange tags, e.g. python, reactjs, c#. In Search mode a question needs AT LEAST ONE of the tags; in Browse and Bounties modes it needs ALL of them. In Tags mode, these are the tags to detail (empty = most popular tags).",
            "items": {
              "type": "string"
            }
          },
          "fromDate": {
            "title": "Created from",
            "type": "string",
            "description": "Only questions created on or after this day (YYYY-MM-DD, UTC). Search, Browse and Bounties modes."
          },
          "toDate": {
            "title": "Created until",
            "type": "string",
            "description": "Only questions created on or before this day, inclusive (YYYY-MM-DD, UTC). Search, Browse and Bounties modes."
          },
          "sort": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "activity",
              "creation",
              "votes",
              "hot",
              "week",
              "month"
            ],
            "type": "string",
            "description": "Search: relevance, activity, creation, votes. Browse: activity, creation, votes, hot, week, month. Bounties: activity, creation, votes. If the option doesn't exist in the chosen mode, the mode's default is used and the run summary says so."
          },
          "questionIds": {
            "title": "Question URLs or ids",
            "type": "array",
            "description": "Threads mode: paste question URLs (https://stackoverflow.com/questions/231767/...) or ids. Bare ids are looked up on the first site in 'Sites'.",
            "items": {
              "type": "string"
            }
          },
          "userIds": {
            "title": "User profile URLs or ids",
            "type": "array",
            "description": "Users mode: profile URLs (https://stackoverflow.com/users/22656/jon-skeet) or ids. Empty = top users of each site by reputation.",
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Max results per site",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum rows per site (per source). Without your own API key, the Stack Exchange API stops at page 25 (2,500 rows) and allows 300 requests per day per IP.",
            "default": 20
          },
          "includeAnswers": {
            "title": "Include answers",
            "type": "boolean",
            "description": "Put every answer (body, votes, accepted flag, author) inside the question row. Costs no extra requests.",
            "default": true
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Put the comments of the question and of each answer inside the row. Costs no extra requests.",
            "default": false
          },
          "bodyFormat": {
            "title": "Body format",
            "enum": [
              "markdown",
              "html",
              "both",
              "none"
            ],
            "type": "string",
            "description": "How question, answer and comment bodies are delivered: Markdown (as the author typed it), HTML (as rendered on the site), both, or none (smaller output).",
            "default": "markdown"
          },
          "includeRevisions": {
            "title": "Include edit history",
            "type": "boolean",
            "description": "Add the question's revisions (who edited, when, what changed in title and tags). One extra request per 100 questions.",
            "default": false
          },
          "includeOwnerProfiles": {
            "title": "Include asker profiles",
            "type": "boolean",
            "description": "Add the asker's badges, location, website, signup date and answer/question counts. One extra request per 100 questions.",
            "default": false
          },
          "topUsersPeriod": {
            "title": "Top users period (Tags mode)",
            "enum": [
              "all_time",
              "month"
            ],
            "type": "string",
            "description": "Top answerers and askers of each tag: all time or the last 30 days.",
            "default": "all_time"
          },
          "apiKey": {
            "title": "Stack Exchange API key (optional)",
            "type": "string",
            "description": "Optional. Your own Stack Exchange app key (free, register at stackapps.com/apps/oauth/register). Raises the API limit from 300 to 10,000 requests per day and removes the 25-page cap. It is a public app key, not a password; it is never logged."
          },
          "healthCheck": {
            "title": "Health check (internal)",
            "type": "boolean",
            "description": "Internal: daily self-test used by the maintainers. Ignores every other field and saves nothing to the dataset.",
            "default": false
          },
          "healthCheckSimulateFailure": {
            "title": "Simulate health check failure (internal)",
            "type": "boolean",
            "description": "Internal: with health check on, uses ids that do not exist so the failure alert can be tested.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}