{
  "openapi": "3.0.1",
  "info": {
    "title": "Stack Overflow Scraper",
    "description": "Stack Overflow Scraper is a Python tool designed to extract Q&A data, accepted answers, vote counts, code snippets, and user profiles from Stack Overflow. It exports structured developer knowledge into clean CSV or JSON formats for research and AI model training.",
    "version": "0.0",
    "x-build-id": "xNhB6QGREFZvubREn"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/real-estate-api~Stack-Overflow-Scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-real-estate-api-Stack-Overflow-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/real-estate-api~Stack-Overflow-Scraper/runs": {
      "post": {
        "operationId": "runs-sync-real-estate-api-Stack-Overflow-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/real-estate-api~Stack-Overflow-Scraper/run-sync": {
      "post": {
        "operationId": "run-sync-real-estate-api-Stack-Overflow-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": [
              "questions",
              "search",
              "answers",
              "tags",
              "users",
              "sites"
            ],
            "type": "string",
            "description": "Questions by tag, advanced question search, answers for question ids, tags, users, or the list of Stack Exchange sites.",
            "default": "search"
          },
          "site": {
            "title": "Site",
            "type": "string",
            "description": "api_site_parameter, e.g. stackoverflow, superuser, serverfault, askubuntu, math, datascience. Ignored for the sites list.",
            "default": "stackoverflow"
          },
          "query": {
            "title": "Search query",
            "type": "string",
            "description": "Keyword query for search mode. Sent as q to /search/advanced."
          },
          "tags": {
            "title": "Tags (all must match)",
            "type": "array",
            "description": "Tags that must all match. Used as tagged on questions and search. One tag per line.",
            "items": {
              "type": "string"
            }
          },
          "titleContains": {
            "title": "Title contains",
            "type": "string",
            "description": "Search mode only. Keep questions whose title contains this text."
          },
          "acceptedOnly": {
            "title": "Only questions with accepted answer",
            "type": "boolean",
            "description": "Search mode only. When checked, only questions with an accepted answer are returned.",
            "default": false
          },
          "minAnswers": {
            "title": "Min answers",
            "minimum": 0,
            "type": "integer",
            "description": "Search mode only. Minimum number of answers a question must have."
          },
          "sort": {
            "title": "Sort",
            "enum": [
              "activity",
              "creation",
              "votes",
              "relevance",
              "popular",
              "reputation"
            ],
            "type": "string",
            "description": "relevance: search only; popular: tags; reputation: users. A sort the endpoint does not accept is replaced with that mode's usual sort.",
            "default": "activity"
          },
          "fromDate": {
            "title": "From date",
            "type": "string",
            "description": "Oldest creation date for questions and search, inclusive. Sent as a Unix timestamp."
          },
          "toDate": {
            "title": "To date",
            "type": "string",
            "description": "Newest creation date for questions and search, inclusive. Sent as a Unix timestamp."
          },
          "questionIds": {
            "title": "Question IDs or URLs (answers mode)",
            "type": "array",
            "description": "Answers mode. Numeric question ids or stackoverflow.com/questions/ID URLs. Up to 100 ids are sent per request.",
            "items": {
              "type": "string"
            }
          },
          "userIds": {
            "title": "User IDs or profile URLs (users mode)",
            "type": "array",
            "description": "Users mode. Numeric user ids or /users/ID profile URLs. When this list is set, name search is skipped.",
            "items": {
              "type": "string"
            }
          },
          "nameContains": {
            "title": "Name contains (tags/users)",
            "type": "string",
            "description": "Partial name for tags (inname) or users (inname). Leave empty to list by the selected sort."
          },
          "includeBody": {
            "title": "Include full body",
            "type": "boolean",
            "description": "Request filter=withbody and store the question or answer body. Turn off to keep rows smaller.",
            "default": true
          },
          "includeAnswers": {
            "title": "Fetch answers for each question",
            "type": "boolean",
            "description": "Questions and search only. Batches up to 100 question ids per /questions/{ids}/answers call and nests the answers on each question.",
            "default": false
          },
          "bodyFormat": {
            "title": "Body format",
            "enum": [
              "markdown",
              "text",
              "html"
            ],
            "type": "string",
            "description": "How to store the body: Markdown, plain text, or the original HTML.",
            "default": "markdown"
          },
          "maxItems": {
            "title": "Max results (total)",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Free cap 10,000. Without an API key Stack Exchange allows about 300 requests/day per IP (100 items each).",
            "default": 200
          },
          "timeoutSecs": {
            "title": "Run timeout (seconds)",
            "minimum": 1,
            "maximum": 3600,
            "type": "integer",
            "description": "Stop the run after this many seconds and write a timeout error row. Default 300. Maximum 3600.",
            "default": 300
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 1,
            "maximum": 300,
            "type": "integer",
            "description": "How long to wait for one Stack Exchange response. Default 30 seconds.",
            "default": 30
          },
          "apiKey": {
            "title": "Stack Apps API key (optional)",
            "type": "string",
            "description": "Optional Stack Apps key. It is sent only on the request and is never written to the dataset or the repo. A key raises the daily quota from about 300 requests per IP to 10,000."
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Optional proxy for Stack Exchange requests. Leave this off unless an IP has used its daily quota. The API allows calls with no proxy.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}