{
  "openapi": "3.0.1",
  "info": {
    "title": "Stack Overflow & Stack Exchange Scraper",
    "description": "Search Stack Overflow and any Stack Exchange site by keyword, tag, score and date, browse a tag, or paste question URLs from any site. Each question has full text, tags, views and the top answers with the accepted one flagged. Many searches per run, each with its own cap. $2 per 1,000 questions.",
    "version": "0.2",
    "x-build-id": "kEP5Fk0aIFCGWEzvv"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/tidyharvest~stack-overflow-questions-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-tidyharvest-stack-overflow-questions-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/tidyharvest~stack-overflow-questions-scraper/runs": {
      "post": {
        "operationId": "runs-sync-tidyharvest-stack-overflow-questions-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/tidyharvest~stack-overflow-questions-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-tidyharvest-stack-overflow-questions-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": {
          "queries": {
            "title": "Search texts or question URLs/IDs",
            "type": "array",
            "description": "One per line: free-text search (title and body), a question URL, an answer URL or a question ID. URLs from any Stack Exchange site work and use their own site, so you can mix them with searches. Leave empty to browse the tags below.",
            "items": {
              "type": "string"
            }
          },
          "tags": {
            "title": "Tags (all must match)",
            "type": "array",
            "description": "Only questions that have ALL these tags, e.g. python, pandas. Applies to every search; with no search text, the run browses these tags.",
            "items": {
              "type": "string"
            }
          },
          "site": {
            "title": "Stack Exchange site",
            "type": "string",
            "description": "Site for searches and tag browsing: stackoverflow, superuser, serverfault, askubuntu, math, unix, cooking, ... or the site's address (e.g. math.stackexchange.com). Question URLs always use their own site.",
            "default": "stackoverflow"
          },
          "sort": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "votes",
              "activity",
              "creation"
            ],
            "type": "string",
            "description": "Relevance (best with search text), votes, recent activity or creation date.",
            "default": "relevance"
          },
          "order": {
            "title": "Order",
            "enum": [
              "desc",
              "asc"
            ],
            "type": "string",
            "description": "Sort direction.",
            "default": "desc"
          },
          "maxPerQuery": {
            "title": "Max questions per search",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Most questions to return for each search line (or for the tag browse). A question URL or ID returns its one question.",
            "default": 100
          },
          "maxItems": {
            "title": "Max questions in total",
            "minimum": 0,
            "type": "integer",
            "description": "Cap on questions for the whole run (and your cost), shared fairly across all lines. Empty or 0 = no total cap."
          },
          "minScore": {
            "title": "Minimum score",
            "type": "integer",
            "description": "Only searched questions with at least this many votes."
          },
          "onlyWithAcceptedAnswer": {
            "title": "Only questions with an accepted answer",
            "type": "boolean",
            "description": "Only searched questions that have an accepted answer.",
            "default": false
          },
          "fromDate": {
            "title": "Created from (YYYY-MM-DD)",
            "type": "string",
            "description": "Only questions created on or after this day (UTC), e.g. 2024-01-01."
          },
          "toDate": {
            "title": "Created to (YYYY-MM-DD)",
            "type": "string",
            "description": "Only questions created on or before this day (UTC), e.g. 2024-12-31."
          },
          "includeAnswers": {
            "title": "Include answers",
            "type": "boolean",
            "description": "Adds the top answers (accepted answer first) inside each question. Included in the question price.",
            "default": true
          },
          "maxAnswers": {
            "title": "Max answers per question",
            "minimum": 0,
            "maximum": 50,
            "type": "integer",
            "description": "Answers kept per question: the accepted one first, then the highest scored. 0 = questions only.",
            "default": 3
          },
          "keywords": {
            "title": "Keywords (match any)",
            "type": "array",
            "description": "Keep a searched question only if its title, text or tags contain one of these. Empty = all.",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}