{
  "openapi": "3.0.1",
  "info": {
    "title": "Stack Overflow questions + answers search (Stack Exchange API)",
    "description": "Search Stack Overflow (or any Stack Exchange site) by query, tags, sort and date range through the public Stack Exchange API and get one row per question - title, tags, score, views, answers, owner, link, body text - plus its top answers as rows. CC BY-SA content; each row carries the license.",
    "version": "0.1",
    "x-build-id": "yGaPCkbF1p79vEeVC"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/retrainmap~stackoverflow-questions/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-retrainmap-stackoverflow-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/retrainmap~stackoverflow-questions/runs": {
      "post": {
        "operationId": "runs-sync-retrainmap-stackoverflow-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/retrainmap~stackoverflow-questions/run-sync": {
      "post": {
        "operationId": "run-sync-retrainmap-stackoverflow-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": {
          "query": {
            "title": "Search query",
            "type": "string",
            "description": "Free-text query (the API's q parameter; matched against title and body). Optional when tags are given.",
            "default": "asyncio"
          },
          "tags": {
            "title": "Tags (all must match)",
            "uniqueItems": true,
            "type": "array",
            "description": "Up to 5 tag names, e.g. python, pandas, c#. A question must carry every listed tag.",
            "default": [
              "python"
            ],
            "items": {
              "type": "string"
            }
          },
          "sort": {
            "title": "Sort",
            "enum": [
              "activity",
              "votes",
              "creation"
            ],
            "type": "string",
            "description": "activity = most recently active first (default), votes = highest score first, creation = newest first.",
            "default": "activity"
          },
          "from_date": {
            "title": "Created on or after (YYYY-MM-DD)",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Optional lower bound on the question's creation date (UTC)."
          },
          "to_date": {
            "title": "Created on or before (YYYY-MM-DD)",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Optional inclusive upper bound on the question's creation date (UTC)."
          },
          "include_answers": {
            "title": "Include answers",
            "type": "boolean",
            "description": "Also write the top answers of each question as rows (row_type = answer, sorted by votes).",
            "default": true
          },
          "answers_per_question": {
            "title": "Answers per question (max)",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Cap on answer rows per question when include_answers is on (1-20).",
            "default": 3
          },
          "max_records": {
            "title": "Maximum questions",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Stop after this many question rows. Answer rows come on top (at most answers_per_question each). Each 100 questions cost one API request plus a few for answers; the keyless quota is 300 requests per day.",
            "default": 100
          },
          "site": {
            "title": "Stack Exchange site",
            "type": "string",
            "description": "API site parameter: stackoverflow (default), superuser, serverfault, askubuntu, math, or any other from https://api.stackexchange.com/docs/sites.",
            "default": "stackoverflow"
          },
          "stackexchange_key": {
            "title": "Stack Exchange API key (optional)",
            "type": "string",
            "description": "Your own app key from https://stackapps.com/apps/oauth/register raises the daily quota from 300 to 10,000 requests. Stored as a secret; sent only to api.stackexchange.com."
          },
          "request_interval_ms": {
            "title": "Minimum interval between requests (ms)",
            "minimum": 250,
            "maximum": 10000,
            "type": "integer",
            "description": "Politeness delay towards api.stackexchange.com (floor 250 ms). The API's own backoff field is honoured on top.",
            "default": 1000
          },
          "contact_email": {
            "title": "Contact e-mail (From: header)",
            "type": "string",
            "description": "Sent in the standard From: request header so the data owner can reach the operator (RFC 9110 s10.1.2).",
            "default": "info@steelyardclinical.com"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}