# Stack Exchange Questions Scraper (`logiover/stack-exchange-questions-scraper`) Actor

Scrape questions from Stack Overflow and any Stack Exchange site by tag: title, tags, score, views, answers, author and dates. Monitor questions about your product, tech or competitors on a schedule.

- **URL**: https://apify.com/logiover/stack-exchange-questions-scraper.md
- **Developed by:** [Logiover](https://apify.com/logiover) (community)
- **Categories:** Developer tools, Automation
- **Stats:** 158 total users, 10 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.50 / 1,000 results

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 Exchange Questions Scraper — Stack Overflow Q&A Data by Tag to JSON & CSV

Scrape **questions from Stack Overflow and any [Stack Exchange](https://stackexchange.com) site** using the official Stack Exchange API. This Stack Overflow scraper pulls questions by tag — with title, score, view count, answer count, author, reputation and dates — fully paginated, with **no login, no API key and no blocking**. Export Stack Exchange Q&A data to JSON, CSV or Excel.

Built for **scheduled, recurring runs**, it lets you monitor topics, products, technologies and competitors across the entire developer Q&A network.

### ✨ What this Actor does / Key features

- 🌐 **Works on every Stack Exchange site** — Stack Overflow, Server Fault, Super User, Data Science, Ask Ubuntu and more.
- 🔌 **Official Stack Exchange API** — reliable, fully paginated and resistant to layout changes.
- 🏷️ **Filter by tag** — target one or many tags (e.g. `python`, `react`) to narrow results to your niche.
- 🔢 **Sort options** — order questions by `activity`, `creation`, `votes` or `hot`.
- 📊 **Rich data per question** — title, link, tags, author, author reputation, score, view count, answer count, answered status, accepted-answer flag and dates.
- 🎯 **Flexible scope** — set `maxQuestions` to `0` to pull every available question, or cap it for a smaller run.
- 🔑 **No authentication** — no Stack Exchange account, no API key, no proxy required.
- 📦 **Export-ready output** — flat JSON downloadable as CSV, Excel, JSON or XML, with a pre-built Overview dataset view.

### 🔍 Input

| Field | Type | Description |
|---|---|---|
| `site` | string | Stack Exchange site to scrape, e.g. `stackoverflow`, `serverfault`, `superuser`, `datascience`. Default `stackoverflow`. |
| `tagged` | string | Filter by tag, e.g. `python`, `react`. Use semicolons to combine multiple tags. Leave empty for all questions. |
| `sort` | string (enum) | Sort order: `activity`, `creation`, `votes` or `hot`. Default `activity`. |
| `maxQuestions` | integer | Maximum number of questions to save. `0` = all available questions. |

### 🚀 Example input

```json
{
  "site": "stackoverflow",
  "tagged": "python;pandas",
  "sort": "votes",
  "maxQuestions": 500
}
````

### 📦 Output

One Apify dataset record per question. Records are flat JSON and can be exported to CSV, Excel, JSON or XML, or pulled via the Apify API. A pre-built **Overview** dataset view shows the key columns.

| Field | Description |
|---|---|
| `questionId` | Stack Exchange numeric question ID |
| `title` | Question title |
| `link` | Full URL to the question |
| `tags` | Array of tags applied to the question |
| `author` | Display name of the question's author |
| `authorReputation` | Reputation score of the author |
| `score` | Net vote score of the question |
| `viewCount` | Number of times the question has been viewed |
| `answerCount` | Number of answers posted |
| `isAnswered` | Whether the question has at least one upvoted/accepted answer |
| `hasAcceptedAnswer` | Whether an accepted answer exists |
| `createdAt` | ISO timestamp when the question was created |
| `lastActivityAt` | ISO timestamp of the most recent activity |
| `scrapedAt` | ISO-8601 scrape timestamp |

### 💡 Use cases

- **Product & brand monitoring** — track questions mentioning your tool, library or technology across Stack Overflow.
- **Developer trend research** — see what the community is struggling with and which topics are gaining momentum.
- **Content & SEO teams** — find high-traffic, high-view questions to target with tutorials and documentation.
- **Developer support & DevRel** — surface common pain points in your ecosystem and prioritize docs or fixes.
- **Competitive intelligence** — monitor questions about competing products and frameworks.

### ❓ Frequently Asked Questions

**Is scraping Stack Exchange allowed?**
The Actor uses the official public Stack Exchange API and reads only publicly visible question data. Use the data responsibly and in line with the Stack Exchange API terms and attribution requirements.

**Do I need an API key or a login?**
No. The Actor works without an API key, without a Stack Exchange account and without a proxy.

**Which sites can I scrape?**
Any Stack Exchange site — just set the `site` field to its short name (e.g. `stackoverflow`, `serverfault`, `superuser`, `datascience`, `askubuntu`).

**Can I filter by tag?**
Yes. Use the `tagged` field with one tag or several tags separated by semicolons to scope results to your topic.

**How many questions can I get?**
Set `maxQuestions` to `0` to pull every available question for your query, or set a number for a smaller, faster run. The Actor handles pagination automatically.

**Can I schedule it?**
Yes. The Actor is designed for scheduled runs — run it daily or hourly to keep an always-current Stack Exchange questions feed.

**What output formats are supported?**
Every run produces a structured dataset you can export to JSON, CSV, Excel or XML, or access through the Apify API.

### ⏰ Scheduling & integration

Schedule this Actor on Apify to run daily or hourly for an always-current Stack Exchange questions feed. Export results to JSON, CSV or Excel, or use the Apify API and webhooks to push new questions into Google Sheets, a database, Slack or your own monitoring dashboard.

# Actor input Schema

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

Stack Exchange site, e.g. 'stackoverflow', 'serverfault', 'superuser', 'datascience'.

## `tagged` (type: `string`):

Filter by tag, e.g. 'python', 'react'. Use semicolons for multiple. Leave empty for all.

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

Sort order.

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

Maximum questions to save. 0 = all.

## Actor input object example

```json
{
  "site": "stackoverflow",
  "tagged": "",
  "sort": "activity"
}
```

# Actor output Schema

## `title` (type: `string`):

title

## `tags` (type: `string`):

tags

## `score` (type: `string`):

score

## `viewCount` (type: `string`):

viewCount

## `answerCount` (type: `string`):

answerCount

## `isAnswered` (type: `string`):

isAnswered

## `author` (type: `string`):

author

## `createdAt` (type: `string`):

createdAt

# 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("logiover/stack-exchange-questions-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 = {}

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

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Stack Exchange Questions Scraper",
        "description": "Scrape questions from Stack Overflow and any Stack Exchange site by tag: title, tags, score, views, answers, author and dates. Monitor questions about your product, tech or competitors on a schedule.",
        "version": "1.0",
        "x-build-id": "GzSoRGaQdyfpf5uYV"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/logiover~stack-exchange-questions-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-logiover-stack-exchange-questions-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/logiover~stack-exchange-questions-scraper/runs": {
            "post": {
                "operationId": "runs-sync-logiover-stack-exchange-questions-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/logiover~stack-exchange-questions-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-logiover-stack-exchange-questions-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",
                        "type": "string",
                        "description": "Stack Exchange site, e.g. 'stackoverflow', 'serverfault', 'superuser', 'datascience'.",
                        "default": "stackoverflow"
                    },
                    "tagged": {
                        "title": "Tag",
                        "type": "string",
                        "description": "Filter by tag, e.g. 'python', 'react'. Use semicolons for multiple. Leave empty for all.",
                        "default": ""
                    },
                    "sort": {
                        "title": "Sort",
                        "enum": [
                            "activity",
                            "creation",
                            "votes",
                            "hot"
                        ],
                        "type": "string",
                        "description": "Sort order.",
                        "default": "activity"
                    },
                    "maxQuestions": {
                        "title": "Max Questions",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Maximum questions to save. 0 = all."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
