# Get top voted Stack Overflow questions and answers by tag

**Use case:** 

Collects the highest voted Stack Overflow questions in a tag together with their accepted answer, through the official Stack Exchange API. Great for finding the problems people hit most with a library, planning docs, FAQs and tutorials. Every row carries the link, author, license and a ready attribution line for CC BY-SA reuse.

## Input

```json
{
  "mode": "tags",
  "site": "stackoverflow",
  "tags": [
    "pandas"
  ],
  "tagMatch": "any",
  "sort": "votes",
  "maxQuestionsPerQuery": 15,
  "includeAnswers": true,
  "maxAnswersPerQuestion": 1,
  "includeComments": false,
  "outputMode": "nested",
  "acceptedAnswer": "yes",
  "closedStatus": "any",
  "maxQuestions": 0,
  "maxPagesPerQuery": 10,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

## Output

```json
{
  "siteName": {
    "label": "Site",
    "format": "text"
  },
  "questionId": {
    "label": "ID",
    "format": "number"
  },
  "title": {
    "label": "Title",
    "format": "text"
  },
  "link": {
    "label": "Link",
    "format": "link"
  },
  "tags": {
    "label": "Tags",
    "format": "array"
  },
  "score": {
    "label": "Score",
    "format": "number"
  },
  "viewCount": {
    "label": "Views",
    "format": "number"
  },
  "answerCount": {
    "label": "Answers",
    "format": "number"
  },
  "isAnswered": {
    "label": "Answered",
    "format": "boolean"
  },
  "acceptedAnswerId": {
    "label": "Accepted answer",
    "format": "number"
  },
  "owner.displayName": {
    "label": "Author",
    "format": "text"
  },
  "owner.reputation": {
    "label": "Reputation",
    "format": "number"
  },
  "creationDate": {
    "label": "Asked",
    "format": "date"
  },
  "lastActivityDate": {
    "label": "Last activity",
    "format": "date"
  },
  "bodyText": {
    "label": "Body (text)",
    "format": "text"
  },
  "answersIncluded": {
    "label": "Answers included",
    "format": "number"
  },
  "contentLicense": {
    "label": "License",
    "format": "text"
  },
  "query": {
    "label": "Query",
    "format": "text"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The Stack Overflow Scraper: Questions, Answers and Comments Actor is ready to run with the inputs already set for "Get top voted Stack Overflow questions and answers by tag". [Sign up or log in](https://console.apify.com/create-task-from-example/adKL0arFDRXM1EhT7) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Get top voted Stack Overflow questions and answers by tag" task

The Stack Overflow Scraper: Questions, Answers and Comments Actor will start running based on the input automatically. You can also change all the input fields, like what to scrape, site, and more, to match your specific use case.

### 3. Receive the "Get top voted Stack Overflow questions and answers by tag" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as site, ID, title, and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "Get top voted Stack Overflow questions and answers by tag" task via API](https://apify.com/zhtech/stack-overflow-scraper.md).

## FAQ

### What does the top Stack Overflow questions and answers task return?

The top Stack Overflow questions and answers task returns one row per question with title, link, score, views, tags and text, and the accepted answer nested inside with its score, author and text.

### Can I reuse the text from the top Stack Overflow questions and answers task?

Stack Overflow content is licensed CC BY-SA, so the top Stack Overflow questions and answers task adds the link, author and license to every row. Keep that attribution and read Stack Exchange's Acceptable Use Policy first.

### Can I run the top Stack Overflow questions and answers task on a schedule or through the API?

Save the top Stack Overflow questions and answers task to your Apify account, then add it to an Apify Schedule (for example daily) or start it from the Apify API, webhooks, Zapier, Make, n8n or the Apify MCP server for AI agents.

### How much does the top Stack Overflow questions and answers task cost?

The top Stack Overflow questions and answers task is pay per event: a small start fee per run plus a fee per question and answer saved. Error rows, filtered questions and duplicates are free. Prices are on the Pricing tab.

## About this Actor

This example demonstrates how to use [Stack Overflow Scraper: Questions, Answers and Comments](https://apify.com/zhtech/stack-overflow-scraper.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/zhtech/stack-overflow-scraper.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/zhtech/stack-overflow-scraper.md

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).
