Stack Overflow Scraper — Questions, Answers & Tags for RAG
Pricing
Pay per usage
Stack Overflow Scraper — Questions, Answers & Tags for RAG
Fetch Stack Overflow questions, answers, and comments as clean structured data with markdown formatting. Search by keyword, explore tags, or get full question threads. MCP-enabled for Claude, Cursor, and AI agents.
Pricing
Pay per usage
Rating
0.0
(0)
Developer
Aaron Hampton
Maintained by CommunityActor stats
0
Bookmarked
1
Total users
0
Monthly active users
2 days ago
Last modified
Categories
Share
Fetch Stack Overflow questions, answers, and comments as clean structured data with markdown-formatted bodies. Search by keyword, explore top questions for a tag, or get full question threads with accepted answers.
Perfect for RAG pipelines, developer research, AI agents, and technical Q&A datasets.
Features
- Keyword search — search all Stack Overflow questions by keyword and tags
- Full question threads — get questions with bodies, answers, and comments in clean markdown
- Tag exploration — fetch top-voted questions for any tag (python, javascript, react, etc.)
- User profiles — fetch user reputation, badges, and top questions
- Clean markdown — all HTML bodies converted to readable markdown (code blocks, lists, links, images, tables, blockquotes)
- Answer ordering — sorted by score with accepted answers first
- Dual-mode — run as a normal Apify Actor OR connect as an MCP server for Claude, Cursor, and other AI agents
- No browser required — uses the free Stack Exchange API, no proxies or auth needed
Use Cases
- RAG pipelines — feed Stack Overflow Q&A into vector databases for code-aware AI assistants
- Developer research — find canonical answers to programming questions across technologies
- AI agents — let Claude/Cursor search Stack Overflow via MCP tools
- Documentation — collect top answers for a tag to build curated knowledge bases
- Trend analysis — track popular topics and technologies by tag and score
Input (Normal Actor Mode)
| Field | Type | Description |
|---|---|---|
mode | enum | search, question, tag, or user |
query | string | Search keyword (mode=search) |
questionId | integer | Stack Overflow question ID (mode=question) |
tag | string | Tag name like "python" (mode=tag) |
userId | integer | Stack Overflow user ID (mode=user) |
tags | array | Filter search by tags (mode=search) |
acceptedOnly | boolean | Only questions with accepted answers (mode=search) |
maxQuestions | integer | Max questions to return (default 10) |
includeAnswers | boolean | Fetch answers for each question (default true) |
includeComments | boolean | Fetch comments on questions (default false) |
maxAnswersPerQuestion | integer | Max answers per question (default 5) |
sortBy | enum | relevance, votes, or newest (default relevance) |
Output
{"id": 393272,"title": "How to reverse a list in Python","url": "https://stackoverflow.com/questions/393272/...","score": 2534,"viewCount": 1200000,"answerCount": 15,"tags": ["python", "list", "reverse"],"isAnswered": true,"acceptedAnswerId": 393280,"createdAt": "2010-10-13T10:00:00.000Z","bodyMarkdown": "I want to reverse a list:\n```python\nmy_list = [1, 2, 3]\n```","answers": [{"id": 393280,"score": 1800,"isAccepted": true,"createdAt": "2010-10-13T10:05:00.000Z","bodyMarkdown": "Use slicing:\n```python\nreversed_list = my_list[::-1]\n```"}]}
MCP Tools
When connected as an MCP server, the following tools are available:
| Tool | Description |
|---|---|
search_questions | Search Stack Overflow by keyword. Returns titles, scores, tags, and optionally answers. |
get_question | Fetch a full question with markdown body, answers (sorted accepted-first), and optional comments. |
get_top_answers | Get top-voted questions for a tag with their best answers. Great for discovering canonical Q&A. |
Pricing
Pay-per-event. First results are free; subsequent events billed at:
| Event | Price |
|---|---|
| Question fetched | $0.002 |
| Answer fetched | $0.001 |
| MCP tool call | $0.005 |
| Actor start | $0.00005 |
Volume discounts available at higher tiers.
Data Source
This Actor uses the Stack Exchange API — a free, public API with generous rate limits (300 requests/2min without a key, 10,000/2min with a key). No authentication or proxies required.