# Wikipedia Topic Attention Monitor (`maydit/wikipedia-topic-attention-monitor`) Actor

Compare two seven-day Wikipedia pageview windows for exact article titles. Export fourteen dated observations, totals, changes and evidence URLs. Pageviews are not unique readers or sentiment.

- **URL**: https://apify.com/maydit/wikipedia-topic-attention-monitor.md
- **Developed by:** [Brandt May](https://apify.com/maydit) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.60 / 1,000 saved article observations

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## Wikipedia Topic Attention Monitor

**See how attention to an exact Wikipedia article changed between two weeks.** Enter one to ten titles or article URLs. Each saved row includes fourteen dated observations, two seven-day totals, an arithmetic change and the official evidence URL. No API key, browser or paid data service is required.

### Try a small watchlist

```json
{"articles":["OpenAI","YouTube","TikTok"],"maxResults":3}
```

Omitted or empty articles use the same three titles on `en.wikipedia.org`. The default end date is three days before today in UTC, allowing time for data publication. An explicit `endDate` fixes the comparison; otherwise the windows roll each day. The dataset and **Run report** show the actual boundaries. `maxResults` defaults to ten, while the default watchlist contains three articles.

### What the comparison means

Both windows contain exactly seven UTC dates. The current window ends on `endDate`; the prior window ends one day before the current window starts. `viewChange` is current total minus prior total. `percentChange` is `100 * viewChange / priorViews` only when both windows are complete and the prior total is above zero. A zero prior total leaves the percentage null. A negative change is valid.

The source classification is fixed to `agent=user`, `access=all-access` and `granularity=daily`. These are Wikimedia's classifications of page requests. **Pageviews are not unique people, search volume, purchasing intent, sales or a causal explanation of a news event.** Human traffic classification is heuristic and does not guarantee every request came from a person.

Article spelling and case remain exact; spaces are represented as underscores. An article URL must use the selected project and the `/wiki/` path. Its fragment is ignored. Requests go only to `wikimedia.org`; the Actor does not visit the article or follow API redirects. Wikipedia redirects, moves, alternate spellings and language editions are not merged. A missing or mismatched title is a source error, not a zero-attention result.

### Output fields

| Fields | Meaning |
| --- | --- |
| `articleId`, `article`, `project`, `articleUrl` | Stable project/title identity and public article link. |
| `dailySeries` | Fourteen UTC dates with integer views or null for an absent date, plus `available`. |
| `currentWindow`, `priorWindow` | Inclusive dates, expected and observed day counts, missing dates, complete total and observed partial sum. |
| `currentViews`, `priorViews` | Complete seven-day totals; null when that window has missing dates. |
| `viewChange`, `percentChange`, `percentChangeBasis` | Deterministic adjacent-week calculation and why a percentage may be unavailable. |
| `coverageComplete`, `missingDates` | Whether every requested day was returned. An absent day is never filled with zero. |
| `observedAt`, `sourceUrl`, `sourceName`, `dataLicense` | Collection time, exact API request and attribution. |
| `comparisonStatus`, `changedFields`, `previous`, `contentHash` | Optional comparison with the last saved observation. |

A response with some observed dates may produce a useful partial row. Its incomplete window totals and percentage remain null, the run is marked partial, and it does not replace saved history. An empty, invalid, wrong-identity or refused response produces diagnostics in SUMMARY and the report, with no fabricated dataset row. If all sources fail, the run fails. A legitimate unchanged history repeat can succeed with zero rows.

### Saved observation history

The adjacent-week calculation is available on the first run. `comparePrevious` additionally compares the current observation with the last complete row saved for this article in the same history scope. `onlyChanges` enables comparison and skips unchanged observations. The first history run establishes a baseline only after rows are confirmed saved.

Use the same `snapshotName`, project, article list and date mode. An explicit fixed end date creates a separate scope; rolling mode keeps one scope as its boundaries advance. Changed rolling boundaries count as a changed observation. Use one writer per history scope: the store checks for a changed baseline before committing but does not provide an atomic cross-run lock. Missing articles never imply deletion. Failed writes, incomplete windows and rejected charge-limit rows never advance history.

### Three examples

#### OpenAI

```json
{"articles":["OpenAI"],"maxResults":1}
```

#### Exact article URL

```json
{"articles":["https://en.wikipedia.org/wiki/YouTube"],"maxResults":1}
```

#### Explicit project

```json
{"articles":["TikTok"],"project":"en.wikipedia.org","maxResults":1}
```

To examine source revisions for a fixed historical window, add `endDate`, `comparePrevious: true` and a stable `snapshotName`; add `onlyChanges: true` for later polls.

### Limits and pricing

Base pricing is **$0.001 per saved article observation**, including its daily series, plus **$0.00005 per run start**. Reports, diagnostics and skipped unchanged observations create no dataset rows. Apify platform charges can still apply. Review actual pricing before use.

At most ten articles and ten saved rows are permitted. Requests are sequential, limited to 256 KiB and fifteen seconds each, with one short retry only for HTTP 502/503/504 when time remains. There is no fallback after refusal, authentication, proxy routing or redirect following. The own deadline defaults to 120 seconds and is shortened by the platform deadline minus 25 seconds; collection reserves another five seconds for output. Cloud storage requests have a five-second timeout and no automatic retry. Result, charge or deadline limits leave explicit unreached-source diagnostics.

### Source and attribution

Data: [Wikimedia Analytics API](https://doc.wikimedia.org/generated-data-platform/aqs/analytics-api/), available under [CC0 and the API access policy](https://doc.wikimedia.org/generated-data-platform/aqs/analytics-api/documentation/access-policy.html). The Actor identifies itself with a contact User-Agent and uses sequential requests. See [pageview definitions](https://doc.wikimedia.org/generated-data-platform/aqs/analytics-api/concepts/page-views.html) and [the official comparison tutorial](https://doc.wikimedia.org/generated-data-platform/aqs/analytics-api/tutorials/compare-page-metrics.html).

This Actor is provided by Mayd It and is not affiliated with Wikimedia. Report a source change or question through the Actor Issues tab or **bmay@mayd-it.com**, including the run ID and article URL. Do not send credentials. No claim of comprehensive audience coverage, source uptime or customer demand is made.

# Actor input Schema

## `articles` (type: `array`):

1-10 exact titles or HTTPS article URLs on the selected project. Omitted or empty uses OpenAI, YouTube and TikTok. Spaces become underscores; spelling and title case remain exact. URL fragments are ignored. Redirects, page moves and alternate titles are not merged.

## `project` (type: `string`):

One explicit Wikipedia hostname for all articles, for example en.wikipedia.org or de.wikipedia.org. URLs must match it. Only the fixed Wikimedia Analytics API host is contacted.

## `endDate` (type: `string`):

Optional YYYY-MM-DD, inclusive. Omitted uses three days before today in UTC to allow publication delay. Must precede today and leave a full 14-day range since 2015-07-01. Current window ends here; the prior window is the preceding seven days.

## `comparePrevious` (type: `boolean`):

Use a named store to compare complete observations with the last confirmed saved row. First comparison establishes a baseline. This is separate from the adjacent-week calculation, which works on the first run. Use one writer per scope.

## `onlyChanges` (type: `boolean`):

Implies comparison. A first run saves initial rows; unchanged repeats can correctly save zero. Incomplete source windows never advance history.

## `snapshotName` (type: `string`):

1-80 letters, numbers, underscores or hyphens. History also includes project, sorted titles and fixed-end-date or rolling mode. New input scope starts a separate baseline.

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

1-10 confirmed saved article rows. A row includes its 14-day series. Unchanged skipped rows and diagnostics are not dataset results. A smaller cap can leave later articles unprocessed.

## `maxRunSeconds` (type: `integer`):

30-300 seconds, also shortened to 25 seconds before the platform timeout. Collection reserves five additional seconds for output. Sequential requests are capped at 15 seconds and 256 KiB, with at most one transient retry.

## Actor input object example

```json
{
  "articles": [
    "OpenAI",
    "YouTube",
    "TikTok"
  ],
  "project": "en.wikipedia.org",
  "comparePrevious": false,
  "onlyChanges": false,
  "snapshotName": "default",
  "maxResults": 10,
  "maxRunSeconds": 120
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `summary` (type: `string`):

No description

## `report` (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 = {
    "articles": [
        "OpenAI",
        "YouTube",
        "TikTok"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("maydit/wikipedia-topic-attention-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 = { "articles": [
        "OpenAI",
        "YouTube",
        "TikTok",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("maydit/wikipedia-topic-attention-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 '{
  "articles": [
    "OpenAI",
    "YouTube",
    "TikTok"
  ]
}' |
apify call maydit/wikipedia-topic-attention-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,maydit/wikipedia-topic-attention-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/mj8hzbMfX7yAUcKfW/builds/4ODxlJZ9GivdsJ63D/openapi.json
