{
  "openapi": "3.0.1",
  "info": {
    "title": "Stack Overflow & Stack Exchange Scraper - Q&A, Users & Tags",
    "description": "Scrape Stack Overflow & 360+ Stack Exchange sites: questions, answers, tags & full-text search with full body, votes, views & owners. Get developer leads (top users with location, website, socials & reputation). Monitor new questions. No login.",
    "version": "0.1",
    "x-build-id": "zNsxSxocdElINJYW0"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapesage~stackexchange-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapesage-stackexchange-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/scrapesage~stackexchange-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapesage-stackexchange-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/scrapesage~stackexchange-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapesage-stackexchange-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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "questions",
              "answers",
              "users",
              "tags"
            ],
            "type": "string",
            "description": "What to scrape. <code>search</code> = full-text search for questions (default). <code>questions</code> = browse questions by tag / newest / most-voted / unanswered. <code>answers</code> = answers (by question, by user, or network-wide). <code>users</code> = developer leads (top users, by name, or by id). <code>tags</code> = tags with counts, synonyms & wiki.",
            "default": "search"
          },
          "site": {
            "title": "Site",
            "type": "string",
            "description": "Which Stack Exchange site to scrape (the API site parameter). Examples: <code>stackoverflow</code>, <code>serverfault</code>, <code>superuser</code>, <code>askubuntu</code>, <code>math</code>, <code>math.meta</code>, <code>datascience</code>, <code>devops</code>, <code>security</code>, <code>dba</code>, <code>codereview</code>, <code>softwareengineering</code>, <code>unix</code>, <code>apple</code>, <code>gaming</code>, <code>ux</code>. 360+ sites supported. Auto-detected from Start URLs when those are used.",
            "default": "stackoverflow"
          },
          "searchQuery": {
            "title": "Search query (free text)",
            "type": "string",
            "description": "Full-text query for <code>search</code> mode — matched against question titles & bodies (e.g. <code>fastapi async background task</code>). Leave empty to browse by tag/date instead."
          },
          "tags": {
            "title": "Tags",
            "type": "array",
            "description": "Tags to filter by (e.g. <code>python</code>, <code>kubernetes</code>, <code>react</code>). In <code>search</code>/<code>questions</code> mode a question must carry ALL listed tags. In <code>tags</code> mode these are looked up directly (counts, synonyms, wiki).",
            "items": {
              "type": "string"
            }
          },
          "questionIds": {
            "title": "Question IDs",
            "type": "array",
            "description": "Specific question IDs to fetch (numeric, e.g. <code>231767</code>). In <code>questions</code> mode returns those questions; in <code>answers</code> mode returns their answers.",
            "items": {
              "type": "string"
            }
          },
          "userIds": {
            "title": "User IDs",
            "type": "array",
            "description": "Specific user IDs to fetch (numeric, e.g. <code>22656</code>). In <code>users</code> mode returns those developer leads; in <code>answers</code> mode returns those users' answers.",
            "items": {
              "type": "string"
            }
          },
          "userName": {
            "title": "User name (search by name)",
            "type": "string",
            "description": "In <code>users</code> mode, find users whose display name matches this text (e.g. <code>jon skeet</code>). Leave empty to list the highest-reputation users on the site."
          },
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "Paste Stack Exchange URLs to scrape directly — question pages (<code>/questions/123/...</code>), answer permalinks (<code>/a/456</code>), user profiles (<code>/users/789/...</code>), tag pages (<code>/questions/tagged/python</code>) or search pages (<code>/search?q=...</code>). The site is auto-detected from each URL's host (stackoverflow.com, serverfault.com, *.stackexchange.com, askubuntu.com, mathoverflow.net, …).",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "sort": {
            "title": "Sort",
            "enum": [
              "votes",
              "activity",
              "creation",
              "hot",
              "week",
              "month",
              "relevance",
              "reputation",
              "popular",
              "name"
            ],
            "type": "string",
            "description": "Result ordering. For questions/search: <code>votes</code>, <code>activity</code>, <code>creation</code> (newest), <code>hot</code>, <code>week</code>, <code>month</code> (relevance is used automatically when a search query is given). For users: <code>reputation</code>, <code>creation</code>, <code>name</code>, <code>modified</code>. For tags: <code>popular</code>, <code>activity</code>, <code>name</code>.",
            "default": "votes"
          },
          "order": {
            "title": "Order",
            "enum": [
              "desc",
              "asc"
            ],
            "type": "string",
            "description": "Sort direction.",
            "default": "desc"
          },
          "acceptedOnly": {
            "title": "Accepted-answer questions only",
            "type": "boolean",
            "description": "In <code>search</code> mode, only return questions that have an accepted answer.",
            "default": false
          },
          "minAnswers": {
            "title": "Minimum answers",
            "minimum": 0,
            "type": "integer",
            "description": "In <code>search</code> mode, only return questions with at least this many answers (e.g. <code>1</code> to skip unanswered questions)."
          },
          "fromDate": {
            "title": "From date",
            "type": "string",
            "description": "Only include items created on/after this date (YYYY-MM-DD). Great for daily monitoring runs."
          },
          "toDate": {
            "title": "To date",
            "type": "string",
            "description": "Only include items created on/before this date (YYYY-MM-DD)."
          },
          "includeAnswers": {
            "title": "Include answers",
            "type": "boolean",
            "description": "In <code>search</code>/<code>questions</code> mode, also fetch each question's answers and emit them as separate <code>answer</code> records (full body, score, accepted flag, owner). Charged per answer.",
            "default": false
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Attach the comment thread (body, owner, score) to each question/answer record. Comments are nested into the record (no separate charge).",
            "default": false
          },
          "includeUserTopTags": {
            "title": "Include user top tags",
            "type": "boolean",
            "description": "In <code>users</code> mode, fetch each developer's top tags by answer score (one extra request per user). Adds <code>topTags</code> to the lead record.",
            "default": false
          },
          "includeTagDetails": {
            "title": "Include tag details (wiki + top users)",
            "type": "boolean",
            "description": "In <code>tags</code> mode, also fetch each tag's wiki excerpt and its all-time top answerers and askers (extra requests per tag).",
            "default": false
          },
          "enrichUserContacts": {
            "title": "Enrich developer leads (emails, phone, socials)",
            "type": "boolean",
            "description": "In <code>users</code> mode, crawl each developer's personal website (home + contact/about, up to 3 pages) for contact emails, phone and social links, then assign a 0-100 lead score. Stack Exchange exposes the website & bio — this turns top contributors into contactable recruiting / dev-marketing leads.",
            "default": false
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of primary records to output (questions in search/questions mode, answers in answers mode, users in users mode, tags in tags mode). Answer/comment enrichment rows are additional.",
            "default": 100
          },
          "includeBodyMarkdown": {
            "title": "Include Markdown body",
            "type": "boolean",
            "description": "Also include the original Markdown source (<code>bodyMarkdown</code>) of questions/answers alongside the rendered HTML and the clean plain-text body.",
            "default": true
          },
          "monitorMode": {
            "title": "Monitor mode (only new items)",
            "type": "boolean",
            "description": "Remember item IDs across runs in a named key-value store and output ONLY items not seen before. Combine with an Apify Schedule (e.g. hourly/daily) for new-question or new-answer alerts on a tag, search or site. Works alongside Apify Schedules — it does not replace them.",
            "default": false
          },
          "monitorKey": {
            "title": "Monitor key",
            "type": "string",
            "description": "Names the memory bucket for monitor mode. Use a distinct key per saved configuration (e.g. <code>so-python-new</code>) so separate monitors don't share state.",
            "default": "default"
          },
          "apiKey": {
            "title": "Stack Apps API key (optional)",
            "type": "string",
            "description": "Optional free key from <a href='https://stackapps.com/apps/oauth/register'>stackapps.com</a>. Not required — the actor works keyless — but a key raises the daily request quota from 300 to 10,000, useful for large or frequent runs."
          },
          "accessToken": {
            "title": "OAuth access token (optional)",
            "type": "string",
            "description": "Optional OAuth access token (used together with the API key) for the highest quotas. Almost never needed for public data."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy settings. The default Apify proxy is recommended — the actor rotates a fresh IP per request to spread the Stack Exchange per-IP daily quota.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}