# Stack Overflow & Stack Exchange Questions Scraper (`negligible_carrageen/stackexchange-questions`) Actor

Questions from Stack Overflow and the Stack Exchange network via the official API: title, tags, score, views, answers, author and link. No login, no API key.

- **URL**: https://apify.com/negligible_carrageen/stackexchange-questions.md
- **Developed by:** [Hussain Ali](https://apify.com/negligible_carrageen) (community)
- **Categories:** Developer tools, Open source, Lead generation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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 Questions Scraper

Export **questions from Stack Overflow and the wider Stack Exchange network** to JSON, CSV, Excel or Google Sheets: title, tags, score, views, answer count, accepted-answer flag, asker and the canonical URL.

- Uses the **official Stack Exchange API 2.3**. No login, no API key, no proxies, no browser.
- Works on any site in the network: Stack Overflow, Super User, Ask Ubuntu, Server Fault, Software Engineering, Data Science, Mathematics and the rest.
- Filter by tags, date window, minimum score, search text, and whether the question has answers.
- Optional full question body (plain text), plus a short excerpt. Each row includes the [CC BY-SA](https://stackoverflow.blog/2009/06/25/attribution-required/) license so you can attribute correctly.

### What can you use it for?

- **Developer content and SEO:** find frequently asked, high-score questions in a tag to plan tutorials or docs.
- **Support and product research:** see what users struggle with in your ecosystem (`tagged: nextjs`, `fastapi`, `kubernetes`).
- **Community and DevRel monitoring:** a scheduled feed of new questions in your tags, sent to Slack or Sheets.
- **Trend research:** compare volume and scores for a topic week by week.
- **Lead signals:** active askers in a niche (use profile links responsibly; do not spam).

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `site` | string | `stackoverflow` | Site slug, e.g. `stackoverflow`, `askubuntu`, `datascience`. |
| `tagged` | string list | \[] | Keep questions that have **all** of these tags. |
| `query` | string | | Optional full-text search. |
| `sort` | select | `creation` | `creation`, `activity`, `votes`, `hot`, `week`, `month`. |
| `daysBack` | integer | 7 | Only questions created in the last N days. `0` means no date filter. Ignored for `hot` / `week` / `month`. |
| `minScore` | integer | 0 | Skip questions below this score. |
| `answered` | select | `any` | `any`, `has_answers` or `accepted`. |
| `includeBody` | boolean | false | Also store the full question body as plain text. |
| `maxItems` | integer | 50 | Stop after this many questions (up to 5,000). |

#### Example input: new Python questions this week

```json
{ "site": "stackoverflow", "tagged": ["python"], "daysBack": 7, "sort": "creation", "maxItems": 200 }
```

#### Example input: highest-voted Rust questions with an accepted answer

```json
{ "site": "stackoverflow", "tagged": ["rust"], "sort": "votes", "answered": "accepted", "daysBack": 365, "minScore": 5, "maxItems": 100 }
```

#### Example input: Data Science site, hot this week

```json
{ "site": "datascience", "sort": "week", "daysBack": 0, "includeBody": true, "maxItems": 50 }
```

### Output

| Field | Description |
|---|---|
| `site`, `questionId` | Site slug and question id |
| `title`, `tags` | Title and tags |
| `score`, `viewCount`, `answerCount` | Votes, views and answers |
| `isAnswered`, `acceptedAnswerId` | Answered state |
| `ownerName`, `ownerReputation`, `ownerLink` | Asker, as published on the site |
| `createdAt`, `lastActivityAt` | Timestamps (UTC) |
| `url` | Canonical question link (required for attribution) |
| `contentLicense` | Usually `CC BY-SA 4.0` |
| `excerpt` | First 500 characters of the body as plain text |
| `body` | Full plain-text body, only when `includeBody` is true |

#### Example output item

```json
{
  "site": "stackoverflow",
  "questionId": 80003077,
  "title": "What does annotating a variable actually do in Python?",
  "tags": ["python", "python-typing"],
  "score": 25,
  "viewCount": 1400,
  "answerCount": 3,
  "isAnswered": true,
  "acceptedAnswerId": 80003101,
  "ownerName": "Ada Lovelace",
  "ownerReputation": 1234,
  "ownerLink": "https://stackoverflow.com/users/1/ada-lovelace",
  "createdAt": "2026-11-16T12:00:00.000Z",
  "url": "https://stackoverflow.com/questions/80003077/what-does-annotating-a-variable-actually-do-in-python",
  "contentLicense": "CC BY-SA 4.0",
  "excerpt": "I keep seeing variable annotations in Python 3..."
}
```

### FAQ

**Do I need an API key?** No. The actor uses the public unauthenticated quota (300 requests per day per IP, 100 results per request). That is enough for typical runs. If you hit the cap, wait for the daily reset or reduce `maxItems`.

**Which sites work?** Any site on the [Stack Exchange network](https://stackexchange.com/sites). Use the slug from the site's hostname (`stackoverflow`, `askubuntu`, `serverfault`, `math`, `apple`, ...).

**How should I credit the data?** Stack Exchange content is licensed under CC BY-SA. When you republish it, [attribute the author and link to the original question](https://stackoverflow.blog/2009/06/25/attribution-required/). Each row already has `url`, `ownerName` and `contentLicense`.

**Can I get answers too?** This actor exports questions (and the optional question body). Use `acceptedAnswerId` and the question URL to follow up if you need the accepted answer.

**Can I schedule it?** Yes. Run it daily with `daysBack: 1` and send new questions to Google Sheets, Slack or a webhook.

### Related actors

- [Hacker News Who's Hiring Jobs](https://apify.com/negligible_carrageen/hn-hiring-jobs)
- [Show HN & Launch HN Startup Launches](https://apify.com/negligible_carrageen/show-hn-launches)
- [npm & PyPI Package Stats](https://apify.com/negligible_carrageen/npm-pypi-package-stats)
- [arXiv New Papers](https://apify.com/negligible_carrageen/arxiv-new-papers)

# Actor input Schema

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

Stack Exchange site slug, e.g. stackoverflow, superuser, askubuntu, serverfault, softwareengineering, datascience, ai, devops, math, ux, apple, android, unix, dba, gamedev. See https://stackexchange.com/sites.

## `tagged` (type: `array`):

Only questions that have all of these tags (AND), e.g. python, reactjs, rust. Leave empty for any tag.

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

Optional full-text search (Stack Exchange advanced search). Leave empty to list questions by tag, date and sort only.

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

Question order. 'hot', 'week' and 'month' ignore the date window. Use 'votes' with a date window for the best recent questions in a tag.

## `daysBack` (type: `integer`):

Only questions created in the last N days. 0 means no date filter. Ignored when sort is hot, week or month.

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

Skip questions with a lower vote score.

## `answered` (type: `string`):

Keep all questions, only those with answers, or only those with an accepted answer.

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

Also store the full question body as plain text. An excerpt is always included when the body is fetched; enabling this stores the complete text.

## `maxItems` (type: `integer`):

Stop after this many questions (up to 5,000). The official API allows 100 results per request. Unauthenticated quota is 300 requests per day.

## Actor input object example

```json
{
  "site": "stackoverflow",
  "tagged": [],
  "query": "",
  "sort": "creation",
  "daysBack": 7,
  "minScore": 0,
  "answered": "any",
  "includeBody": false,
  "maxItems": 50
}
```

# Actor output Schema

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

One item per question in the default dataset.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("negligible_carrageen/stackexchange-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("negligible_carrageen/stackexchange-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 '{}' |
apify call negligible_carrageen/stackexchange-questions --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,negligible_carrageen/stackexchange-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/SOrfFIbQ4uK6hFUep/builds/sQHW9MhKlXVuD6wJf/openapi.json
