# Stack Overflow & Stack Exchange Q\&A Scraper, No Login (`cliqtomedia/stack-exchange-scraper`) Actor

Scrape Stack Overflow and 170+ Stack Exchange sites by tag, search or question URL. No login. Official API. Questions with answers, votes, tags, authors and a CC BY-SA credit line.

- **URL**: https://apify.com/cliqtomedia/stack-exchange-scraper.md
- **Developed by:** [Cliqto Media](https://apify.com/cliqtomedia) (community)
- **Categories:** Developer tools
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.89 / 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/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

Stack Overflow & Stack Exchange Q\&A Scraper exports questions with their answers from Stack Overflow and the other Stack Exchange sites (Super User, Server Fault, Ask Ubuntu, Mathematics and 170+ more). You pick a site and a tag, a search query or a list of question links, and get one table row per question with the title, body, tags, votes, author and the answers inside the same row.

Use it to follow questions about your product or library, to build a Q\&A dataset for search or an LLM, or to save a fixed list of threads. The smallest run is one tag, for example `apify`, and 10 questions. No login or API key is needed: the Actor reads the official Stack Exchange API, and every row has a ready CC BY-SA attribution line.

![Stack Overflow & Stack Exchange Q\&A Scraper: choose a site and tags, get questions with their answers in the same row, export to JSON, CSV or Excel with a CC BY-SA credit line. No login or API key, any Stack Exchange site.](https://api.apify.com/v2/key-value-stores/7DRIH4omSxOfvwORU/records/readme-hero-20261028.png)

### Table of contents

- [What it does](#what-it-does)
- [How it works](#how-it-works)
- [Quick start](#quick-start)
- [Use cases](#use-cases)
- [Input](#input)
- [Output](#output)
- [Pricing](#pricing)
- [Limits](#limits)
- [API, export and AI agents](#api-export-and-ai-agents)
- [Troubleshooting](#troubleshooting)
- [FAQ](#faq)
- [Related Actors](#related-actors)
- [Support](#support)

### What it does

The Actor reads questions from one Stack Exchange site and saves each question as one dataset row with its answers inside. It has three modes:

| `mode` | What you give | What it returns |
| --- | --- | --- |
| `tag` | `site` and up to 5 `tags` | Questions that carry all the tags, in your `sort` order |
| `search` | `site`, a `query` and optional `tags` | Questions that match the words in the title or body |
| `question` | `questions`: IDs or question URLs | Exactly these questions; a URL sets its own site |

With `includeAnswers` on (the default), the answers are inside the row: the accepted answer first, then by score. You choose the body format: Markdown as written, HTML as shown on the site, or plain text. You can also limit the creation date with `fromDate` and `toDate`.

#### Good fit

- Watch new questions about your product tag on Stack Overflow.
- Build a question-and-answer dataset in Markdown for search, RAG or an LLM.
- Save a list of known threads with all answers and votes.
- Find the most-voted questions on a topic on any Stack Exchange site.

> **👉 [Try it now: open the input form](https://console.apify.com/actors/6mmhDQO8UfuOlkjyy/input)**

### How it works

1. The Actor asks the official Stack Exchange API for the questions of your tag list, search or question links on the site you chose.
2. For each page of questions it reads the answers, the content licence and the authors, sorts the answers (accepted first, then by votes) and converts the bodies to the format you picked.
3. It saves one row per question in the dataset, free `not_found` and `error` rows for links that do not work, and a `RUN_SUMMARY` record with counts and the remaining daily API quota.

> **👉 [Try it now: open the input form](https://console.apify.com/actors/6mmhDQO8UfuOlkjyy/input)**

### Quick start

[![Input form with the prefill: box 1 is the mode (questions by tag), box 2 the site stackoverflow and the tag apify, box 3 the number of questions, 10](https://api.apify.com/v2/key-value-stores/7DRIH4omSxOfvwORU/records/quick-start-form-20261028.png)](https://console.apify.com/actors/6mmhDQO8UfuOlkjyy/input)

1. Open the **Input** tab. **Mode** stays at the default **Questions by tag** (box 1).
2. Keep **Site** at the prefilled `stackoverflow` and **Tags** at the prefilled `apify`, or type your own site and tag (box 2).
3. Keep **Max questions** at the prefilled `10` or set your own number (box 3; the runtime default is `50`).
4. Click **Start** at the bottom of the page.
5. Open the **Questions** view in the **Output** tab and check `title`, `score`, `answerCount` and `link` (box 5).

   [![Output table: box 5 is the Questions view with title, score, answer count and link](https://api.apify.com/v2/key-value-stores/7DRIH4omSxOfvwORU/records/output-table-20261028.png)](https://api.apify.com/v2/key-value-stores/7DRIH4omSxOfvwORU/records/output-table-20261028.png)

Expected result: the 10 newest questions with the `apify` tag and their answers, in a few seconds.

> **👉 [Try it now: open the input form](https://console.apify.com/actors/6mmhDQO8UfuOlkjyy/input)**

### Use cases

| Buyer job | Input | Output | Key fields | Next step |
| --- | --- | --- | --- | --- |
| Follow questions about your product | `tags: ["your-tag"]`, `sort: newest`, scheduled | question rows | `title`, `link`, `createdAt`, `isAnswered` | Send unanswered ones to your support channel |
| Build an LLM or RAG dataset | `tags`, `sort: votes`, `bodyFormat: markdown` | rows with answers | `body`, `answers[].body`, `answers[].isAccepted`, `attribution` | Load into a vector store, keep the credit line |
| Research a topic | `mode: search`, `query`, `fromDate` | question rows | `score`, `viewCount`, `tags` | Count questions per month or per tag |
| Save known threads | `mode: question`, `questions` | one row per thread | `answers`, `acceptedAnswerId`, `lastActivityAt` | Archive or compare over time |

> **👉 [Try it now: open the input form](https://console.apify.com/actors/6mmhDQO8UfuOlkjyy/input)**

### Input

You need a site and at least one of: `tags` (tag mode), `query` or `tags` (search mode), `questions` (question mode). A wrong input stops the run with `INVALID_INPUT` before any request.

| Field | Plain name | Type | Default | Allowed values | What it changes | Recommendation |
| --- | --- | --- | --- | --- | --- | --- |
| `mode` | Mode | enum | `tag` | `tag`, `search`, `question` | Which list the Actor reads | `tag` to follow a topic, `question` for known threads |
| `site` | Site | string | `stackoverflow` (prefill too) | API site name or domain: `superuser`, `serverfault`, `askubuntu`, `math`, `math.stackexchange.com` … | The Stack Exchange site | Use the short name from the site URL |
| `tags` | Tags | array of strings | none (prefill `["apify"]`) | up to 5 tags | Questions must carry all the tags. Empty in tag mode = all questions of the site | One or two tags give the clearest list |
| `query` | Search query | string | none | up to 500 characters | Words to find in titles and bodies (search mode only) | Add `sort: relevance` |
| `questions` | Question IDs or URLs | array of strings | none | up to 1,000 IDs like `11227809` or question URLs | Exact questions to read (question mode only). Duplicates are read once | Paste links from your browser |
| `sort` | Sort | enum | `newest` | `newest`, `active`, `votes`, `hot` (tag mode), `relevance` (search mode) | Order of the list | `votes` for the best-known questions |
| `maxQuestions` | Max questions | integer | `50` (prefill `10`) | 1–1,000 | The run stops after this many question rows | Start small, then raise |
| `includeAnswers` | Include answers | boolean | `true` | `true`, `false` | Answers inside each row | Turn off for a list of titles only |
| `maxAnswersPerQuestion` | Max answers per question | integer | `30` | 1–500 | Keep only the best answers | `answersComplete` shows if all answers fit |
| `bodyFormat` | Body format | enum | `markdown` | `markdown`, `html`, `text` | Format of question and answer bodies | `markdown` for LLMs, `text` for spreadsheets |
| `fromDate`, `toDate` | Created from / until | date | none | `2025-01-01` (UTC; `toDate` includes the whole day) | Only questions created in this window | Use for a monthly report |
| `apiKey` | Stack Exchange API key | secret string | none | free key from stackapps.com | Higher daily quota | Not needed for normal runs |

#### Interacting settings

| When | Field A | Field B | Effect |
| --- | --- | --- | --- |
| Search | `query` | `tags` | Both must match: the words and all the tags |
| Order | `sort: hot` | `mode: tag` | `hot` works only in tag mode; `relevance` only in search mode |
| Question links | `questions` with a URL | `site` | The URL's own site wins; bare IDs use `site` |
| Answers | `includeAnswers: false` | `maxAnswersPerQuestion` | No answers, so `maxAnswersPerQuestion` is ignored and `answers` is `null` |
| Dates | `fromDate`, `toDate` | `mode: question` | Dates work in tag and search modes only |

#### Input examples

##### Newest questions about a product tag (the prefill)

```json
{
  "site": "stackoverflow",
  "tags": ["apify"],
  "maxQuestions": 10
}
```

Expected: 10 question rows, newest first, each with its answers. The output example below comes from this input.

##### Best-voted answers on Server Fault for a search

```json
{
  "mode": "search",
  "site": "serverfault",
  "query": "nginx reverse proxy",
  "sort": "votes",
  "maxQuestions": 100,
  "bodyFormat": "text"
}
```

Expected: up to 100 question rows, most votes first, with plain-text bodies and answers.

##### A fixed list of threads

```json
{
  "mode": "question",
  "questions": [
    "11227809",
    "https://serverfault.com/questions/997924"
  ],
  "maxAnswersPerQuestion": 5
}
```

Expected: one row per question that exists, each with up to 5 answers. A missing question gives a free `not_found` row.

#### Coming from another Stack Exchange Actor

Input names here are different. This table helps to move an existing input:

| Common input in other Actors | This Actor |
| --- | --- |
| `tagged: "a;b"` | `tags: ["a", "b"]` |
| `searchQuery` | `mode: "search"`, `query` |
| `questionIds` | `mode: "question"`, `questions` |
| `fetchAnswers` | `includeAnswers` (on by default, no extra price) |
| `maxResults` | `maxQuestions` |
| `sort: activity` / `creation` | `sort: active` / `newest` |

Output fields are camelCase (`questionId`, `answerCount`) with ISO dates, not raw API snake_case. The asker is one `author` object.

> **👉 [Try it now: open the input form](https://console.apify.com/actors/6mmhDQO8UfuOlkjyy/input)**

### Output

#### Output example

A real row from the prefill run (`body` and the answer `body` are shortened here):

```json
{
  "site": "stackoverflow",
  "questionId": 77823456,
  "title": "Apify: weird costs for using key-value stores",
  "link": "https://stackoverflow.com/questions/77823456/apify-weird-costs-for-using-key-value-stores",
  "tags": ["node.js", "apify"],
  "score": 0,
  "upVotes": 1,
  "downVotes": 1,
  "viewCount": 213,
  "answerCount": 1,
  "isAnswered": true,
  "acceptedAnswerId": null,
  "commentCount": null,
  "bountyAmount": null,
  "isClosed": false,
  "closedReason": null,
  "closedAt": null,
  "createdAt": "2024-01-16T04:20:59.000Z",
  "lastActivityAt": "2024-01-16T13:03:25.000Z",
  "lastEditedAt": null,
  "author": {
    "userId": 2486638,
    "displayName": "Alvein",
    "reputation": 217,
    "userType": "registered",
    "profileUrl": "https://stackoverflow.com/users/2486638/alvein"
  },
  "bodyFormat": "markdown",
  "body": "I'm working with Node.js but I think my question is language-agnostic.\n\nIn my Apify actor, First I do a few long scrapes…",
  "answers": [
    {
      "answerId": 77825927,
      "link": "https://stackoverflow.com/questions/77823456/apify-weird-costs-for-using-key-value-stores/77825927#77825927",
      "score": 1,
      "upVotes": 1,
      "downVotes": 0,
      "isAccepted": false,
      "commentCount": 1,
      "createdAt": "2024-01-16T13:03:25.000Z",
      "lastActivityAt": "2024-01-16T13:03:25.000Z",
      "lastEditedAt": null,
      "author": {
        "userId": 9898465,
        "displayName": "Lukáš Křivka",
        "reputation": 983,
        "userType": "registered",
        "profileUrl": "https://stackoverflow.com/users/9898465/luk%c3%a1%c5%a1-k%c5%99ivka"
      },
      "body": "Apify doesn't charge for how big the writes are. Apify charges for number of writes and then for time based storage…",
      "license": "CC BY-SA 4.0",
      "licenseUrl": "https://creativecommons.org/licenses/by-sa/4.0/"
    }
  ],
  "answersIncluded": 1,
  "answersComplete": true,
  "license": "CC BY-SA 4.0",
  "licenseUrl": "https://creativecommons.org/licenses/by-sa/4.0/",
  "attribution": "\"Apify: weird costs for using key-value stores\" by Alvein (https://stackoverflow.com/users/2486638/alvein), https://stackoverflow.com/questions/77823456/apify-weird-costs-for-using-key-value-stores, licensed under CC BY-SA 4.0",
  "rank": 8,
  "input": null,
  "inputs": null,
  "status": "complete",
  "statusReason": null,
  "errorCode": null,
  "sourceUrl": "https://api.stackexchange.com/2.3/questions?site=stackoverflow&order=desc&sort=creation&pagesize=10&filter=…&tagged=apify&page=1",
  "fetchedAt": "2026-10-17T12:18:30.349Z"
}
```

`null` means the API gave no value (no accepted answer, no bounty, never edited). `0` is a real zero. `commentCount` can be `null` in tag and search lists and filled in question mode: the Actor copies what the API endpoint returns.

#### Output fields

##### Question rows (`status: complete` or `partial`)

| Field | Meaning | Type | Can be null? | Example |
| --- | --- | --- | --- | --- |
| `site` | Site the row came from | string | no | `"stackoverflow"` |
| `questionId` | Question ID, stable key | integer | no | `77823456` |
| `title`, `link` | Title and public question link | string | no | |
| `tags` | Question tags | array | no | `["node.js", "apify"]` |
| `score`, `upVotes`, `downVotes` | Votes | integer | yes | `0`, `1`, `1` |
| `viewCount`, `answerCount` | Views and number of answers | integer | yes | `213`, `1` |
| `isAnswered`, `acceptedAnswerId` | Has an upvoted or accepted answer; ID of the accepted one | boolean, integer | yes | `true`, `null` |
| `commentCount`, `bountyAmount` | Comments on the question; open bounty | integer | yes | `null` |
| `isClosed`, `closedReason`, `closedAt` | Closed questions | boolean, string | yes | `false` |
| `createdAt`, `lastActivityAt`, `lastEditedAt` | Dates (ISO, UTC) | string | yes | `"2024-01-16T04:20:59.000Z"` |
| `author` | `userId`, `displayName`, `reputation`, `userType`, `profileUrl` | object | yes (deleted users) | |
| `bodyFormat`, `body` | Body format and question body | string | `body` yes | `"markdown"` |
| `answers` | Answers: `answerId`, `link`, `score`, `isAccepted`, `author`, `body`, `license`, dates | array | `null` when `includeAnswers` is off | |
| `answersIncluded`, `answersComplete` | How many answers are in the row; `false` if `maxAnswersPerQuestion` cut some | integer, boolean | yes | `1`, `true` |
| `license`, `licenseUrl` | Content licence of the question | string | yes | `"CC BY-SA 4.0"` |
| `attribution` | Ready credit line: title, author, link, licence | string | yes | |
| `rank` | Position in the tag or search list | integer | yes (question mode) | `8` |
| `status`, `statusReason`, `errorCode` | Row status and why | string | `statusReason`, `errorCode` yes | `"complete"` |
| `input`, `inputs` | What you entered for this row (question mode) | string, array | yes | `"11227809"` |
| `sourceUrl`, `fetchedAt` | API request and fetch time | string | no | |

`partial` means the row has no licence from the API, or the API returned fewer answers than expected. It is still a useful row and is charged.

##### Issue rows (`status: not_found` or `error`)

Question mode only. These rows are free.

- `not_found`: the IDs do not exist, are deleted or are not question IDs. Missing IDs from one batch share one row, with the list in `inputs`.
- `error`: a bad item (for example an answer link or a non-Stack Exchange URL), or a source error for that batch. Items with the same reason share one row, with the list in `inputs`.

When a row is about one item, `input` and `questionId` are filled; when it is about several, they are `null` and `inputs` lists them.

##### Run report

The key-value store record `RUN_SUMMARY` has the run status, reason, counts (rows, questions, answers, complete, partial, not found, errors, charged questions), request counts and the remaining daily API quota. It never contains your API key.

| Run status | Meaning | Run result |
| --- | --- | --- |
| `COMPLETE` | All requested questions were read | SUCCEEDED |
| `CAPPED` | Stopped early with saved rows: your maximum charge (`CHARGE_LIMIT`), the daily API quota (`QUOTA_LIMIT`), the time limit (`DEADLINE`) or the API page limit (`PAGE_LIMIT`) | SUCCEEDED, saved rows are kept |
| `NO_RESULTS` | No questions match the filters | SUCCEEDED, empty dataset |
| `NOT_FOUND` | No question from the list exists | SUCCEEDED, free `not_found` rows |
| `PARTIAL` | Some rows are `partial` (`PARTIAL_ROWS`), or the source failed after some rows (`SOURCE_ERROR`) | `SOURCE_ERROR` marks the run FAILED; saved rows are kept |
| `ERROR` | The source failed or the run stopped before any question was saved | FAILED |
| `INVALID_INPUT` | The input cannot work, for example an unknown site, or no item in `questions` is a valid question | FAILED |
| `CANCELLED` | You aborted the run | saved rows are kept |

#### Licence and attribution

Stack Exchange content is licensed by its authors under CC BY-SA (2.5, 3.0 or 4.0, by post date). Each row has its `license` and `licenseUrl`, and `attribution` gives a ready credit line with the title, author and link. When you reuse the content, show that line and keep the same licence. The Stack Exchange API terms also ask you to name Stack Exchange as the source. The Stack Exchange Acceptable Use Policy limits some uses, for example training AI models without their consent; check that it fits your plan.

Data comes from the [Stack Exchange API](https://api.stackexchange.com/docs). See also the [Stack Exchange API terms of use](https://stackoverflow.com/legal/api-terms-of-use), the [Acceptable Use Policy](https://stackoverflow.com/legal/acceptable-use-policy) and the [CC BY-SA 4.0 licence](https://creativecommons.org/licenses/by-sa/4.0/). This Actor is not affiliated with or endorsed by Stack Exchange, Inc.

> **👉 [Try it now: open the input form](https://console.apify.com/actors/6mmhDQO8UfuOlkjyy/input)**

### Pricing

Pay per event. Apify platform usage is included.

| Event | When | Price (USD) |
| --- | --- | ---: |
| Actor start | once per run; Apify counts the start per GB of run memory, so it is one start at the default 256 MB and the 512 MB maximum | 0.002 |
| Question | per saved question row (`complete` or `partial`), answers included | 0.0027 Free · 0.00243 Bronze · 0.00216 Silver · 0.00189 Gold and above |

`not_found` and `error` rows are free. A run with no results pays only the start.

| Example run | Free | Bronze | Silver | Gold+ |
| --- | ---: | ---: | ---: | ---: |
| 1 question | $0.0047 | $0.0044 | $0.0042 | $0.0039 |
| 10 questions (the prefill) | $0.029 | $0.026 | $0.024 | $0.021 |
| 100 questions | $0.272 | $0.245 | $0.218 | $0.191 |
| 1,000 questions with answers | $2.702 | $2.432 | $2.162 | $1.892 |
| Search with no matches | $0.002 | $0.002 | $0.002 | $0.002 |

Set **Maximum cost per run** in the run options to cap a run. The Actor checks the limit before each row. It stops before a charge would go above it, keeps what it already saved and ends as `CAPPED` with reason `CHARGE_LIMIT`.

> **👉 [Try it now: open the input form](https://console.apify.com/actors/6mmhDQO8UfuOlkjyy/input)**

### Limits

- Up to 1,000 questions per run. Measured runs of 1,000 questions with answers, all COMPLETE inside the 600-second default timeout: 16 seconds for Super User `windows-10` in HTML, 217 seconds for the most-voted Stack Overflow `javascript` questions in Markdown (about 20 answers per question, 40 MB of text).
- Without an API key, the Stack Exchange API gives about 300 requests per day per IP address, and Apify runs share IP addresses. One request reads up to 100 questions with answers, so normal runs use a few requests. `RUN_SUMMARY` shows the remaining quota.
- If the daily quota runs out, the run stops as `CAPPED` with reason `QUOTA_LIMIT`, keeps saved rows and suggests an `apiKey`. If nothing was saved yet, the run is `ERROR`.
- The API asks clients to wait between some requests. The Actor follows this, so big runs take minutes, not seconds.
- The Actor stops reading 30 seconds before the run timeout, and after 870 seconds at most, so it can save the results (`CAPPED`, `DEADLINE`). With a shorter timeout, for example 300 seconds, a run of 1,000 answer-heavy questions can stop early with the rows read so far.
- No comments, user profiles, badges or chat. Only questions and their answers.
- No private or deleted content. Deleted questions come back as `not_found` rows.
- Answer links (`/a/<id>`) are not looked up. Use the question link instead.
- The data is live: votes, views and answers can change between runs.

> **👉 [Try it now: open the input form](https://console.apify.com/actors/6mmhDQO8UfuOlkjyy/input)**

### API, export and AI agents

- **Export:** the dataset downloads as JSON, CSV, Excel, XML or HTML. The **Questions** view shows a flat table with the main question fields.
- **API:** start a run with `POST https://api.apify.com/v2/acts/cliqtomedia~stack-exchange-scraper/runs` and the input JSON; read rows from the run's default dataset.
- **Scheduling, webhooks, Make, Zapier, n8n:** use the standard Apify integrations. The next system can use `site` + `questionId` as a stable key.

#### Use with AI agents (MCP)

- MCP server with only this Actor: `https://mcp.apify.com?tools=cliqtomedia/stack-exchange-scraper`
- Smallest useful input: `{"site": "stackoverflow", "tags": ["apify"], "maxQuestions": 10}`
- Key output fields: `title` (question title), `link` (public URL), `score` (votes), `answers[].body` with `answers[].isAccepted` (answer text and accepted flag), `attribution` (credit line to show with the content).
- The prefill run takes a few seconds and costs $0.029 on the Free plan (start $0.002 + 10 questions). 1,000 questions with answers took 16 to 217 seconds in our tests, inside the 600-second default timeout. Keep `maxQuestions` small for quick answers.

> **👉 [Try it now: open the input form](https://console.apify.com/actors/6mmhDQO8UfuOlkjyy/input)**

### Troubleshooting

#### The run failed with `Unknown Stack Exchange site`

Symptom: the run is FAILED with `INVALID_INPUT`. Likely reason: the `site` value is not a site name. Check: open the site in a browser; the name is the first part of the address (`superuser.com` → `superuser`, `math.stackexchange.com` → `math`). Action: fix `site` or paste the full domain.

#### The dataset is empty

Symptom: the run SUCCEEDED with `NO_RESULTS`. Likely reason: no question has all the tags, or the dates or query are too narrow. Check: open the tag page on the site. Action: remove a tag or widen the dates.

#### I got a `not_found` row

Likely reason: the question was deleted, or the ID is an answer ID. Check: open the link from `inputs` in a browser. Action: use the question link. These rows are free.

#### The run ended with `QUOTA_LIMIT`

The shared daily API quota of this IP address ran out. Saved rows are kept. Run again later, or add a free Stack Exchange API key in `apiKey`.

> **👉 [Try it now: open the input form](https://console.apify.com/actors/6mmhDQO8UfuOlkjyy/input)**

### FAQ

#### Do I need a Stack Overflow account or API key?

No. The Actor reads public data from the official Stack Exchange API. No login and no cookies. The `apiKey` field is optional: a free Stack Apps key only raises the daily quota and gives no account access.

#### Are answers charged separately?

No. Answers are part of the question row. One question row is one charge, with up to 500 answers inside.

#### Which sites work?

Any public Stack Exchange site: Stack Overflow, Super User, Server Fault, Ask Ubuntu, Mathematics, MathOverflow, Stack Overflow in Russian and others. Use the site name or domain in `site`.

#### Are the numbers live?

Yes. Each run reads the API at that moment; `fetchedAt` shows when. Votes, views and answers change over time.

#### Is personal data included?

Only public profile data shown on the site: the author's user ID, display name, reputation and profile link. No email, location or other profile details.

> **👉 [Try it now: open the input form](https://console.apify.com/actors/6mmhDQO8UfuOlkjyy/input)**

### Related Actors

- [Hacker News Scraper: Stories, Comments & Parent IDs](https://apify.com/cliqtomedia/hacker-news-stories-comments-scraper) — stories and comment threads from another big developer community.
- [Reddit Scraper: Posts, Comments & Subreddits (No login)](https://apify.com/cliqtomedia/reddit-scraper) — posts and comments from subreddits about the same topic.
- [Quora Answers Scraper: Upvotes, Views & Authors, No Login](https://apify.com/cliqtomedia/quora-scraper) — questions and answers from Quora, with upvotes and authors.
- [GitHub Releases Scraper & Monitor: Notes & Assets](https://apify.com/cliqtomedia/github-releases-monitor-scraper) — release notes of the library your questions are about.

> **👉 [Try it now: open the input form](https://console.apify.com/actors/6mmhDQO8UfuOlkjyy/input)**

### Support

For a bug, question or feature request, open an issue on the Actor's **Issues** tab. Add the run ID and your input. Never post API keys or other secrets.

> **👉 [Try it now: open the input form](https://console.apify.com/actors/6mmhDQO8UfuOlkjyy/input)**

# Changelog

This Actor's version history is a separate document: https://apify.com/cliqtomedia/stack-exchange-scraper/changelog.md

# Actor input Schema

## `mode` (type: `string`):

tag: newest/top questions carrying all given tags. search: keyword search (query) with optional tags. question: exact question IDs or URLs from the questions list.

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

Stack Exchange site name or domain, e.g. stackoverflow, superuser, serverfault, askubuntu, math, math.stackexchange.com. A question URL in question mode sets its own site.

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

Up to 5 tags, e.g. python or web-scraping. A question must carry all of them. Used in tag and search modes. Empty in tag mode = all questions of the site.

## `query` (type: `string`):

Search mode: free-text words matched in titles and bodies, e.g. headless chrome timeout. Not used in other modes.

## `questions` (type: `array`):

Question mode: up to 1000 question IDs (e.g. 11227809) or URLs (https://stackoverflow.com/questions/11227809/...). Answer links are rejected per item; missing questions come back as not_found rows (not charged).

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

Order of tag and search results. hot works only in tag mode, relevance only in search mode.

## `maxQuestions` (type: `integer`):

Upper limit of question rows in tag and search modes (each row = one charged question). One API request reads up to 100 questions with answers, so 1000 questions need about 10 requests.

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

Add the answers (body, score, accepted flag, author, licence) inside each question row. Accepted answer first, then by score.

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

Keep at most this many answers per question (accepted first, then highest score). answersComplete shows whether all answers fit.

## `bodyFormat` (type: `string`):

Format of question and answer bodies. Markdown is best for LLM and RAG datasets; plain text strips all markup.

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

Only questions created on or after this date (UTC), e.g. 2025-01-01. Tag and search modes.

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

Only questions created on or before this date (UTC, whole day included).

## `apiKey` (type: `string`):

Optional free app key from stackapps.com (Register an app). It is not a login and grants no account access; it raises the daily quota and lifts the 25-page limit. Stored as a secret, never logged or written to output.

## Actor input object example

```json
{
  "mode": "tag",
  "site": "stackoverflow",
  "tags": [
    "apify"
  ],
  "sort": "newest",
  "maxQuestions": 10,
  "includeAnswers": true,
  "maxAnswersPerQuestion": 30,
  "bodyFormat": "markdown"
}
```

# Actor output Schema

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

Question rows as a table; full rows with answers in JSON.

## `allRows` (type: `string`):

Every row with nested answers, including not_found and error rows (status field).

## `runSummary` (type: `string`):

Status, counts, quota, licence notice and request statistics.

# 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",
    "tags": [
        "apify"
    ],
    "maxQuestions": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("cliqtomedia/stack-exchange-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",
    "tags": ["apify"],
    "maxQuestions": 10,
}

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

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).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",
  "tags": [
    "apify"
  ],
  "maxQuestions": 10
}' |
apify call cliqtomedia/stack-exchange-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,cliqtomedia/stack-exchange-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/6mmhDQO8UfuOlkjyy/builds/45k7gMPdTPnatXprO/openapi.json
