Stack Overflow Questions Scraper - Scores, Tags & Answers avatar

Stack Overflow Questions Scraper - Scores, Tags & Answers

Pricing

from $6.80 / 1,000 results

Go to Apify Store
Stack Overflow Questions Scraper - Scores, Tags & Answers

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

Scrapers Lat

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

12 hours ago

Last modified

Share

Stack Overflow Questions Scraper - Scores, Tags & Answers

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

Apify Coverage Output Billing

Table of contents

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

FieldTypeRequiredDefaultDescription
searchQuerystringnopython async awaitKeyword to search questions, for example react hooks, docker compose.
sitestringnostackoverflowWhich Stack Exchange site to search, for example stackoverflow, serverfault, superuser, askubuntu.
sortByenumnovotesOrder questions by votes (highest first), activity (recent), creation (newest) or relevance.
maxQuestionsintegerno10Maximum number of questions to collect. Free Apify plans are capped at 10 per run.
includeAnswersbooleannotrueWhen on, also return the full question body plus the top answers (text, score, accepted flag) for each question.
maxAnswersPerQuestionintegerno5How 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.

FieldTypeDescription
questionIdintegerStack Exchange question id.
titlestringQuestion title.
linkstringPublic question URL.
scoreintegerQuestion score (net votes).
viewCountintegerNumber of views.
answerCountintegerNumber of answers.
isAnsweredbooleanWhether the question is marked answered.
hasAcceptedAnswerbooleanWhether the question has an accepted answer.
tagsstring[]Tags applied to the question.
ownerstringDisplay name of the asker.
ownerReputationintegerReputation of the asker.
ownerLinkstringProfile URL of the asker, or null.
creationDatestringISO 8601 date the question was asked.
lastActivityDatestringISO 8601 date of the last activity.
contentLicensestringContent license, for example CC BY-SA 4.0.
questionBodystringFull question body text (with includeAnswers).
answersobject[]Top answers as {answerId, isAccepted, score, body, author, authorReputation, link, creationDate} entries.
acceptedAnswerBodystringBody text of the accepted answer, or null.
sourcestringData source label (Stack Exchange).
observedAtstringISO 8601 timestamp of when the record was collected.
errorstringAbsent 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:

# JSON
curl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=<TOKEN>&clean=true&format=json"
# CSV
curl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=<TOKEN>&clean=true&format=csv"
# Paginate large datasets
curl "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 (result event). 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 error field and does not charge for it. Empty runs cost nothing.
  • Spend cap respected. Set maxTotalChargeUsd on 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.

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.