# Stack Overflow Tag Monitor (`thescrapelab/stack-overflow-tag-monitor`) Actor

Collect new Stack Overflow comments by product tag, including comments on old answers, with question context, attribution and licences.

- **URL**: https://apify.com/thescrapelab/stack-overflow-tag-monitor.md
- **Developed by:** [Inus Grobler](https://apify.com/thescrapelab) (community)
- **Categories:** Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.01 / completed coverage segment

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

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 examples already wired to this Actor's own input schema, see the [API](#api) section below.

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`).

# README

## Stack Overflow Tag Monitor

Collect new Stack Overflow comments for your product tags, including comments on old questions and answers. Developer support and community teams can follow active conversations without reopening old threads by hand.

Stack Overflow / Stack Exchange Network is the source of all comment content. This independent Actor uses the official Stack Exchange API and is not affiliated with Stack Exchange.

### Quick start

1. Enter one to ten exact question tags, such as `firebase` or `google-cloud-run`.
2. Choose the maximum number of new comments to return.
3. Run the Actor and export the dataset as JSON, CSV or Excel.

```json
{"tags":["firebase","google-cloud-run"],"maxComments":100}
```

Tags match with OR semantics. A comment matching multiple requested tags appears once. Answer comments inherit their parent question's tags, including when the answer is old.

### Inputs

| Input | Default | Meaning |
|---|---|---|
| Product tags (`tags`) | `python`, `javascript`, `java` | One to ten exact Stack Overflow question tags |
| Maximum comments (`maxComments`) | 100 | Maximum new comments in this paid coverage segment; range 1–1,000 |
| Start date (`fromDate`) | Approximately the preceding 24 hours | Optional initial UTC timestamp within the past 24 hours and at least two minutes ago |
| Monitor name (`monitorKey`, advanced) | Your normalized tags | Optional separate monitor identifier |

The start date applies only to a new monitor. Later runs resume saved progress even if a saved task retains an older initial date. Changing tags starts a separate monitor unless you explicitly reuse a monitor name; use a new name when changing a named monitor's tags.

### Output

Each row is one original comment. The dataset contains:

| Fields | Meaning |
|---|---|
| `commentId`, `createdAt`, `bodyMarkdown` | Stable ID, UTC creation date and original Markdown |
| `parentType`, `parentId` | Whether the comment belongs to a question or answer, and that post's ID |
| `questionId`, `questionTitle`, `tags`, `matchedTags` | Parent question context and matching tags |
| `sourceUrl`, `questionUrl` | Direct comment and question links |
| `author`, `authorUrl`, `attribution` | Public author identity and source attribution; deleted authors may have no profile URL |
| `contentLicense`, `licenseUrl` | Licence reported by the source API and its link |
| `collectedAt` | UTC collection timestamp |

Actual source metadata example:

```json
{
  "commentId": 141209942,
  "createdAt": "2026-11-16T06:16:53.000Z",
  "parentType": "answer",
  "parentId": 80016898,
  "questionId": 80016876,
  "questionTitle": "How to efficiently find all files that match a given glob pattern in Java?",
  "sourceUrl": "https://stackoverflow.com/questions/80016876/how-to-efficiently-find-all-files-that-match-a-given-glob-pattern-in-java/80016898#comment141209942_80016898",
  "contentLicense": "CC BY-SA 4.0",
  "licenseUrl": "https://creativecommons.org/licenses/by-sa/4.0/"
}
```

The complete record also contains the original comment text, author, tags and collection timestamp. The separate coverage receipt explains completed or partial coverage and references the segment's datasets. Quiet windows return an empty dataset and a useful receipt.

### Pricing

**USD 0.01 per completed coverage segment**, including its comment rows. A result-limited segment delivering new comments costs one event; continuing to the next segment is a separate paid check. A completed quiet window also costs one event. Failed scans have no completed-check event. Immediate repeats of a fully completed window have no additional event; reading a saved dataset is free of Actor event charges.

For one monitor, hourly completed checks cost USD 7.20 per 30 days; checks every 15 minutes cost USD 28.80 per 30 days, before extra result-limited continuation segments. This is check pricing, not per-comment pricing. No Actor startup or dataset-row surcharge is configured.

Use a positive maximum charge below USD 0.01 to block new checks. Apify treated a literal zero API limit as unspecified in testing; do not use zero as a no-charge guarantee.

### Python API example

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("TheScrapeLab/stack-overflow-tag-monitor").call(
    run_input={"tags": ["firebase"], "maxComments": 100}
)
for comment in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(comment)
```

### Practical use cases

- Monitor current product-support discussions across older threads.
- Route new comments into a team's existing support workflow.
- Export attributed source comments for human review and community research.

### Limitations and recovery

The official API has shared quotas, caching and backoff. Coverage uses fixed 15-minute boundaries with at least a two-minute safety delay; no uninterrupted or 15-minute delivery SLA is promised. Each window is at most 24 hours. Long gaps advance through successive bounded checks. Initial historical backfill beyond 24 hours is unsupported.

Interrupted windows resume from saved progress. Comments written just before a crash remain in the original dataset and are not written again. A recovery run can charge the completed segment even if it writes zero new rows; the receipt lists the relevant datasets. Uncertain charge outcomes stop for reconciliation rather than risk duplicate billing. Runs for the same calling account are serialized; other callers have separate state.

This is a new-comment feed, not an edit/deletion changefeed. Deleted or unavailable source comments cannot be recovered. Retagging, comments arriving late outside the recorded window and complete edit/deletion tracking are not guaranteed. Deleted parents or missing required source fields fail the window clearly instead of claiming complete coverage.

No live 1,000-comment capacity claim is made: the tested bounded window contained fewer matching comments. Sparse vendor tags may produce many paid quiet checks. No paid API key, proxy or account login is required for ordinary use.

### Attribution and permitted use

Preserve author attribution, Stack Overflow source links and the applicable content licence when redistributing comments. Review [Stack Exchange API terms](https://stackoverflow.com/legal/api-terms-of-use), [acceptable-use policy](https://stackoverflow.com/legal/acceptable-use-policy) and [content licensing](https://stackoverflow.com/help/licensing). Use this Actor for developer support and human community monitoring. It is not offered for generative-AI training, building a competing content service, spam or unrestricted bulk harvesting.

### FAQ

**Will I get new comments on old answers?** Yes, when the answer's parent question carries a requested tag and the comment falls in the API window.

**Why did a run return no rows?** The window may have no matching new comments, or the monitor may already have completed it. The coverage receipt distinguishes those outcomes.

**Can I schedule monitoring?** You can create an Apify schedule. Choose a frequency appropriate to the tag volume and published check price.

**Does rerunning duplicate the comments?** Saved monitors suppress previously delivered comment IDs. An independent monitor intentionally has its own delivery history.

# Actor input Schema

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

One to ten exact question tags. Any tag may match.

## `fromDate` (type: `string`):

Optional initial UTC timestamp within the preceding24hours. Once a monitor has state, its saved continuation/cursor takes precedence; this initial date is ignored.

## `maxComments` (type: `integer`):

Maximum new comments per paid coverage segment. Continuing with another segment is a separate paid check.

## `monitorKey` (type: `string`):

Optional independent monitor identifier.

## Actor input object example

```json
{
  "tags": [
    "python",
    "javascript",
    "java"
  ],
  "maxComments": 100
}
```

# Actor output Schema

## `comments` (type: `string`):

No description

## `receipt` (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 = {
    "tags": [
        "python",
        "javascript",
        "java"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("thescrapelab/stack-overflow-tag-monitor").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 = { "tags": [
        "python",
        "javascript",
        "java",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("thescrapelab/stack-overflow-tag-monitor").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 '{
  "tags": [
    "python",
    "javascript",
    "java"
  ]
}' |
apify call thescrapelab/stack-overflow-tag-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,thescrapelab/stack-overflow-tag-monitor"
        }
    }
}
```

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/rDzQ1NgwDhiREMh7s/builds/1xo4kPFvSU18fz4Qh/openapi.json
