Stack Overflow Questions Scraper - Scores, Tags & Answers
Pricing
from $6.80 / 1,000 results
Stack Overflow Questions Scraper - Scores, Tags & Answers
Scrape Stack Overflow and Stack Exchange questions by keyword with score, view count, answer count, tags, owner and links. Export to JSON, CSV or Excel.
Pricing
from $6.80 / 1,000 results
Rating
0.0
(0)
Developer
Scrapers Lat
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
12 hours ago
Last modified
Categories
Share
Stack Overflow Questions Scraper - Scores, Tags & Answers
Here is one real result, with every field the actor returns (the questionBody, acceptedAnswerBody and answers bodies are trimmed here with ...; live records return them in full):
{"questionId": 50757497,"title": "Simplest async/await example possible in Python","link": "https://stackoverflow.com/questions/50757497/simplest-async-await-example-possible-in-python","score": 303,"viewCount": 440933,"answerCount": 10,"isAnswered": true,"hasAcceptedAnswer": true,"tags": ["python", "python-3.x", "asynchronous", "async-await", "python-asyncio"],"owner": "Basj","ownerReputation": 48042,"ownerLink": "https://stackoverflow.com/users/1422096/basj","creationDate": "2018-06-08T09:28:03.000Z","lastActivityDate": "2025-03-05T07:20:43.000Z","contentLicense": "CC BY-SA 4.0","questionBody": "I've read many examples, blog posts, questions/answers about asyncio / async / await in Python 3.5+...","answers": [{"answerId": 53420574,"isAccepted": true,"score": 336,"body": "To answer your questions, I will provide three different solutions to the same problem...","author": "Levon","authorReputation": 12472,"link": "https://stackoverflow.com/a/53420574","creationDate": "2018-11-21T21:15:51.000Z"}],"acceptedAnswerBody": "To answer your questions, I will provide three different solutions to the same problem...","source": "Stack Exchange","observedAt": "2026-08-10T14:28:25.458Z"}
The most complete Stack Exchange questions scraper available. It returns every field a Stack Overflow (or any Stack Exchange site) question exposes, including score, view count, tags, owner and reputation, plus the full question body and the top answers with text, score and accepted flag, sorted the way you choose.
📥 Input · 📤 Output · 💰 Pricing · ▶️ Examples
Table of contents
- What it does
- Quickstart
- Input reference
- Output reference
- Example output record
- Run via API and CLI
- Fetch results
- Billing and limits
- FAQ and troubleshooting
What it does
The actor searches a Stack Exchange site (Stack Overflow by default) for your keyword, orders the questions the way you choose, and writes one normalized record per question to the run's dataset. Each record carries the question title, link, score, view count, answer count, answered and accepted-answer flags, tags, owner name, reputation and profile link, and the creation and last-activity dates.
With includeAnswers on (the default) the record also carries the full questionBody, the top answers (each with body text, score, author, reputation and accepted flag) and the acceptedAnswerBody. You choose how many answers to include per question with maxAnswersPerQuestion.
Quickstart
Open the actor, paste this into the input, and press Run. It searches Stack Overflow for "python async await" and returns the 10 highest-voted questions with their top answers.
{"searchQuery": "python async await","site": "stackoverflow","sortBy": "votes","maxQuestions": 10,"includeAnswers": true,"maxAnswersPerQuestion": 5}
Change site to any Stack Exchange site (for example serverfault, superuser, askubuntu). Every input has a default, so a run with no input searches Stack Overflow for the prefilled keyword.
Input reference
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
searchQuery | string | no | python async await | Keyword to search questions, for example react hooks, docker compose. |
site | string | no | stackoverflow | Which Stack Exchange site to search, for example stackoverflow, serverfault, superuser, askubuntu. |
sortBy | enum | no | votes | Order questions by votes (highest first), activity (recent), creation (newest) or relevance. |
maxQuestions | integer | no | 10 | Maximum number of questions to collect. Free Apify plans are capped at 10 per run. |
includeAnswers | boolean | no | true | When on, also return the full question body plus the top answers (text, score, accepted flag) for each question. |
maxAnswersPerQuestion | integer | no | 5 | How many top answers to include per question (accepted first, then votes). 0 to 30. |
Output reference
One dataset item per question. Types: string, integer, boolean, string[], object[], or null when the source value is absent. questionBody, answers and acceptedAnswerBody are populated only when includeAnswers is on.
| Field | Type | Description |
|---|---|---|
questionId | integer | Stack Exchange question id. |
title | string | Question title. |
link | string | Public question URL. |
score | integer | Question score (net votes). |
viewCount | integer | Number of views. |
answerCount | integer | Number of answers. |
isAnswered | boolean | Whether the question is marked answered. |
hasAcceptedAnswer | boolean | Whether the question has an accepted answer. |
tags | string[] | Tags applied to the question. |
owner | string | Display name of the asker. |
ownerReputation | integer | Reputation of the asker. |
ownerLink | string | Profile URL of the asker, or null. |
creationDate | string | ISO 8601 date the question was asked. |
lastActivityDate | string | ISO 8601 date of the last activity. |
contentLicense | string | Content license, for example CC BY-SA 4.0. |
questionBody | string | Full question body text (with includeAnswers). |
answers | object[] | Top answers as {answerId, isAccepted, score, body, author, authorReputation, link, creationDate} entries. |
acceptedAnswerBody | string | Body text of the accepted answer, or null. |
source | string | Data source label (Stack Exchange). |
observedAt | string | ISO 8601 timestamp of when the record was collected. |
error | string | Absent on success. On a failed run, a single item with a populated error field is written instead. |
Example output record
Real record from a live run (input {"searchQuery":"python async await","site":"stackoverflow","sortBy":"votes","maxQuestions":10}). The long body fields are trimmed here with ...:
{"questionId": 50757497,"title": "Simplest async/await example possible in Python","link": "https://stackoverflow.com/questions/50757497/simplest-async-await-example-possible-in-python","score": 303,"viewCount": 440933,"answerCount": 10,"isAnswered": true,"hasAcceptedAnswer": true,"tags": ["python", "python-3.x", "asynchronous", "async-await", "python-asyncio"],"owner": "Basj","ownerReputation": 48042,"ownerLink": "https://stackoverflow.com/users/1422096/basj","creationDate": "2018-06-08T09:28:03.000Z","lastActivityDate": "2025-03-05T07:20:43.000Z","contentLicense": "CC BY-SA 4.0","questionBody": "I've read many examples, blog posts, questions/answers about asyncio / async / await in Python 3.5+...","answers": [{ "answerId": 53420574, "isAccepted": true, "score": 336, "author": "Levon", "authorReputation": 12472, "link": "https://stackoverflow.com/a/53420574", "creationDate": "2018-11-21T21:15:51.000Z", "body": "To answer your questions, I will provide three different solutions..." }],"acceptedAnswerBody": "To answer your questions, I will provide three different solutions to the same problem...","source": "Stack Exchange","observedAt": "2026-08-10T14:28:25.458Z"}
Run via API and CLI
Start a run and wait for it to finish, then read the dataset. Replace <TOKEN> with your Apify API token.
Run synchronously and get dataset items in one call:
curl -X POST "https://api.apify.com/v2/acts/scrapers_lat~stackexchange-scraper/run-sync-get-dataset-items?token=<TOKEN>" \-H "Content-Type: application/json" \-d '{"searchQuery":"react hooks","site":"stackoverflow","sortBy":"votes","maxQuestions":25}'
Start a run asynchronously:
curl -X POST "https://api.apify.com/v2/acts/scrapers_lat~stackexchange-scraper/runs?token=<TOKEN>" \-H "Content-Type: application/json" \-d '{"searchQuery":"nginx","site":"serverfault","includeAnswers":true,"maxAnswersPerQuestion":3}'
Apify CLI:
apify call scrapers_lat/stackexchange-scraper \--input '{"searchQuery":"docker compose","maxQuestions":50}'
Fetch results
Every run writes to a dataset. Fetch items as JSON, CSV, or Excel by changing format:
# JSONcurl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=<TOKEN>&clean=true&format=json"# CSVcurl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=<TOKEN>&clean=true&format=csv"# Paginate large datasetscurl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=<TOKEN>&offset=1000&limit=1000"
<DATASET_ID> is returned as defaultDatasetId in the run object. Use offset and limit to page through large result sets. clean=true drops empty and internal fields.
Billing and limits
- Pay per result. You are charged per question returned (
resultevent). See the pricing tab for the current per-result price. - No charge on failure. If a run errors, the actor writes a single item with a populated
errorfield and does not charge for it. Empty runs cost nothing. - Spend cap respected. Set
maxTotalChargeUsdon the run; once reached, the actor stops emitting and charging further billable results. - Free Apify plans are capped at 10 questions per run. Upgrade for higher
maxQuestions.
FAQ and troubleshooting
Can I scrape sites other than Stack Overflow?
Yes. Set site to any Stack Exchange site slug, for example serverfault, superuser, askubuntu, math.
How do I get the highest-quality answers only?
Keep sortBy on votes, keep includeAnswers on, and lower maxAnswersPerQuestion. Answers are sorted accepted-first, then by votes.
Can I make results lighter?
Turn includeAnswers off to skip the question body and answers. You still get score, tags, owner and metadata.
What content license applies?
Stack Exchange content is Creative Commons. The exact license is returned in contentLicense. Attribute per Stack Exchange terms when you reuse it.
Is this an official Stack Exchange tool? No. This actor is independent and has no affiliation with Stack Exchange. It reads only publicly available question and answer data. Use the results in accordance with the source's terms.
Related scrapers
- GitHub Repositories Scraper: Repositories, stars and metadata from GitHub.
- Hacker News Scraper: Stories, points and comments from Hacker News.
- crates.io Scraper: Rust crates and metadata from crates.io.
- Docker Hub Images Scraper: Docker images, stars and pulls from Docker Hub.
- Hugging Face Models Scraper: Models and metadata from Hugging Face.
More scrapers at scrapers.lat
Built and maintained by scrapers.lat, where we publish scrapers for public platforms: company registries, government data, finance, e-commerce and more. Browse the catalog or request a custom scraper at scrapers.lat.
Independent tool, not affiliated with Stack Exchange. Accesses only publicly available question and answer data. Use the results in accordance with the source's terms.
