Stack Overflow & Stack Exchange Q&A Scraper
Pricing
from $0.30 / 1,000 questions
Stack Overflow & Stack Exchange Q&A Scraper
Search Stack Overflow or any Stack Exchange site's free public API by keyword or tag and get one row per question — score, tags, author, view/answer counts and the accepted answer's text.
Pricing
from $0.30 / 1,000 questions
Rating
0.0
(0)
Developer
Murat Uzun
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
12 hours ago
Last modified
Categories
Features
Share
What is Stack Overflow & Stack Exchange Q&A Scraper?
Stack Overflow & Stack Exchange Q&A Scraper is an Apify Actor that searches Stack Overflow — or any of the 170+ other Stack Exchange sites (Super User, Server Fault, Ask Ubuntu, Math Stack Exchange, and more) — through their free, official StackExchange API v2.3. Give it one or more search phrases and/or tags, and it returns one clean row per question: title, score, view/answer counts, tags, author reputation, the question body, and — optionally — the accepted answer's full text. No scraping of stackoverflow.com pages, no API key required. Runs on Apify's schedule, webhook and API infrastructure, so a weekly "new questions in my niche" digest is a five-minute setup.
Pricing: $0.50 per 1,000 questions on the Free plan ($0.30 on Gold and above), plus a $0.00005 start fee.
Why use Stack Overflow & Stack Exchange Q&A Scraper?
- Documentation and support teams track newly asked questions about their product's tags (e.g. a library or framework name) to spot gaps worth writing a guide for.
- Content researchers pull the highest-voted questions on a topic across Stack Overflow to see what developers actually struggle with.
- Community managers monitor a Stack Exchange site other than Stack Overflow — Super User, Server Fault, a language-specific SE site — for their own brand or product mentions.
- Dataset builders and LLM fine-tuners collect question/accepted-answer pairs on a topic in one flat, ready-to-import table.
How to use Stack Overflow & Stack Exchange Q&A Scraper
- Fill Search queries with one phrase per row, e.g.
web scraping,playwright timeout. - Set Site to the Stack Exchange site's API slug (
stackoverflowby default; see the full list at stackexchange.com/sites). - Optionally add Tags to narrow every query, e.g.
python. - Choose Sort by and set Minimum score and Max results per query.
- Turn on Include accepted answer if you want each question's accepted answer text too.
- Click Start and export the dataset as JSON, CSV, Excel or HTML from the Output tab.
Example input
{"queries": ["web scraping", "playwright timeout"],"site": "stackoverflow","sortBy": "votes","minScore": 0,"includeAnswers": false,"maxResults": 50}
Example output
{"site": "stackoverflow","questionId": "76310103","title": "Cannot run Playwright test \"--ui\"","link": "https://stackoverflow.com/questions/76310103","score": 5,"viewCount": 10151,"answerCount": 2,"isAnswered": true,"acceptedAnswerId": "76583732","tags": ["reactjs", "playwright"],"author": "Kode_12","authorReputation": 5016,"createdAt": "2023-05-22T18:48:52.000Z","lastActivityAt": "2025-01-13T20:19:54.000Z","body": "I'm trying to run npx playwright test --ui to run the playwright e2e test files…","acceptedAnswerBody": null,"query": "playwright timeout","scrapedAt": "2026-09-14T01:26:37.933Z","error": null}
Data table
Stack Overflow & Stack Exchange Q&A Scraper extracts 17 fields per row:
| Field | Type | Description |
|---|---|---|
site, questionId, title, link | string | Site slug, numeric id, title and public question URL |
score, viewCount, answerCount | number | Upvotes minus downvotes, view count and answer count |
isAnswered, acceptedAnswerId | boolean, string | Whether it has any answer, and the accepted one's id |
tags | array | The question's tags |
author, authorReputation | string, number | Display name and reputation of the question's owner |
createdAt, lastActivityAt | string | ISO 8601 UTC timestamps |
body | string | Question body, plain text, up to 5000 characters |
acceptedAnswerBody | string | Accepted answer text, plain text, up to 5000 characters (only with Include accepted answer) |
query, error, scrapedAt | string | The search that produced this row, any failure reason and the run timestamp |
Input parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
queries | array | ["web scraping"] | One search phrase per query |
site | string | stackoverflow | Stack Exchange site API slug |
tagged | array | [] | Tags applied to every query |
sortBy | string | votes | relevance, votes, creation or activity |
minScore | integer | 0 | Drop questions scoring below this |
includeAnswers | boolean | false | Add the accepted answer's full text |
maxResults | integer | 50 | Max questions per query (1-500) |
apiKey | string | — | Optional StackApps app key; raises the shared daily quota from 300 to 10,000 requests |
Pricing
Stack Overflow & Stack Exchange Q&A Scraper uses pay-per-event pricing: $0.50 per 1,000 result rows on the free plan ($0.0005 per row), with volume tiers down to $0.30 per 1,000 on the top Apify plans, plus a negligible actor-start fee. A default run (one query, 50 questions) costs about 2.5 cents. Set Maximum cost per run and the Actor trims the work to what the budget covers instead of overspending.
Stack Overflow & Stack Exchange Q&A Scraper vs. the Stack Overflow search page
Stack Overflow's own search UI shows 15 results per page with no structured export, and searching a niche Stack Exchange site means visiting it separately. This Actor runs any number of queries — against Stack Overflow or any other Stack Exchange site — in one batch, and returns every result as a flat, typed row, ready to sort, filter or join with other data.
Dated Store check, 25 November 2026 (public Store API pricing, FREE tier per 1,000 rows; each row is one question or result):
| Actor | FREE price | Unit | Source |
|---|---|---|---|
| This Actor | $0.50 per 1,000 | one question row | https://apify.com/webdatatools/stackexchange-scraper |
| sian.agency/stack-exchange-scraper | $6.00 per 1,000 | one extracted question | https://apify.com/sian.agency/stack-exchange-scraper |
| logiover/stack-exchange-questions-scraper | $5.00 per 1,000 | one result | https://apify.com/logiover/stack-exchange-questions-scraper |
| hichemdev/stackoverflow-scraper | $2.00 per 1,000 | one result | https://apify.com/hichemdev/stackoverflow-scraper |
The Store entries are not identical in scope: some cover Stack Overflow only, and the rows may carry different fields. The Stack Exchange API used here covers all 170+ sites.
Use it from code
JavaScript (npm i apify-client):
import { ApifyClient } from 'apify-client';const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });const run = await client.actor('webdatatools/stackexchange-scraper').call({queries: ['web scraping'],site: 'stackoverflow',maxResults: 5,});const { items } = await client.dataset(run.defaultDatasetId).listItems();console.log(items.map((q) => [q.title, q.score, q.link]));
Python (pip install apify-client):
from apify_client import ApifyClientclient = ApifyClient("<YOUR_APIFY_TOKEN>")run = client.actor("webdatatools/stackexchange-scraper").call(run_input={"queries": ["web scraping"], "site": "stackoverflow", "maxResults": 5})for q in client.dataset(run["defaultDatasetId"]).iterate_items():print(q["title"], q["score"], q["link"])
CLI (curl, or the Apify CLI with apify call webdatatools/stackexchange-scraper --silent --output-dataset):
curl -s -X POST "https://api.apify.com/v2/acts/webdatatools~stackexchange-scraper/run-sync-get-dataset-items?token=<YOUR_APIFY_TOKEN>" \-H "Content-Type: application/json" \-d '{"queries": ["web scraping"], "site": "stackoverflow", "maxResults": 5}'
Using Stack Overflow & Stack Exchange Q&A Scraper with AI agents and MCP
Stack Overflow & Stack Exchange Q&A Scraper is pay-per-event with limited permissions — the two requirements for an Actor to be callable through the Apify MCP server at mcp.apify.com. An agent passes a queries list and gets back structured question rows — including, on request, the accepted answer's own text — ready to summarise "what are the top-voted answers about X" without the agent visiting stackoverflow.com itself.
FAQ
Does this need an API key? No. The StackExchange API's /search/advanced endpoint is free and unauthenticated, shared at 300 requests per IP per day. An optional apiKey (free at stackapps.com/apps/oauth/register) raises that to 10,000 requests per day — worth it for large or frequent runs.
Why is acceptedAnswerBody null even with Include accepted answer on? Many questions have no accepted answer at all (acceptedAnswerId is also null in that case) — isAnswered can still be true from an unaccepted answer.
What counts as the body? The question's own text (body_markdown from the API), HTML-decoded and with any inline HTML tags stripped down to plain text, truncated at 5000 characters. Markdown syntax like **bold** or `code` is left as-is.
How does tagged combine with queries? Every tag in tagged is applied to every query as an additional filter — a query of web scraping with tagged: ["python"] returns only Python-tagged questions matching that text.
What happens on the API's rate-limit backoff? When a response carries a backoff field (seconds), this Actor sleeps that long before its next request — automatically, with no configuration needed.
What are the limitations? minScore is applied after fetching, so a query can legitimately return fewer rows than maxResults once low-scoring questions are dropped. A failing query still produces one row, with the reason in error.
How much does a run cost? You pay per result: $0.0005 per question on the Free plan, $0.0003 on Gold and above, plus a $0.00005 start fee. Failed queries and empty searches are not charged, and Maximum cost per run caps the spend.
Is this legal to run? Yes. The StackExchange API is a public, documented, officially supported endpoint built for third-party use, and all content returned is licensed CC BY-SA by its authors — this Actor collects no private or personal data beyond public display names.
Error codes
Each failed query is one ERRORS entry with an errorCode and costs nothing. The OUTPUT record has zeroResultReason, stoppedForTime and deadlineSource.
errorCode | Meaning | What to do |
|---|---|---|
INVALID_SITE | The site is not a Stack Exchange site slug | Use the slug from stackexchange.com/sites |
SOURCE_FAILED | The StackExchange API failed or returned an unreadable answer (HTTP error, timeout, quota) | Run again later, or add an apiKey |
NO_QUESTIONS | The search matched no questions | Broaden the queries or tags |
NO_SCORED_QUESTIONS | Questions matched, but none reached minScore | Lower minScore |
INVALID_INPUT | The input failed the schema, or no query or tag was given | Fix the input |
CHARGE_LIMIT | Maximum cost per run leaves no budget for one question | Raise Maximum cost per run |
NO_RESULTS | The run saved no question; the reason is in OUTPUT.zeroResultReason | See the reason |
zeroResultReason: TIME_LIMIT means the run stopped before its timeout and saved no question with no source failure. Raise Timeout in Run options. A run that stops with saved questions ends SUCCEEDED with stoppedForTime: true.
Limitations
- The free anonymous quota is 300 API requests per IP per day; add
apiKeyfor 10,000. minScoreis applied after fetching, so a query can return fewer rows thanmaxResults.sortByfollows the Stack Exchange API. It does not reproduce every ordering of the website search page.- Question bodies are truncated at 5,000 characters.
Related Actors
- Hacker News Search & Front Page Scraper — stories and comments by query, a related discussion source
- GitHub Trending Repositories Scraper — trending repos and developers by language
The full webdatatools suite is listed on the publisher profile.
Support
Open an issue on the Actor's Issues tab on Apify. Include the site, the query, the run ID and the ERRORS record if one exists.
If this Actor saved you time, a short review on its Apify Store page helps others find it.