{
  "openapi": "3.0.1",
  "info": {
    "title": "Stack Overflow Scraper: Questions, Answers, Users & Tags",
    "description": "Scrape any Stack Exchange site (stackoverflow, superuser, askubuntu, math.stackexchange and 170+ more) via the official Stack Exchange API. Questions, answers with full body, user profiles with reputation and badges, top tags, search. No auth, no proxies, no cookies. Pay only per result item.",
    "version": "0.1",
    "x-build-id": "6Lx6OcIlMOb9jSDiO"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/perconey~stackoverflow-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-perconey-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/perconey~stackoverflow-scraper/runs": {
      "post": {
        "operationId": "runs-sync-perconey-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/perconey~stackoverflow-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-perconey-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",
        "required": [
          "action",
          "site"
        ],
        "properties": {
          "action": {
            "title": "What do you want to scrape?",
            "enum": [
              "getQuestions",
              "searchQuestions",
              "getQuestionsByTag",
              "getQuestionDetail",
              "getUserProfile",
              "getUserAnswers",
              "searchUsers",
              "getTopTags"
            ],
            "type": "string",
            "description": "Pick the type of data. getQuestions and getTopTags work with no queries. searchQuestions, getQuestionsByTag, getQuestionDetail, getUserProfile, getUserAnswers and searchUsers need at least one entry in queries.",
            "default": "getQuestions"
          },
          "site": {
            "title": "Stack Exchange site",
            "type": "string",
            "description": "Which SE site to query. Defaults to stackoverflow. Full list at https://api.stackexchange.com/docs/sites. Common alternatives: superuser, askubuntu, math.stackexchange, gaming.stackexchange, parenting.stackexchange, codereview.stackexchange.",
            "default": "stackoverflow"
          },
          "queries": {
            "title": "Queries",
            "type": "array",
            "description": "Depends on the action: searchQuestions/searchUsers - free text. getQuestionsByTag - a single tag like 'python' or 'react'. getQuestionDetail - question id (e.g. 11227809) or full URL. getUserProfile/getUserAnswers - user id (e.g. 22656 for Jon Skeet) or full profile URL. getQuestions and getTopTags can be left empty.",
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Max items per query",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Stop after this many items per query. Use 0 for unlimited (subject to API quota).",
            "default": 100
          },
          "sort": {
            "title": "Sort order",
            "type": "string",
            "description": "How to sort results. Valid values depend on the action - see https://api.stackexchange.com/docs. Common: 'votes' (default for getQuestions), 'activity', 'creation', 'hot', 'week', 'month', 'reputation' (default for searchUsers)."
          },
          "order": {
            "title": "Order direction",
            "enum": [
              "desc",
              "asc"
            ],
            "type": "string",
            "description": "asc or desc. Default desc.",
            "default": "desc"
          },
          "tagged": {
            "title": "Tagged with",
            "type": "string",
            "description": "For getQuestions and searchQuestions: restrict to questions with this tag (e.g. 'python', 'react'). Multiple tags can be semi-colon separated."
          },
          "since": {
            "title": "Since (ISO date)",
            "type": "string",
            "description": "Only items on or after this date. Format 2024-01-01 or 2024-01-01T00:00:00Z. Applies to question-listing actions."
          },
          "until": {
            "title": "Until (ISO date)",
            "type": "string",
            "description": "Only items before this date."
          },
          "includeBody": {
            "title": "Include full body markdown",
            "type": "boolean",
            "description": "If true, also returns the full question/answer body (markdown). Doubles response payload but lets you skip a follow-up call.",
            "default": false
          },
          "includeAnswers": {
            "title": "Include answers (getQuestionDetail only)",
            "type": "boolean",
            "description": "For getQuestionDetail: also fetch all answers (with body). Each answer counts as one more result-item.",
            "default": true
          },
          "apiKey": {
            "title": "Stack Apps API key (optional)",
            "type": "string",
            "description": "Anonymous quota is 300 requests/day per IP. Register a free app at https://stackapps.com/apps/oauth/register to get a key and unlock 10,000/day per IP."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}