{
  "openapi": "3.0.1",
  "info": {
    "title": "Stack Overflow & Stack Exchange Scraper",
    "description": "[💰 $2.5 / 1K] Extract questions from Stack Overflow and the 170+ site Stack Exchange network. Search by keyword or tag, sort by votes/activity, or pull specific questions by URL. Optionally collect answers and comments as linked rows.",
    "version": "1.0",
    "x-build-id": "TjDwgdFtNbhVKv7db"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/solidcode~stackoverflow-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-solidcode-stackoverflow-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/solidcode~stackoverflow-scraper/runs": {
      "post": {
        "operationId": "runs-sync-solidcode-stackoverflow-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/solidcode~stackoverflow-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-solidcode-stackoverflow-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": {
          "site": {
            "title": "Site",
            "enum": [
              "stackoverflow",
              "serverfault",
              "superuser",
              "askubuntu",
              "math",
              "datascience",
              "stats",
              "dba",
              "softwareengineering",
              "security",
              "unix",
              "apple",
              "android",
              "webmasters",
              "gamedev",
              "ux",
              "tex",
              "wordpress",
              "gis",
              "electronics",
              "ai",
              "codereview",
              "sharepoint",
              "salesforce",
              "ethereum",
              "bitcoin",
              "magento",
              "raspberrypi",
              "arduino",
              "physics"
            ],
            "type": "string",
            "description": "Which Stack Exchange site to pull from. Stack Overflow is the default. Pick another community to scrape questions from it instead.",
            "default": "stackoverflow"
          },
          "searchQuery": {
            "title": "Search Keyword",
            "type": "string",
            "description": "Full-text search across question titles and bodies (e.g. 'kubernetes ingress timeout', 'pandas groupby'). Leave blank to browse by tag and sort order instead."
          },
          "tags": {
            "title": "Tags",
            "uniqueItems": true,
            "type": "array",
            "description": "Only include questions carrying ALL of these tags (e.g. 'python', 'pandas'). Use the exact tag names as they appear on the site. Leave empty to include every tag.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "questionUrlsOrIds": {
            "title": "Question URLs or IDs",
            "uniqueItems": true,
            "type": "array",
            "description": "Fetch specific questions directly. Paste question URLs (e.g. 'https://stackoverflow.com/questions/11227809/why-is-processing-a-sorted-array-faster') or bare numeric question IDs. When you use this, the keyword/tag/sort finders above are ignored for those questions.",
            "items": {
              "type": "string"
            }
          },
          "sort": {
            "title": "Sort By",
            "enum": [
              "activity",
              "creation",
              "votes",
              "hot",
              "week",
              "month"
            ],
            "type": "string",
            "description": "Order in which questions are collected. 'Hot', 'Top this week' and 'Top this month' surface trending questions; 'Newest' is best for scheduled runs that pick up fresh questions.",
            "default": "activity"
          },
          "fromDate": {
            "title": "From Date",
            "type": "string",
            "description": "Only include questions created on or after this date (YYYY-MM-DD). Leave blank for no lower bound. Perfect for scheduled 'new since yesterday' runs."
          },
          "toDate": {
            "title": "To Date",
            "type": "string",
            "description": "Only include questions created on or before this date (YYYY-MM-DD). Leave blank for no upper bound."
          },
          "maxResults": {
            "title": "Maximum Questions",
            "minimum": 0,
            "type": "integer",
            "description": "Hard cap on how many questions to collect. Default 100 — increase for bigger runs, or set to 0 for as many as the site returns (an internal upper bound still prevents runaway pagination). The actor keeps the full last page even if it slightly overshoots this number. Ignored when you fetch specific question URLs/IDs — those are always all collected.",
            "default": 100
          },
          "includeQuestionBody": {
            "title": "Include question body text",
            "type": "boolean",
            "description": "Include each question's full body text (Markdown), not just its title. Useful for content analysis and LLM pipelines.",
            "default": false
          },
          "includeAnswers": {
            "title": "Include answers",
            "type": "boolean",
            "description": "For each question, also collect its answers — with body text, score, accepted flag, and author — as separate rows linked by question ID. Popular questions can have dozens of answers, so this adds work and cost per question.",
            "default": false
          },
          "maxAnswersPerQuestion": {
            "title": "Max Answers per Question",
            "minimum": 0,
            "type": "integer",
            "description": "Cap how many answers to collect per question when answers are enabled. Set to 0 for all answers. Only used when 'Include answers' is on.",
            "default": 0
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Also collect comments as separate rows linked by question ID. Question comments are always included when this is on. Answer comments are included when both answers and comments are enabled. Busy threads can carry hundreds of comments, so this adds work and cost per question.",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}