{
  "openapi": "3.0.1",
  "info": {
    "title": "Stack Overflow Scraper — Q&A Search on 184 Stack Exchange Sites",
    "description": "Search Stack Overflow and 184 Stack Exchange sites: full-text search with tag/date/score/views/accepted filters, tag feeds for monitoring, questions by id, users and tag stats. Returns clean-text questions with top answers and comments in one request.",
    "version": "0.1",
    "x-build-id": "nA08TPd6rXCuIZ49y"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/yadroo~stackexchange-search/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-yadroo-stackexchange-search",
        "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/yadroo~stackexchange-search/runs": {
      "post": {
        "operationId": "runs-sync-yadroo-stackexchange-search",
        "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/yadroo~stackexchange-search/run-sync": {
      "post": {
        "operationId": "run-sync-yadroo-stackexchange-search",
        "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",
              "tag",
              "questions",
              "users",
              "tagInfo"
            ],
            "type": "string",
            "description": "What to fetch. `search` = full-text search (`queries`) with the filters below. `tag` = the questions on `tagged`, newest / most active / top first — for monitoring a product tag. `questions` = specific `questionIds` with their answers. `users` = profiles by id, profile URL or display name. `tagInfo` = question counts, synonyms and related tags for `tags`.",
            "default": "search"
          },
          "queries": {
            "title": "Search queries",
            "type": "array",
            "description": "Free-text queries for `search` mode (one API call chain per query). Each query is matched against title and body. Leave empty to search only by the structured filters below (e.g. `tagged` + `minViews`).",
            "items": {
              "type": "string"
            }
          },
          "site": {
            "title": "Site",
            "type": "string",
            "description": "Stack Exchange site as the API `site` parameter: `stackoverflow` (used when empty), `serverfault`, `superuser`, `askubuntu`, `unix`, `dba`, `security`, `datascience`, `ai`, `math`, `english`, `workplace`, `law`, `money`… (184 main sites) or a meta site like `meta.stackoverflow`. Site URLs (`https://askubuntu.com`) and site names (`Ask Ubuntu`) work too. An unknown site stops the run before any request, with the error naming it."
          },
          "tagged": {
            "title": "Tagged (AND)",
            "type": "string",
            "description": "Questions having ALL of these tags, separated by `;` (e.g. `python;pandas`). Required in `tag` mode; a filter in `search` mode; in `tagInfo` mode these tags are looked up too. The API has no OR — run one input per tag instead."
          },
          "questionIds": {
            "title": "Question ids / URLs",
            "type": "array",
            "description": "For `questions` mode: numeric ids or question URLs (e.g. `https://stackoverflow.com/questions/11227809/...`), 100 per API request. Ids the site does not have are listed in SUMMARY.notFound (no row, not charged); entries without an id are skipped with a warning.",
            "items": {
              "type": "string"
            }
          },
          "users": {
            "title": "Users",
            "type": "array",
            "description": "For `users` mode: numeric user ids, profile URLs (`/users/22656/...`) or display names to search (up to `limit` matches per name).",
            "items": {
              "type": "string"
            }
          },
          "tags": {
            "title": "Tags",
            "type": "array",
            "description": "For `tagInfo` mode: tag names to look up (question count, synonyms, moderator-only flag, optional related tags). Unknown tags are listed in SUMMARY.notFound (no row, not charged).",
            "items": {
              "type": "string"
            }
          },
          "unanswered": {
            "title": "Unanswered filter",
            "enum": [
              "any",
              "noAnswers",
              "noAcceptedAnswer"
            ],
            "type": "string",
            "description": "`noAnswers` = only questions with 0 answers; `noAcceptedAnswer` = only questions without an accepted answer. Tag mode uses the API's own lists (/questions/no-answers, /questions/unanswered; sort activity, creation or votes). Search mode asks for questions without an accepted answer and keeps those with 0 answers on its side, reading more pages per query (up to 5 pages per 100 of `limit`, at most 25) until `limit` such questions are found.",
            "default": "any"
          },
          "fromDate": {
            "title": "From date",
            "pattern": "^(|\\d{9,13}|\\d{4}-\\d{2}-\\d{2}([T ]\\d{2}:\\d{2}(:\\d{2}(\\.\\d{1,9})?)?([Zz]|[+-]\\d{2}:?\\d{2})?)?)$",
            "type": "string",
            "description": "Only questions created on or after this date (search and tag modes): `YYYY-MM-DD`, a full ISO 8601 time (no zone = UTC) or unix seconds. Anything else stops the run before any request."
          },
          "toDate": {
            "title": "To date",
            "pattern": "^(|\\d{9,13}|\\d{4}-\\d{2}-\\d{2}([T ]\\d{2}:\\d{2}(:\\d{2}(\\.\\d{1,9})?)?([Zz]|[+-]\\d{2}:?\\d{2})?)?)$",
            "type": "string",
            "description": "Only questions created on or before this date (search and tag modes); a bare `YYYY-MM-DD` includes that whole day (UTC). Same formats as From date."
          },
          "sort": {
            "title": "Sort",
            "enum": [
              "relevance",
              "activity",
              "creation",
              "votes",
              "hot",
              "week",
              "month",
              "reputation",
              "name",
              "modified"
            ],
            "type": "string",
            "description": "Sort field; empty = the mode's default. Search: relevance (default) | activity | creation | votes. Tag: activity (default) | creation | votes | hot | week | month (with `unanswered`: activity, creation or votes). Users: reputation (default) | creation | name | modified. A sort the mode does not have falls back to the mode default, with a warning in the status message and SUMMARY."
          },
          "order": {
            "title": "Order",
            "enum": [
              "desc",
              "asc"
            ],
            "type": "string",
            "description": "Sort direction.",
            "default": "desc"
          },
          "limit": {
            "title": "Max questions per query",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Questions per query / per tag feed (search and tag modes), and matches per display name (users mode). Read 100 per API request. With `unanswered: noAnswers` in search mode, only questions with 0 answers count.",
            "default": 20
          },
          "maxItems": {
            "title": "Max items total",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Hard cap on rows for the whole run (cost guard). The run also stops at your max cost per run.",
            "default": 1000
          },
          "includeAnswers": {
            "title": "Include top answers",
            "minimum": 0,
            "maximum": 30,
            "type": "integer",
            "description": "How many answers to embed per question (accepted first, then by score). They come in the same request as the question — no extra API calls. 0 = none.",
            "default": 2
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Embed comments on questions (and on embedded answers). Same request, larger items.",
            "default": false
          },
          "fields": {
            "title": "Only these fields",
            "type": "array",
            "description": "Only these top-level columns, in this order (e.g. `[\"title\",\"url\",\"score\",\"answers\"]`). `id` is always kept: first, unless you list it elsewhere. Letter case is ignored, and a near miss with a single candidate (`titel`) is read as that column — both with a warning; a name that is not a column of the mode is skipped with a warning; if no name is a column, the run stops before any request with the list of valid names. Empty = all columns.",
            "items": {
              "type": "string"
            }
          },
          "key": {
            "title": "Stack Apps key (optional)",
            "type": "string",
            "description": "Application key from https://stackapps.com/apps/oauth/register. Without a key the API allows 300 requests a day per IP, shared with every other run leaving the same Apify IP; with a key, 10,000 a day. One request reads up to 100 questions with their answers."
          },
          "minViews": {
            "title": "Min views",
            "minimum": 0,
            "type": "integer",
            "description": "Only questions with at least this many views. Search mode only — tag mode refuses it (it could not be applied)."
          },
          "accepted": {
            "title": "Has accepted answer",
            "enum": [
              "any",
              "yes",
              "no"
            ],
            "type": "string",
            "description": "`yes` = only questions with an accepted answer, `no` = only without. Search mode only — tag mode refuses it (it could not be applied).",
            "default": "any"
          },
          "nottagged": {
            "title": "Not tagged",
            "type": "string",
            "description": "Exclude questions having any of these tags (`;`-separated). Search mode only — tag mode refuses it (it could not be applied)."
          },
          "title": {
            "title": "Title contains",
            "type": "string",
            "description": "Text that must appear in the title. Search mode only — tag mode refuses it (it could not be applied)."
          },
          "body": {
            "title": "Body contains",
            "type": "string",
            "description": "Text that must appear in the question body. Search mode only — tag mode refuses it (it could not be applied)."
          },
          "url": {
            "title": "Links to URL",
            "type": "string",
            "description": "Only questions whose body links to this URL (wildcards `*` allowed, e.g. `*.mycompany.com*`) — for docs and brand monitoring. Search mode only — tag mode refuses it (it could not be applied)."
          },
          "user": {
            "title": "Asked by user id",
            "minimum": 1,
            "type": "integer",
            "description": "Numeric user id of the asker. Search mode only — tag mode refuses it (it could not be applied)."
          },
          "closed": {
            "title": "Closed",
            "enum": [
              "any",
              "yes",
              "no"
            ],
            "type": "string",
            "description": "`yes` = only closed questions, `no` = exclude closed. Search mode only — tag mode refuses it (it could not be applied).",
            "default": "any"
          },
          "migrated": {
            "title": "Migrated",
            "enum": [
              "any",
              "yes",
              "no"
            ],
            "type": "string",
            "description": "Filter questions migrated from another site. Search mode only — tag mode refuses it (it could not be applied).",
            "default": "any"
          },
          "notice": {
            "title": "Has post notice",
            "enum": [
              "any",
              "yes",
              "no"
            ],
            "type": "string",
            "description": "Filter questions with a post notice (e.g. bounty, needs details). Search mode only — tag mode refuses it (it could not be applied).",
            "default": "any"
          },
          "wiki": {
            "title": "Community wiki",
            "enum": [
              "any",
              "yes",
              "no"
            ],
            "type": "string",
            "description": "Filter community-wiki questions. Search mode only — tag mode refuses it (it could not be applied).",
            "default": "any"
          },
          "minAnswers": {
            "title": "Min answers",
            "minimum": 0,
            "type": "integer",
            "description": "Only questions with at least this many answers. Search mode only — tag mode refuses it (it could not be applied)."
          },
          "sortMin": {
            "title": "Sort min",
            "pattern": "^(|-?\\d+|\\d{4}-\\d{2}-\\d{2}([T ]\\d{2}:\\d{2}(:\\d{2}(\\.\\d{1,9})?)?([Zz]|[+-]\\d{2}:?\\d{2})?)?)$",
            "type": "string",
            "description": "Lower bound on the sort field — needs sort `votes` (a whole number: `5` = score ≥ 5), `activity` or `creation` (a date, same formats as From date). With any other sort the run stops before any request: the bound could not be applied."
          },
          "sortMax": {
            "title": "Sort max",
            "pattern": "^(|-?\\d+|\\d{4}-\\d{2}-\\d{2}([T ]\\d{2}:\\d{2}(:\\d{2}(\\.\\d{1,9})?)?([Zz]|[+-]\\d{2}:?\\d{2})?)?)$",
            "type": "string",
            "description": "Upper bound on the sort field (same rules as Sort min; a bare date includes that whole day)."
          },
          "includeRelatedTags": {
            "title": "Include related tags",
            "type": "boolean",
            "description": "tagInfo mode: also fetch the top 30 co-occurring tags for each tag (one extra request per tag).",
            "default": false
          },
          "bodyMaxLength": {
            "title": "Question body max chars",
            "minimum": 0,
            "type": "integer",
            "description": "Truncate the plain-text question body to this many characters (0 = no limit). HTML is converted to readable text; code blocks are kept.",
            "default": 2000
          },
          "answerBodyMaxLength": {
            "title": "Answer body max chars",
            "minimum": 0,
            "type": "integer",
            "description": "Truncate each embedded answer body (0 = no limit).",
            "default": 3000
          },
          "dedupe": {
            "title": "Dedupe across queries",
            "type": "boolean",
            "description": "One row per question (or user) per run, even when several queries or names match it; the first match wins. Off = one row per matching query.",
            "default": 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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}