{
  "openapi": "3.0.1",
  "info": {
    "title": "Stack Overflow & Stack Exchange Questions",
    "description": "Stack Overflow and Stack Exchange questions scraper. Filter by tags or search text; export question fields and optional linked answer rows as JSON with source links and attribution.",
    "version": "1.0",
    "x-build-id": "nqVwLVAggp5cM2QYo"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/grit-77~stackexchange-questions/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-grit-77-stackexchange-questions",
        "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/grit-77~stackexchange-questions/runs": {
      "post": {
        "operationId": "runs-sync-grit-77-stackexchange-questions",
        "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/grit-77~stackexchange-questions/run-sync": {
      "post": {
        "operationId": "run-sync-grit-77-stackexchange-questions",
        "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": {
          "site": {
            "title": "Stack Exchange site",
            "type": "string",
            "description": "API site code, e.g. stackoverflow, math, superuser, serverfault or meta.stackoverflow. One site per run.",
            "default": "stackoverflow"
          },
          "search": {
            "title": "Search keywords",
            "type": "string",
            "description": "Optional free-text official API search. All tags below must match. Leave blank to use the question listing."
          },
          "tags": {
            "title": "Question tags",
            "maxItems": 5,
            "type": "array",
            "description": "Up to five tags, matched together (AND), e.g. python and pandas. Empty means no tag filter.",
            "items": {
              "type": "string"
            }
          },
          "fromDate": {
            "title": "Created on or after",
            "type": "string",
            "description": "Optional YYYY-MM-DD (UTC) or ISO timestamp with timezone. Filters question creation, even when sorting by activity."
          },
          "toDate": {
            "title": "Created on or before",
            "type": "string",
            "description": "Optional YYYY-MM-DD (inclusive through 23:59:59 UTC) or ISO timestamp with timezone."
          },
          "minScore": {
            "title": "Minimum question score",
            "minimum": -2147483648,
            "maximum": 2147483647,
            "type": "integer",
            "description": "Optional inclusive lower score bound. With votes sort sent to the API; other sorts filter results locally."
          },
          "maxScore": {
            "title": "Maximum question score",
            "minimum": -2147483648,
            "maximum": 2147483647,
            "type": "integer",
            "description": "Optional inclusive upper score bound. Does not filter answer scores."
          },
          "sort": {
            "title": "Question sort",
            "enum": [
              "activity",
              "creation",
              "votes",
              "relevance"
            ],
            "type": "string",
            "description": "Activity, creation, votes, or relevance (requires search). Score bounds apply with any sort.",
            "default": "activity"
          },
          "order": {
            "title": "Sort direction",
            "enum": [
              "asc",
              "desc"
            ],
            "type": "string",
            "description": "Ascending or descending question order. Concurrent answer workers can interleave dataset rows.",
            "default": "desc"
          },
          "includeAnswers": {
            "title": "Include answers",
            "type": "boolean",
            "description": "Export separate answer rows, in descending score order per question. Questions are always saved before their answers.",
            "default": false
          },
          "maxAnswersPerQuestion": {
            "title": "Maximum answers per question",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Per-question answer cap. Subject to the total maxItems cap; answers may be truncated.",
            "default": 10
          },
          "maxItems": {
            "title": "Maximum output rows",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Hard total dataset cap shared by questions, answers and uncharged error rows. Answer rows use the same budget.",
            "default": 100
          },
          "concurrency": {
            "title": "Concurrent question workers",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Concurrent answer workers. API requests share a paced lane and honor server backoff and quota.",
            "default": 2
          },
          "maxPages": {
            "title": "Maximum pages per endpoint",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Caps question scan pages and answer pages per question. Without an API key the API may reject page >25. Each page has up to 100 posts.",
            "default": 25
          },
          "apiKey": {
            "title": "Stack Exchange API key (optional)",
            "type": "string",
            "description": "Optional key belonging to your Stack Exchange application. No access token or login needed. Quotas still apply; do not share your input."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}