# Stack Overflow & Stack Exchange Scraper (`solidcode/stackoverflow-scraper`) Actor

\[💰 $2.5 / 1K] Extract questions from Stack Overflow and the 170+ site Stack Exchange network. Search by keyword or tag, sort by votes/activity, or pull specific questions by URL. Optionally collect answers and comments as linked rows.

- **URL**: https://apify.com/solidcode/stackoverflow-scraper.md
- **Developed by:** [SolidCode](https://apify.com/solidcode) (community)
- **Categories:** Developer tools, Automation, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.50 / 1,000 questions

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Stack Overflow & Stack Exchange Scraper

Pull questions — plus full answer and comment threads — from Stack Overflow and the wider Stack Exchange network in one run, with question, answer, and comment bodies in Markdown, vote scores, accepted-answer flags, view counts, tags, and author reputation. Search by keyword, filter by tag, browse trending threads, or fetch specific questions by URL. Built for developer-tooling teams, LLM/AI training-data builders, and technical researchers who need clean, structured Q&A content without hand-rolling paginated API calls and juggling anonymous request limits.

### Why This Scraper?

- **170+ Stack Exchange communities from one field** — Stack Overflow, Server Fault, Super User, Ask Ubuntu, Mathematics, Cross Validated, Unix & Linux, Data Science, and 20+ more curated sites, all selectable without touching a URL.
- **Full question + answer + comment bodies in Markdown** — not just titles and metadata. Pull the actual content behind every thread, ready for content analysis and LLM pipelines.
- **Answers with vote score, accepted-answer flag, and author reputation** — every answer row carries `score`, `isAccepted`, and the answerer's `authorReputation`, so you can rank canonical solutions instantly.
- **Comments on both questions and answers** — each comment row is tagged `postType` (`question` or `answer`), carries the `postId` of the exact question or answer it hangs off, and is linked back to its parent question by ID. Answer comments arrive when you enable both answers and comments.
- **Linked three-record output** — question, answer, and comment rows share `questionId` so you can reassemble whole threads or load each record type into its own table.
- **Tag AND-filtering** — pass `python` + `pandas` and get only questions carrying every tag, filtered on Stack Exchange's side so you never pay for off-target rows.
- **6 sort modes** — Recent activity, Newest, Most votes, Hot, Top this week, and Top this month, plus a date range for precise "new since yesterday" windows.
- **Search a keyword or fetch exact questions by URL/ID** — run a full-text search across titles and bodies, or paste specific question links like `stackoverflow.com/questions/11227809/...` to pull those threads directly.

### Use Cases

**Developer Tooling & IDE Plugins**
- Feed an in-editor "top accepted answers" panel for a language or framework tag
- Surface the highest-voted solution for an error message inside a support bot
- Keep a curated snippet library fresh from canonical Q&A threads

**LLM & AI Training Data**
- Build instruction-tuning datasets of real questions paired with accepted answers
- Extract Markdown code blocks and explanations for code-model pretraining
- Assemble evaluation sets of high-score answers with their vote signals

**Technical Research & Trend Analysis**
- Track which frameworks and libraries are gaining question volume over a date range
- Analyze answer quality by score distribution across a tag
- Compare activity between Stack Overflow and niche communities like Data Science or DevOps

**Community & Reputation Monitoring**
- Watch a tag for newly asked, still-unanswered questions to jump on
- Track top contributors by author reputation across a community
- Alert on trending "Hot" threads in your product's ecosystem

**Content & Documentation**
- Mine frequently asked questions to prioritize docs and knowledge-base articles
- Pull real user phrasing for FAQ and help-center content
- Source vetted code examples with attribution back to the original thread

### Getting Started

#### Simple Keyword Search

One topic, newest 100 questions:

```json
{
    "site": "stackoverflow",
    "searchQuery": "pandas groupby performance"
}
````

#### Tag Filter + Sort + Date Range

The highest-voted Kubernetes questions asked in 2024:

```json
{
    "site": "stackoverflow",
    "tags": ["kubernetes", "networking"],
    "sort": "votes",
    "fromDate": "2024-01-01",
    "toDate": "2024-12-31",
    "maxResults": 200
}
```

#### Specific Questions with Answers + Comments

Pull two exact threads with their full Q\&A content:

```json
{
    "questionUrlsOrIds": [
        "https://stackoverflow.com/questions/11227809/why-is-processing-a-sorted-array-faster",
        "231767"
    ],
    "includeQuestionBody": true,
    "includeAnswers": true,
    "maxAnswersPerQuestion": 5,
    "includeComments": true
}
```

#### Browse a Whole Community

The most-active questions on Unix & Linux, no keyword needed:

```json
{
    "site": "unix",
    "sort": "activity",
    "maxResults": 500
}
```

### Input Reference

#### What to Scrape

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `site` | string | `"stackoverflow"` | Which Stack Exchange community to pull from — Stack Overflow, Server Fault, Super User, Ask Ubuntu, Mathematics, Data Science, Cross Validated, and more. |
| `searchQuery` | string | `""` | Full-text search across question titles and bodies (e.g. `"kubernetes ingress timeout"`). Leave blank to browse by tag and sort order instead. |
| `tags` | array | `[]` | Only include questions carrying ALL of these tags (e.g. `python`, `pandas`). Use exact tag names as they appear on the site. Leave empty to include every tag. |
| `questionUrlsOrIds` | array | `[]` | Fetch specific questions directly by URL or numeric ID. When set, the keyword/tag/sort finders are ignored for those questions. |

#### Filters

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `sort` | string | `"activity"` | Order questions are collected in: Recent activity, Newest, Most votes, Hot, Top this week, or Top this month. Ignored when fetching specific question URLs/IDs. |
| `fromDate` | string | `""` | Only include questions created on or after this date (`YYYY-MM-DD`). Perfect for scheduled "new since yesterday" runs. |
| `toDate` | string | `""` | Only include questions created on or before this date (`YYYY-MM-DD`). |

#### Limits & Content

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `maxResults` | integer | `100` | Maximum number of questions to collect. Set to `0` for as many as the site returns. The full last page is kept even if it slightly overshoots. Ignored when fetching specific question URLs/IDs. |
| `includeQuestionBody` | boolean | `false` | Include each question's full body text (Markdown), not just its title. |
| `includeAnswers` | boolean | `false` | Also collect each question's answers — with body, score, accepted flag, and author — as separate linked rows. |
| `maxAnswersPerQuestion` | integer | `0` | Cap how many answers to collect per question when answers are enabled. `0` = all. |
| `includeComments` | boolean | `false` | Also collect comments as separate linked rows. Question comments are always included; answer comments are included when both answers and comments are enabled. |

### Output

Every row carries a `recordType` field — `question`, `answer`, or `comment` — and shares a `questionId` so you can rejoin whole threads or load each type into its own table.

#### Question (`recordType: "question"`)

```json
{
    "recordType": "question",
    "questionId": 11227809,
    "title": "Why is processing a sorted array faster than processing an unsorted array?",
    "link": "https://stackoverflow.com/questions/11227809/why-is-processing-a-sorted-array-faster-than-an-unsorted-array",
    "site": "stackoverflow",
    "tags": ["java", "c++", "performance", "cpu-architecture", "branch-prediction"],
    "author": "GManNickG",
    "authorId": 87234,
    "authorReputation": 511234,
    "score": 27543,
    "viewCount": 1850342,
    "answerCount": 25,
    "commentCount": 12,
    "isAnswered": true,
    "hasAcceptedAnswer": true,
    "acceptedAnswerId": 11227902,
    "body": "Here is a piece of C++ code that shows some very peculiar behavior...",
    "createdAt": "2012-06-27T13:51:36+00:00",
    "lastActivityAt": "2024-05-10T09:12:04+00:00",
    "scrapedAt": "2026-07-02T10:15:00+00:00"
}
```

| Field | Type | Description |
|-------|------|-------------|
| `recordType` | string | Always `"question"` |
| `questionId` | integer | Stack Exchange question ID — the link key for answers and comments |
| `title` | string | Question title |
| `link` | string | Canonical question URL |
| `site` | string | Source community (e.g. `stackoverflow`) |
| `tags` | array | Tags on the question |
| `author` | string | Asker display name |
| `authorId` | integer | Asker account ID (`null` for deleted accounts) |
| `authorReputation` | integer | Asker reputation |
| `score` | integer | Net votes |
| `viewCount` | integer | Total views |
| `answerCount` | integer | Number of answers |
| `commentCount` | integer | Number of comments on the question |
| `isAnswered` | boolean | Whether the question is marked answered |
| `hasAcceptedAnswer` | boolean | Whether an accepted answer exists |
| `acceptedAnswerId` | integer | ID of the accepted answer, if any |
| `body` | string | Question body in Markdown — only when `includeQuestionBody` is on |
| `createdAt` | string | Creation timestamp (ISO 8601) |
| `lastActivityAt` | string | Last-activity timestamp (ISO 8601) |
| `scrapedAt` | string | Collection timestamp (ISO 8601) |

#### Answer (`recordType: "answer"`)

Emitted only when `includeAnswers` is on.

```json
{
    "recordType": "answer",
    "answerId": 11227902,
    "questionId": 11227809,
    "site": "stackoverflow",
    "body": "**Branch prediction.**\n\nWith a sorted array, the condition is predictable...",
    "score": 36012,
    "isAccepted": true,
    "author": "Mysticial",
    "authorId": 922184,
    "authorReputation": 481203,
    "commentCount": 8,
    "createdAt": "2012-06-27T13:56:42+00:00",
    "lastActivityAt": "2023-08-14T18:33:20+00:00"
}
```

| Field | Type | Description |
|-------|------|-------------|
| `recordType` | string | Always `"answer"` |
| `answerId` | integer | Answer ID |
| `questionId` | integer | Parent question ID (link key) |
| `site` | string | Source community |
| `body` | string | Answer body in Markdown |
| `score` | integer | Net votes |
| `isAccepted` | boolean | Whether this is the accepted answer |
| `author` | string | Answerer display name |
| `authorId` | integer | Answerer account ID (`null` for deleted accounts) |
| `authorReputation` | integer | Answerer reputation |
| `commentCount` | integer | Number of comments on this answer |
| `createdAt` | string | Creation timestamp (ISO 8601) |
| `lastActivityAt` | string | Last-activity timestamp (ISO 8601) |

#### Comment (`recordType: "comment"`)

Emitted only when `includeComments` is on.

```json
{
    "recordType": "comment",
    "commentId": 14738201,
    "postId": 11227902,
    "postType": "answer",
    "questionId": 11227809,
    "site": "stackoverflow",
    "body": "This is the clearest explanation of branch prediction I have ever read.",
    "score": 214,
    "author": "user1234",
    "authorId": 445566,
    "createdAt": "2012-06-28T08:04:11+00:00"
}
```

| Field | Type | Description |
|-------|------|-------------|
| `recordType` | string | Always `"comment"` |
| `commentId` | integer | Comment ID |
| `postId` | integer | ID of the question or answer the comment belongs to |
| `postType` | string | `"question"` or `"answer"` — what the comment is attached to |
| `questionId` | integer | Parent question ID (link key) |
| `site` | string | Source community |
| `body` | string | Comment body in Markdown |
| `score` | integer | Net votes |
| `author` | string | Commenter display name |
| `authorId` | integer | Commenter account ID (`null` for deleted accounts) |
| `createdAt` | string | Creation timestamp (ISO 8601) |

### Tips for Best Results

- **Mine canonical answers with `votes` sort + tag AND-filtering.** Combine two or three specific tags with `sort: "votes"` to surface the definitive, highest-scored solutions for a topic — ideal for training data and snippet libraries.
- **Set a date range for trend windows.** Pair `fromDate` and `toDate` to isolate a quarter or a release window and measure how question volume for a framework shifts over time.
- **Reach beyond Stack Overflow with `site`.** The same run works on Server Fault, Super User, Data Science, Unix & Linux, and 170+ other communities — switch `site` to pull domain-specific Q\&A the main site doesn't cover.
- **Cap answers on popular threads.** Canonical questions can carry 30–50+ answers. Set `maxAnswersPerQuestion` to keep only the top few and control run size and cost. Note that `answerCount` always reports the question's true total on the site, independent of how many answer rows you actually collect.
- **Turn on bodies only when you need content.** Leave `includeQuestionBody`, `includeAnswers`, and `includeComments` off for lightweight metadata runs; enable them when you need the actual Markdown text.
- **Use `Newest` for scheduled incremental runs.** `sort: "creation"` with a rolling `fromDate` reliably catches only questions added since your last run.
- **Fetch exact threads by URL for deep dives.** Paste question links into `questionUrlsOrIds` to pull specific high-value threads with all their answers and comments in one shot.

### Pricing

**From $2.50 per 1,000 questions** — undercuts the market rate for Stack Exchange extraction, and answers and comments (when you enable them) are billed separately at much lower rates. You pay only for the results you collect.

This actor uses a per-result model split by record type. Prices below are per 1,000 rows of that type; Bronze, Silver, and Gold subscribers pay progressively less.

| Record type | No discount | Bronze | Silver | Gold |
|-------------|-------------|--------|--------|------|
| Question | $3.00 | $2.80 | $2.65 | $2.50 |
| Answer | $0.60 | $0.56 | $0.53 | $0.50 |
| Comment | $0.24 | $0.22 | $0.21 | $0.20 |

Plus a small fixed **$0.005 per-run start fee**.

Because answers and comments are far cheaper than questions, your real total depends on the mix you collect. Example totals at the Gold tier:

| What you collect | Rows | Cost at Gold |
|------------------|------|--------------|
| 100 questions only | 100 questions | $0.255 |
| 100 questions + ~3 answers each | 100 questions + 300 answers | $0.405 |
| 100 questions + 300 answers + 500 comments | 900 rows | $0.505 |

No compute or time-based charges — you pay only for the results you collect, plus the small fixed per-run start fee. Answers and comments are billed only when you turn them on. Platform fees (storage, data transfer) depend on your Apify plan.

### Integrations

Export data in JSON, CSV, Excel, XML, or RSS. Connect to 1,500+ apps via:

- **Zapier** / **Make** / **n8n** — Workflow automation
- **Google Sheets** — Direct spreadsheet export
- **Slack** / **Email** — Notifications on new results
- **Webhooks** — Trigger custom APIs on run completion
- **Apify API** — Full programmatic access

### Legal & Ethical Use

This actor is designed for legitimate research, developer tooling, dataset building, and market intelligence. Users are responsible for complying with applicable laws and Stack Exchange's terms of service, including content-attribution and licensing requirements for any questions, answers, and comments collected. Do not use extracted data for spam, harassment, or any illegal purpose.

# Actor input Schema

## `site` (type: `string`):

Which Stack Exchange site to pull from. Stack Overflow is the default. Pick another community to scrape questions from it instead.

## `searchQuery` (type: `string`):

Full-text search across question titles and bodies (e.g. 'kubernetes ingress timeout', 'pandas groupby'). Leave blank to browse by tag and sort order instead.

## `tags` (type: `array`):

Only include questions carrying ALL of these tags (e.g. 'python', 'pandas'). Use the exact tag names as they appear on the site. Leave empty to include every tag.

## `questionUrlsOrIds` (type: `array`):

Fetch specific questions directly. Paste question URLs (e.g. 'https://stackoverflow.com/questions/11227809/why-is-processing-a-sorted-array-faster') or bare numeric question IDs. When you use this, the keyword/tag/sort finders above are ignored for those questions.

## `sort` (type: `string`):

Order in which questions are collected. 'Hot', 'Top this week' and 'Top this month' surface trending questions; 'Newest' is best for scheduled runs that pick up fresh questions.

## `fromDate` (type: `string`):

Only include questions created on or after this date (YYYY-MM-DD). Leave blank for no lower bound. Perfect for scheduled 'new since yesterday' runs.

## `toDate` (type: `string`):

Only include questions created on or before this date (YYYY-MM-DD). Leave blank for no upper bound.

## `maxResults` (type: `integer`):

Hard cap on how many questions to collect. Default 100 — increase for bigger runs, or set to 0 for as many as the site returns (an internal upper bound still prevents runaway pagination). The actor keeps the full last page even if it slightly overshoots this number. Ignored when you fetch specific question URLs/IDs — those are always all collected.

## `includeQuestionBody` (type: `boolean`):

Include each question's full body text (Markdown), not just its title. Useful for content analysis and LLM pipelines.

## `includeAnswers` (type: `boolean`):

For each question, also collect its answers — with body text, score, accepted flag, and author — as separate rows linked by question ID. Popular questions can have dozens of answers, so this adds work and cost per question.

## `maxAnswersPerQuestion` (type: `integer`):

Cap how many answers to collect per question when answers are enabled. Set to 0 for all answers. Only used when 'Include answers' is on.

## `includeComments` (type: `boolean`):

Also collect comments as separate rows linked by question ID. Question comments are always included when this is on. Answer comments are included when both answers and comments are enabled. Busy threads can carry hundreds of comments, so this adds work and cost per question.

## Actor input object example

```json
{
  "site": "stackoverflow",
  "tags": [],
  "questionUrlsOrIds": [],
  "sort": "activity",
  "maxResults": 100,
  "includeQuestionBody": false,
  "includeAnswers": false,
  "maxAnswersPerQuestion": 0,
  "includeComments": false
}
```

# Actor output Schema

## `questions` (type: `string`):

Table of questions with the most useful fields — title, tags, score, views, answer count, and link.

## `answers` (type: `string`):

Answer rows (only when answers are enabled) with body, score, accepted flag, and author, linked to their question.

## `comments` (type: `string`):

Comment rows (only when comments are enabled) with body and author, linked to their question or answer.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "site": "stackoverflow",
    "searchQuery": "",
    "tags": [],
    "questionUrlsOrIds": [],
    "sort": "activity",
    "fromDate": "",
    "toDate": "",
    "maxResults": 100,
    "includeQuestionBody": false,
    "includeAnswers": false,
    "maxAnswersPerQuestion": 0,
    "includeComments": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("solidcode/stackoverflow-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "site": "stackoverflow",
    "searchQuery": "",
    "tags": [],
    "questionUrlsOrIds": [],
    "sort": "activity",
    "fromDate": "",
    "toDate": "",
    "maxResults": 100,
    "includeQuestionBody": False,
    "includeAnswers": False,
    "maxAnswersPerQuestion": 0,
    "includeComments": False,
}

# Run the Actor and wait for it to finish
run = client.actor("solidcode/stackoverflow-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "site": "stackoverflow",
  "searchQuery": "",
  "tags": [],
  "questionUrlsOrIds": [],
  "sort": "activity",
  "fromDate": "",
  "toDate": "",
  "maxResults": 100,
  "includeQuestionBody": false,
  "includeAnswers": false,
  "maxAnswersPerQuestion": 0,
  "includeComments": false
}' |
apify call solidcode/stackoverflow-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=solidcode/stackoverflow-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Stack Overflow & Stack Exchange Scraper",
        "description": "[💰 $2.5 / 1K] Extract questions from Stack Overflow and the 170+ site Stack Exchange network. Search by keyword or tag, sort by votes/activity, or pull specific questions by URL. Optionally collect answers and comments as linked rows.",
        "version": "1.0",
        "x-build-id": "TjDwgdFtNbhVKv7db"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/solidcode~stackoverflow-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-solidcode-stackoverflow-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/solidcode~stackoverflow-scraper/runs": {
            "post": {
                "operationId": "runs-sync-solidcode-stackoverflow-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/solidcode~stackoverflow-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-solidcode-stackoverflow-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": {
                    "site": {
                        "title": "Site",
                        "enum": [
                            "stackoverflow",
                            "serverfault",
                            "superuser",
                            "askubuntu",
                            "math",
                            "datascience",
                            "stats",
                            "dba",
                            "softwareengineering",
                            "security",
                            "unix",
                            "apple",
                            "android",
                            "webmasters",
                            "gamedev",
                            "ux",
                            "tex",
                            "wordpress",
                            "gis",
                            "electronics",
                            "ai",
                            "codereview",
                            "sharepoint",
                            "salesforce",
                            "ethereum",
                            "bitcoin",
                            "magento",
                            "raspberrypi",
                            "arduino",
                            "physics"
                        ],
                        "type": "string",
                        "description": "Which Stack Exchange site to pull from. Stack Overflow is the default. Pick another community to scrape questions from it instead.",
                        "default": "stackoverflow"
                    },
                    "searchQuery": {
                        "title": "Search Keyword",
                        "type": "string",
                        "description": "Full-text search across question titles and bodies (e.g. 'kubernetes ingress timeout', 'pandas groupby'). Leave blank to browse by tag and sort order instead."
                    },
                    "tags": {
                        "title": "Tags",
                        "uniqueItems": true,
                        "type": "array",
                        "description": "Only include questions carrying ALL of these tags (e.g. 'python', 'pandas'). Use the exact tag names as they appear on the site. Leave empty to include every tag.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "questionUrlsOrIds": {
                        "title": "Question URLs or IDs",
                        "uniqueItems": true,
                        "type": "array",
                        "description": "Fetch specific questions directly. Paste question URLs (e.g. 'https://stackoverflow.com/questions/11227809/why-is-processing-a-sorted-array-faster') or bare numeric question IDs. When you use this, the keyword/tag/sort finders above are ignored for those questions.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "sort": {
                        "title": "Sort By",
                        "enum": [
                            "activity",
                            "creation",
                            "votes",
                            "hot",
                            "week",
                            "month"
                        ],
                        "type": "string",
                        "description": "Order in which questions are collected. 'Hot', 'Top this week' and 'Top this month' surface trending questions; 'Newest' is best for scheduled runs that pick up fresh questions.",
                        "default": "activity"
                    },
                    "fromDate": {
                        "title": "From Date",
                        "type": "string",
                        "description": "Only include questions created on or after this date (YYYY-MM-DD). Leave blank for no lower bound. Perfect for scheduled 'new since yesterday' runs."
                    },
                    "toDate": {
                        "title": "To Date",
                        "type": "string",
                        "description": "Only include questions created on or before this date (YYYY-MM-DD). Leave blank for no upper bound."
                    },
                    "maxResults": {
                        "title": "Maximum Questions",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Hard cap on how many questions to collect. Default 100 — increase for bigger runs, or set to 0 for as many as the site returns (an internal upper bound still prevents runaway pagination). The actor keeps the full last page even if it slightly overshoots this number. Ignored when you fetch specific question URLs/IDs — those are always all collected.",
                        "default": 100
                    },
                    "includeQuestionBody": {
                        "title": "Include question body text",
                        "type": "boolean",
                        "description": "Include each question's full body text (Markdown), not just its title. Useful for content analysis and LLM pipelines.",
                        "default": false
                    },
                    "includeAnswers": {
                        "title": "Include answers",
                        "type": "boolean",
                        "description": "For each question, also collect its answers — with body text, score, accepted flag, and author — as separate rows linked by question ID. Popular questions can have dozens of answers, so this adds work and cost per question.",
                        "default": false
                    },
                    "maxAnswersPerQuestion": {
                        "title": "Max Answers per Question",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Cap how many answers to collect per question when answers are enabled. Set to 0 for all answers. Only used when 'Include answers' is on.",
                        "default": 0
                    },
                    "includeComments": {
                        "title": "Include comments",
                        "type": "boolean",
                        "description": "Also collect comments as separate rows linked by question ID. Question comments are always included when this is on. Answer comments are included when both answers and comments are enabled. Busy threads can carry hundreds of comments, so this adds work and cost per question.",
                        "default": false
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
