# Stack Overflow Scraper - Questions, Answers, Tags and Votes (`turboextract/stackoverflow-questions`) Actor

Export Stack Overflow questions by tag or keyword with score, views, answers, accepted answer, tags, dates, author reputation and the full question and top answer text. Any Stack Exchange site. Filters for date, score and unanswered. No login.

- **URL**: https://apify.com/turboextract/stackoverflow-questions.md
- **Developed by:** [Moses Ndambuki](https://apify.com/turboextract) (community)
- **Categories:** Developer tools, AI
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.00 / 1,000 question delivereds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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 Scraper: Questions, Answers, Tags, Votes and Views

**Export Stack Overflow questions by tag or keyword, with score, views, answer count, accepted answer, tags, dates, author reputation, and the full question and top answer as plain text.** Works on any Stack Exchange site, like Server Fault, Super User or Data Science. Filter by date, score and unanswered. No login.

In one test, the tag `web-scraping` returned 15 questions with their full text and top answers in about 3 seconds.

***

### Who this is for

- **Developer relations and devtool marketers** finding questions about their product and rivals
- **Technical writers** spotting gaps in documentation
- **Founders** validating developer pain points
- **AI teams** building question-and-answer datasets
- **Recruiters** finding active experts in a technology

***

### What you get

```json
{
  "questionId": 79989568,
  "url": "https://stackoverflow.com/questions/79989568/why-is-scrapy-not-returning-items-despite-crawling",
  "title": "Why is scrapy not returning items despite crawling?",
  "tags": ["python", "web-scraping", "scrapy"],
  "score": 3,
  "views": 180,
  "answerCount": 1,
  "isAnswered": true,
  "createdAt": "2026-07-31T19:15:50.000Z",
  "authorName": "Gabriel Silva",
  "authorReputation": 39,
  "body": "I've been learning how to use scrapy, and made some practice code...",
  "topAnswer": "Dumping Scrapy stats: shows ...",
  "topAnswerScore": 3,
  "license": "CC BY-SA 4.0"
}
```

***

### How it works

```mermaid
flowchart LR
    A[Tags] --> C[Stack Exchange API]
    B[Keyword search] --> C
    C --> D[Filters: date, score, unanswered]
    D --> E[Top answer for each question]
    E --> F[Question rows]
```

***

### Quick start

1. Click **Try for free**.
2. Add **Tags**, like `python` or `reactjs`, or a **Keyword search**.
3. Optional: change **Site**, **Sort** or **Asked after**.
4. Optional: turn on **Unanswered only** to find questions you can answer.
5. Click **Start**, then export to CSV, JSON, Excel or Google Sheets.

#### API

```bash
curl -X POST "https://api.apify.com/v2/acts/Turboextract~stackoverflow-questions/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"tags": ["playwright"], "sort": "votes", "maxResults": 200}'
```

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_TOKEN")
run = client.actor("Turboextract/stackoverflow-questions").call(run_input={
    "searchQuery": "next.js hydration error",
    "fromDate": "2026-10-01",
})
for q in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(q["score"], q["views"], q["title"])
```

***

### Input

| Field | Default | What it does |
|---|---|---|
| `tags` | – | Tags; each searched separately |
| `searchQuery` | – | Free-text search |
| `site` | stackoverflow | Any Stack Exchange site |
| `sort` | creation | Activity, newest, votes, hot, week, month |
| `unansweredOnly` | false | Only unanswered questions |
| `minScore` | – | Skip low-scored questions |
| `fromDate` | – | Asked on or after this date |
| `includeBody` | true | Question text and top answer |
| `maxPerQuery` | 0 | Cap per tag (0 = none) |
| `maxResults` | 50 | Total cap per run |

***

### Pricing

**$0.001 per question delivered, answer included.** 1,000 questions cost $1.

| Option | 1,000 questions |
|---|---|
| **Stack Overflow Scraper** | **$1**, top answer included |
| Developer community monitoring tools | $100+ a month |

***

### Use cases

- **DevRel monitoring**: new questions about your library every morning
- **Docs gaps**: the most viewed questions in your tag with no accepted answer
- **Competitor research**: what developers struggle with in rival tools
- **Q\&A datasets**: questions and accepted answers for fine-tuning or retrieval
- **Content ideas**: top-voted questions to turn into tutorials

***

### Tips

- Tag names use hyphens, like `web-scraping` or `google-cloud-platform`.
- The site is the first part of the address, like `superuser` or `datascience`.
- Content is licensed CC BY-SA. Credit the author and link the question if you republish it.
- Stack Exchange limits anonymous calls per IP each day, so very large runs can stop early. The log says when.

***

### Pairs well with

- [GitHub Issues Search](https://apify.com/Turboextract/github-issues-search): bug reports for the same tools
- [Hacker News Search](https://apify.com/Turboextract/hacker-news-search): developer discussions
- [GitHub Trending Repos](https://apify.com/Turboextract/github-trending-repos): rising developer tools

***

### FAQ

**Do I need a Stack Overflow account?** No. The actor uses the public Stack Exchange API.

**Does it include all answers?** It includes the accepted answer, or the top-voted one if none is accepted.

**Can I scrape other sites?** Yes. Set `site` to any Stack Exchange site name.

**How fresh is the data?** It is read live on every run.

**Is it legal?** Stack Exchange content is public and licensed CC BY-SA, which allows reuse with attribution.

***

### SEO keywords

Stack Overflow scraper, Stack Overflow API export, Stack Exchange questions dataset, Stack Overflow questions to CSV, developer questions monitoring, Stack Overflow tag tracker, Q\&A dataset for LLM, unanswered Stack Overflow questions, programming questions scraper, Stack Overflow answers export

***

### Support

- Docs and examples: https://github.com/andersonjames38phd-cpu/stackoverflow-questions
- Community Discord: https://discord.gg/8SrXSCpvgj

Built and maintained by [Turboextract](https://apify.com/Turboextract) on the Apify platform.

# Actor input Schema

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

Questions with any of these tags, like python, reactjs or apify. Each tag is searched separately.

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

Free-text search in titles and bodies, like playwright timeout.

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

Stack Exchange site, like stackoverflow, serverfault, superuser, askubuntu or datascience.

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

Order of questions.

## `unansweredOnly` (type: `boolean`):

Only questions with no accepted or upvoted answer.

## `minScore` (type: `integer`):

Skip questions with a lower vote score, like 1. Empty keeps every question, including downvoted ones.

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

Keep only questions asked on or after this date, like 2026-11-01.

## `includeBody` (type: `boolean`):

Adds the question body and the accepted or top answer as plain text.

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

Stop after this many questions.

## `maxPerQuery` (type: `integer`):

Cap per tag, so one busy tag does not fill the whole run. 0 means no cap.

## Actor input object example

```json
{
  "tags": [
    "web-scraping"
  ],
  "site": "stackoverflow",
  "sort": "creation",
  "unansweredOnly": false,
  "includeBody": true,
  "maxResults": 50,
  "maxPerQuery": 0
}
```

# Actor output Schema

## `results` (type: `string`):

One row per question with votes, views, answers, tags and text.

# 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 = {
    "tags": [
        "web-scraping"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("turboextract/stackoverflow-questions").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 = { "tags": ["web-scraping"] }

# Run the Actor and wait for it to finish
run = client.actor("turboextract/stackoverflow-questions").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 '{
  "tags": [
    "web-scraping"
  ]
}' |
apify call turboextract/stackoverflow-questions --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,turboextract/stackoverflow-questions"
        }
    }
}
```

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/5TEGY9OsTU8RcYyJB/builds/EoZNJxuNglQfbUyXJ/openapi.json
