# Stack Exchange Question & Tag Tracker (`gochujang/stack-exchange-tracker`) Actor

Track trending questions, tag activity, and keyword search across Stack Overflow and 170+ Stack Exchange sites. Filter by tags, sort by votes/activity/hot/week/month, and optionally include top answers. Ideal for developer trend analysis and tech popularity tracking.

- **URL**: https://apify.com/gochujang/stack-exchange-tracker.md
- **Developed by:** [Hojun Lee](https://apify.com/gochujang) (community)
- **Categories:** Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Stack Exchange Question & Tag Tracker

Track trending questions, tag popularity, and full-text search results across **Stack Overflow** and **170+ Stack Exchange network sites** (Server Fault, Super User, Ask Ubuntu, Math, Physics, and more).

Use this Actor to monitor developer trends, measure technology popularity, research technical topics, or build datasets for tech landscape analysis.

***

### Features

- **3 modes**: questions by tag, popular/matching tags, full-text keyword search
- **5 sort options**: hot (trending now), week, month, top voted, recent activity
- **Optional top answers**: fetch the highest-voted answers for each question
- **Pagination**: automatically fetches multiple pages until your `maxResults` limit
- **Backoff-aware**: respects SE API throttling signals (`backoff_seconds`)
- **No API key required** — works out of the box (300 req/day free; 10,000/day with a free API key)

***

### Input

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `mode` | string | `questions` | `questions`, `tags`, or `search` |
| `site` | string | `stackoverflow` | SE site slug (e.g. `serverfault`, `superuser`, `askubuntu`) |
| `tags` | array | `[]` | Tags to filter by in questions mode (AND logic) |
| `searchQuery` | string | `""` | Full-text query for search mode |
| `tagQuery` | string | `""` | Partial tag name filter for tags mode |
| `sortBy` | string | `week` | `activity`, `votes`, `hot`, `week`, `month`, `creation` |
| `maxResults` | integer | `50` | Max items to return (1–500) |
| `includeAnswers` | boolean | `false` | Fetch top answers per question (uses extra quota) |
| `maxAnswersPerQuestion` | integer | `3` | How many top answers to include (1–10) |
| `apiKey` | string | `""` | Optional SE API key for 10,000 req/day quota |

#### Example: Trending Python questions this week

```json
{
  "mode": "questions",
  "site": "stackoverflow",
  "tags": ["python"],
  "sortBy": "week",
  "maxResults": 100,
  "includeAnswers": false
}
```

#### Example: Hot questions across sites

```json
{
  "mode": "questions",
  "site": "stackoverflow",
  "tags": [],
  "sortBy": "hot",
  "maxResults": 50
}
```

#### Example: Search for LLM-related questions with answers

```json
{
  "mode": "search",
  "site": "stackoverflow",
  "searchQuery": "LLM fine-tuning memory error",
  "sortBy": "votes",
  "maxResults": 30,
  "includeAnswers": true,
  "maxAnswersPerQuestion": 3
}
```

#### Example: Most popular tags on Ask Ubuntu

```json
{
  "mode": "tags",
  "site": "askubuntu",
  "tagQuery": "network",
  "maxResults": 50
}
```

***

### Output

Each record in the dataset represents one **question** (questions/search mode) or **tag** (tags mode).

#### Question record

```json
{
  "question_id": 75941432,
  "title": "How to use asyncio.gather with error handling?",
  "body_preview": "I have a list of coroutines and want to run them concurrently…",
  "tags": ["python", "asyncio"],
  "score": 87,
  "view_count": 12543,
  "answer_count": 4,
  "is_answered": true,
  "accepted_answer_id": 75941899,
  "owner_name": "dev_user",
  "owner_reputation": 3200,
  "created_at": "2023-04-01T14:22:00+00:00",
  "last_activity_at": "2024-01-15T09:10:00+00:00",
  "link": "https://stackoverflow.com/q/75941432",
  "site": "stackoverflow",
  "top_answers": [
    {
      "answer_id": 75941899,
      "score": 112,
      "is_accepted": true,
      "body_preview": "Use return_exceptions=True to prevent one failure from…"
    }
  ]
}
```

#### Tag record

```json
{
  "name": "python",
  "count": 2184321,
  "is_required": false,
  "is_moderator_only": false,
  "has_synonyms": true,
  "site": "stackoverflow"
}
```

***

### Pricing

| Event | Price |
|-------|-------|
| Actor start | $0.005 (once) |
| Per question fetched | $0.002 |

Fetching 100 questions costs ~$0.205. Tags mode charges only the actor-start fee.

***

### API Quota & Rate Limits

Stack Exchange allows **300 requests/day** without authentication and **10,000 requests/day** with a free API key.

Each page fetch counts as 1 request. With `includeAnswers=true`, each question adds 1 more request.

Register a free key at [stackapps.com](https://stackapps.com/apps/oauth/register).

***

### Supported Sites

Any site in the Stack Exchange network works as the `site` parameter:

| Slug | Site |
|------|------|
| `stackoverflow` | Stack Overflow |
| `serverfault` | Server Fault |
| `superuser` | Super User |
| `askubuntu` | Ask Ubuntu |
| `math` | Mathematics |
| `physics` | Physics |
| `unix` | Unix & Linux |
| `gamedev` | Game Development |
| `datascience` | Data Science |
| `ai` | Artificial Intelligence |

See the full list at [stackexchange.com/sites](https://stackexchange.com/sites).

***

### Use Cases

- **Tech trend monitoring** — track which tags and questions are trending weekly
- **Competitor/library research** — find pain points developers have with specific tools
- **Content strategy** — discover unanswered or highly-viewed questions for blog topics
- **Dataset building** — create labeled Q\&A datasets for ML training
- **Community health metrics** — measure activity and engagement on SE communities

***

### Technical Details

- Python 3.12, `httpx` async HTTP client
- `asyncio.Semaphore(3)` for polite concurrency
- Automatic pagination via `has_more` response field
- Exponential backoff on transient failures (up to 3 retries)
- Body HTML stripped to plain text preview (first 500 chars)

***

### Related actors

- [Hacker News Scraper](https://apify.com/gochujang/hacker-news-scraper) — HN tech discussions alongside Stack Exchange Q\&A for developer community insights
- [GitHub Issues Tracker](https://apify.com/gochujang/github-issues-tracker) — GitHub issue tracking to complement Stack Overflow question trends
- [Semantic Scholar Papers](https://apify.com/gochujang/semantic-scholar-papers) — Academic papers behind the technical questions trending on Stack Exchange

### Feedback

If this actor powers your developer community research, a review helps others find it: [Leave a review on Apify Store](https://apify.com/gochujang/stack-exchange-tracker#reviews)

# Actor input Schema

## `mode` (type: `string`):

Operation mode: 'questions' fetches questions (filtered by tags), 'tags' fetches popular/matching tags, 'search' performs a full-text search.

## `site` (type: `string`):

Stack Exchange site to query. Examples: stackoverflow, serverfault, superuser, askubuntu, math, physics, unix, webmasters, gamedev.

## `tags` (type: `array`):

Filter questions by these tags (AND logic — all tags must match). Leave empty to fetch across all tags.

## `searchQuery` (type: `string`):

Full-text search query. Used in 'search' mode. Example: 'async await python error'.

## `tagQuery` (type: `string`):

Filter tags whose name contains this string (used in 'tags' mode). Leave empty to get the most popular tags.

## `sortBy` (type: `string`):

How to sort questions. 'hot' = currently trending, 'week'/'month' = top of the week/month, 'votes' = all-time highest voted, 'activity' = recently active.

## `maxResults` (type: `integer`):

Maximum number of questions or tags to return (1–500).

## `includeAnswers` (type: `boolean`):

If enabled, fetches the top answers for each question (uses additional API quota).

## `maxAnswersPerQuestion` (type: `integer`):

Number of top answers to include per question (only applies when 'Include Top Answers' is enabled).

## `apiKey` (type: `string`):

Optional API key for higher request quota (10,000/day vs 300/day without key). Get a free key at https://stackapps.com/apps/oauth/register.

## Actor input object example

```json
{
  "mode": "questions",
  "site": "stackoverflow",
  "tags": [],
  "searchQuery": "",
  "tagQuery": "",
  "sortBy": "week",
  "maxResults": 50,
  "includeAnswers": false,
  "maxAnswersPerQuestion": 3,
  "apiKey": ""
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("gochujang/stack-exchange-tracker").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("gochujang/stack-exchange-tracker").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call gochujang/stack-exchange-tracker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,gochujang/stack-exchange-tracker"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/W8HibZu5i6GxPZYGN/builds/ocdu0ghkfENjkYwqy/openapi.json
