Stack Overflow Q&A Scraper
Pricing
from $2.00 / 1,000 results
Stack Overflow Q&A Scraper
Extract Stack Overflow and Stack Exchange questions with their best answers (accepted first) in HTML and Markdown, votes, comments, closed status and quality scores. Search by tags or keywords, or pass question URLs. Built for AI training data, RAG and research.
Pricing
from $2.00 / 1,000 results
Rating
0.0
(0)
Developer
Sheshinmcfly
Maintained by CommunityActor stats
1
Bookmarked
7
Total users
1
Monthly active users
10 hours ago
Last modified
Categories
Share
Stack Overflow Q&A Scraper — Questions, Answers, Comments & Markdown
Extract questions with their best answers from Stack Overflow and 30+ Stack Exchange sites through the official API. Search by tags or keywords, get the top-voted or hottest questions, or pass specific question URLs. Every question comes with its answers (the accepted one first), in HTML and Markdown, plus votes, comments, closed status and quality scores — clean input for AI training data, RAG pipelines and knowledge bases. No login, no account.
| 🧵 Complete threads | Each question with its accepted answer and top answers — none left out |
| 📝 Markdown + plain text | Bodies as HTML, Markdown and plain text, ready for LLMs |
| 💬 Comments | Comments on questions and answers (optional) |
| 🔎 Filters that work | Minimum score, maximum answers, dates, answered only |
| 🔗 Question URLs | Pull specific questions from any Stack Exchange site |
Data you get
Per question
| Field | Description |
|---|---|
| questionId / site / url | Identity |
| title / body / bodyMarkdown / bodyText | Question as HTML, Markdown and plain text |
| tags | Tags |
| score / upVotes / downVotes / favoriteCount / viewCount | Engagement |
| answerCount / commentCount / isAnswered / acceptedAnswerId | Discussion |
| isClosed / closedReason / closedDate | Closed status |
| bountyAmount / bountyClosesDate | Open bounty |
| author / authorReputation / authorId | Asker |
| createdAt / lastEditDate / lastActivityDate / protectedDate / contentLicense | Dates and license |
| answers | Accepted answer first, then the highest voted (see below) |
| comments | Comments on the question (optional) |
| linkedQuestions | Questions linked to this one (optional) |
| qualityScore / frustrationScore / discussionDepth | 0–100 quality, frustration signals and discussion depth |
Per answer — answerId, author, authorReputation, authorId, score, upVotes, downVotes, isAccepted, body (HTML), bodyMarkdown, createdAt, lastEditDate, commentCount, comments (optional), url
Per comment — commentId, author, score, body, createdAt
Popular tags mode — name, count, hasSynonyms, isRequired
Quick start
Top Python questions with their best answers
{ "mode": "tags", "tags": ["python"], "maxResults": 200, "maxAnswersPerQuestion": 3 }
Keyword search
{ "mode": "search", "keywords": "docker compose volumes", "sortBy": "relevance", "maxResults": 50 }
Well-vetted recent questions
{ "mode": "tags", "tags": ["rust"], "sortBy": "creation", "fromDate": "2026-01-01", "minScore": 5, "maxResults": 100 }
Specific questions with comments
{ "questionUrls": ["https://stackoverflow.com/questions/231767", "https://math.stackexchange.com/questions/1"], "includeComments": true }
How to use
- Pick a mode: by tags, keyword search, top questions, popular tags — or paste question URLs.
- Choose the site (Stack Overflow, Super User, Mathematics, Cross Validated…) and the sort order.
- Narrow it down with dates, minimum score, maximum answers and only answered.
- Choose how many answers per question, and turn on comments or linked questions if you need them.
- Run. The status message shows how many questions were returned out of how many match.
Use cases
- AI training data — problem/solution pairs with the accepted answer, in Markdown.
- RAG pipelines — a knowledge base for a technology stack, with votes to rank sources.
- Developer research — what people struggle with, how fast questions get answered, which get closed.
- Content and documentation gaps — high-view questions with low-scored answers.
- Community analytics — tags, activity and engagement across Stack Exchange sites.
Input
| Field | Type | Description |
|---|---|---|
| mode | select | tags, search, top, popularTags or questions |
| tags | array | Tags to filter by (tags mode) |
| keywords | string | Search text (search mode) |
| questionUrls | array | Question URLs or IDs, any Stack Exchange site |
| site | select | Stack Exchange site |
| sortBy | select | Votes, activity, newest, hot, week, month (search also: relevance) |
| onlyAnswered | boolean | Only questions with an accepted or upvoted answer (default true) |
| minScore | integer | Minimum question score |
| maxAnswers | integer | Maximum number of answers a question can have (0 = no limit) |
| fromDate / toDate | date | Creation date range |
| includeAnswers | boolean | Answers per question (default true) |
| maxAnswersPerQuestion | integer | Accepted first, then highest voted (default 3) |
| includeComments | boolean | Comments on questions and answers |
| includeLinked | boolean | Linked questions |
| maxResults | integer | Max questions (or tags) — up to 2,500 per run |
| apiKey | string | Optional Stack Apps key: lifts the 2,500 limit per query |
Output example
{"questionId": "16047306","site": "stackoverflow","title": "How is Docker different from a virtual machine?","bodyMarkdown": "I keep rereading [the Docker documentation](https://docs.docker.com/) to try to understand the difference between Docker and a full VM…","tags": ["docker", "virtual-machine"],"score": 4501,"upVotes": 4524,"downVotes": 23,"viewCount": 965917,"answerCount": 27,"isAnswered": true,"isClosed": false,"author": "zslayton","createdAt": "2013-04-16T21:19:47.000Z","url": "https://stackoverflow.com/questions/16047306/how-is-docker-different-from-a-virtual-machine","answers": [{"answerId": 16048358,"author": "Ken Cochrane","score": 4045,"isAccepted": true,"bodyMarkdown": "Docker originally used [LinuX Containers](https://linuxcontainers.org/) (LXC)…","url": "https://stackoverflow.com/a/16048358"}],"qualityScore": 92}
Performance
Measured runs:
| Request | Questions | Time |
|---|---|---|
| Keyword search, 30 questions + answers | 30 | ~5 s |
| 100 questions + 3 answers each | 100 | ~10–15 s |
| 10 questions + 5 answers + all comments | 10 | ~7 s |
| 20 questions + linked questions | 20 | ~13 s |
| 500 questions + answers | 500 | ~25 s |
| 1,500 questions without answers | 1,500 | ~10 s |
Pricing
Pay per result: $0.002 per question (or tag in popular tags mode), plus $0.00005 per run start. Answers, comments and linked questions are included in the question price.
| Questions | Price |
|---|---|
| 1,000 | $2.00 |
| 10,000 | $20.00 |
FAQ
Do I need an API key? No. Runs work without one. A free key from stackapps.com only lifts the 2,500-results-per-query limit.
Which answers are included? The accepted answer first, then the highest-voted ones, up to your maximum per question.
Can I get unanswered questions? Yes — turn off only answered; combine with maximum answers to target questions with few answers.
Does it work on other Stack Exchange sites? Yes — choose the site, or paste question URLs from any Stack Exchange site.
Keywords
stackoverflow scraper, stack overflow api, stack exchange scraper, stack overflow answers, programming q&a dataset, ai training data, rag dataset, llm fine-tuning data, developer questions, stack overflow markdown
More actors
Browse all my scrapers on my Apify profile.
Disclaimer
This actor collects only publicly available content through the official Stack Exchange API and is not affiliated with Stack Exchange. Stack Exchange content is licensed under CC BY-SA; you are responsible for attribution and for how you use the data.
Changelog
| Version | Date | Changes |
|---|---|---|
| 1.1 | 2026-10-29 | New: answers in Markdown with votes, the accepted answer always first; comments on questions and answers; question URLs from any Stack Exchange site; plain-text bodies, up/down votes, closed status and bounties; up to 2,500 questions per run. Fixed: results stopped after the first page (~100); minimum score and maximum answers filters now work for every sort order; every answered question now comes with its answers; runs no longer end empty when the daily API limit is reached; HTML entities in titles and names decoded. Faster runs and a summary in the status message. |
| 1.0 | 2026-04-21 | Initial release |