Stack Overflow Q&A Scraper avatar

Stack Overflow Q&A Scraper

Pricing

from $2.00 / 1,000 results

Go to Apify Store
Stack Overflow Q&A Scraper

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

Sheshinmcfly

Maintained by Community

Actor stats

1

Bookmarked

7

Total users

1

Monthly active users

10 hours ago

Last modified

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 threadsEach question with its accepted answer and top answers — none left out
📝 Markdown + plain textBodies as HTML, Markdown and plain text, ready for LLMs
💬 CommentsComments on questions and answers (optional)
🔎 Filters that workMinimum score, maximum answers, dates, answered only
🔗 Question URLsPull specific questions from any Stack Exchange site

Data you get

Per question

FieldDescription
questionId / site / urlIdentity
title / body / bodyMarkdown / bodyTextQuestion as HTML, Markdown and plain text
tagsTags
score / upVotes / downVotes / favoriteCount / viewCountEngagement
answerCount / commentCount / isAnswered / acceptedAnswerIdDiscussion
isClosed / closedReason / closedDateClosed status
bountyAmount / bountyClosesDateOpen bounty
author / authorReputation / authorIdAsker
createdAt / lastEditDate / lastActivityDate / protectedDate / contentLicenseDates and license
answersAccepted answer first, then the highest voted (see below)
commentsComments on the question (optional)
linkedQuestionsQuestions linked to this one (optional)
qualityScore / frustrationScore / discussionDepth0–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

  1. Pick a mode: by tags, keyword search, top questions, popular tags — or paste question URLs.
  2. Choose the site (Stack Overflow, Super User, Mathematics, Cross Validated…) and the sort order.
  3. Narrow it down with dates, minimum score, maximum answers and only answered.
  4. Choose how many answers per question, and turn on comments or linked questions if you need them.
  5. 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

FieldTypeDescription
modeselecttags, search, top, popularTags or questions
tagsarrayTags to filter by (tags mode)
keywordsstringSearch text (search mode)
questionUrlsarrayQuestion URLs or IDs, any Stack Exchange site
siteselectStack Exchange site
sortByselectVotes, activity, newest, hot, week, month (search also: relevance)
onlyAnsweredbooleanOnly questions with an accepted or upvoted answer (default true)
minScoreintegerMinimum question score
maxAnswersintegerMaximum number of answers a question can have (0 = no limit)
fromDate / toDatedateCreation date range
includeAnswersbooleanAnswers per question (default true)
maxAnswersPerQuestionintegerAccepted first, then highest voted (default 3)
includeCommentsbooleanComments on questions and answers
includeLinkedbooleanLinked questions
maxResultsintegerMax questions (or tags) — up to 2,500 per run
apiKeystringOptional 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:

RequestQuestionsTime
Keyword search, 30 questions + answers30~5 s
100 questions + 3 answers each100~10–15 s
10 questions + 5 answers + all comments10~7 s
20 questions + linked questions20~13 s
500 questions + answers500~25 s
1,500 questions without answers1,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.

QuestionsPrice
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

VersionDateChanges
1.12026-10-29New: 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.02026-04-21Initial release