# Wikipedia Pageview Spikes (`automatic/wikipedia-pageview-spikes`) Actor

Find Wikipedia articles whose daily views spiked: article, wiki, date, views, normal level (median of prior days), spike ratio and rank, from Wikimedia's official pageview statistics. Any language or wiki, one day or a range. For trend, news and content research.

- **URL**: https://apify.com/automatic/wikipedia-pageview-spikes.md
- **Developed by:** [Philip Kirkbride](https://apify.com/automatic) (community)
- **Categories:** News, SEO tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 spike rows

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

## Wikipedia Pageview Spikes

Find the Wikipedia articles whose daily views suddenly jumped. For each day you choose, the Actor compares every article among the wiki's 1,000 most viewed pages with its own normal level (the median of its daily views over the previous days) and returns the spikes: article, link, date, views, normal level, spike ratio, rank and the day-by-day views behind the baseline. It works for any language edition of Wikipedia and for the other Wikimedia wikis (Wiktionary, Commons, Wikidata and more), using Wikimedia's official pageview statistics.

Use it for trend and news monitoring, topic research, content planning and alerting: schedule a daily run and send the new spikes to a spreadsheet, Slack or your own pipeline.

### Quick Start

Yesterday's biggest spikes on English Wikipedia:

```json
{"maxResults": 10}
```

German and French Wikipedia for the last 3 days, articles at least 5 times their normal views:

```json
{
  "projects": ["de", "fr"],
  "lastNDays": 3,
  "minSpikeRatio": 5,
  "maxResults": 100
}
```

### Input

| Field | Type | Default | What it does |
|---|---|---:|---|
| `projects` | array | `["en.wikipedia"]` | Wikis to scan: language codes (`en`, `de`, `ja`), projects (`en.wikipedia`, `fr.wiktionary`, `commons.wikimedia`, `www.wikidata`) or wiki addresses. Up to 10. |
| `date` | string | latest | Day to report (UTC), `YYYY-MM-DD`. Empty = the latest day with published statistics, usually yesterday. |
| `lastNDays` | integer | `1` | Report this many days, ending on `date`. Up to 31. |
| `baselineDays` | integer | `7` | Days before the reported day used for the normal level (3-30). |
| `minSpikeRatio` | number | `3` | Only articles with at least this many times their normal views. |
| `minViews` | integer | `1000` | Ignore articles with fewer views on the reported day. |
| `access` | string | `all-access` | `all-access`, `desktop`, `mobile-web` or `mobile-app`. |
| `excludeSpecialPages` | boolean | `true` | Leave out the main page, search, and talk, user, project, file, category and portal pages (in each wiki's own language). |
| `exactBaseline` | boolean | `true` | Read the exact daily views of the strongest spikes whose normal level is otherwise only known as an upper limit. |
| `maxLookups` | integer | `10` | How many articles get exact daily views per run (about 10 a minute). |
| `maxResults` | integer | `20` | Maximum spikes returned, strongest first. Up to 5,000. |

### What it returns

Every row has `spikeKey`, `project`, `language`, `site`, `article`, `articleKey`, `url`, `date`, `views`, `rank`, `previousRank`, `baselineViews`, `baselineDays`, `baselineFrom`, `baselineTo`, `baselineSource`, `baselineIsUpperBound`, `baselineDailyViews` (one `{date, views}` per baseline day), `daysInTopList`, `spikeRatio`, `viewsChange`, `access`, `sourceUrl`, `source` and `scrapedAt`.

Rows are sorted by `spikeRatio`, strongest first. Views count people, not bots. Dates are UTC days (`YYYY-MM-DD`), `scrapedAt` is ISO 8601. `spikeKey` (`project:date:articleKey`) is unique per article and day, so you can merge runs on it.

How the normal level is measured: Wikimedia publishes each wiki's 1,000 most viewed pages for every day. An article that was on all of the previous days' lists has an exact normal level from those lists (`baselineSource: "topLists"`). An article that was missing on some days had fewer views than that day's last listed page, so its normal level is at most that. For the strongest of these spikes the Actor reads the article's own daily views and makes the normal level exact (`baselineSource: "dailyViews"`). The rest keep the upper limit, marked with `baselineIsUpperBound: true`, and their real spike is at least the `spikeRatio` shown.

Exact and estimated numbers: `views`, `rank` and `previousRank` are always exact (Wikimedia's published figures). `baselineViews`, `spikeRatio` and `viewsChange` are exact when `baselineIsUpperBound` is `false`. When it is `true`, `baselineViews` is an upper limit, so `spikeRatio` and `viewsChange` are lower limits: the real spike is at least that big. A `null` in `baselineDailyViews` means the article was not in that day's top 1,000, or that day's list was unavailable.

### Output example

```json
{"spikeKey":"en.wikipedia:2026-10-26:Eric_Bauza","project":"en.wikipedia","language":"en","site":"wikipedia","article":"Eric Bauza","articleKey":"Eric_Bauza","url":"https://en.wikipedia.org/wiki/Eric_Bauza","date":"2026-10-26","views":511715,"rank":4,"previousRank":null,"baselineViews":1309,"baselineDays":7,"baselineFrom":"2026-10-19","baselineTo":"2026-10-25","baselineSource":"dailyViews","baselineIsUpperBound":false,"baselineDailyViews":[{"date":"2026-10-19","views":1366},{"date":"2026-10-20","views":1160},{"date":"2026-10-21","views":1309},{"date":"2026-10-22","views":1206},{"date":"2026-10-23","views":1164},{"date":"2026-10-24","views":1547},{"date":"2026-10-25","views":1406}],"daysInTopList":0,"spikeRatio":390.92,"viewsChange":510406,"access":"all-access","sourceUrl":"https://wikimedia.org/api/rest_v1/metrics/pageviews/per-article/en.wikipedia/all-access/user/Eric_Bauza/daily/20261019/20261026","source":"wikimedia.org/pageviews","scrapedAt":"2026-10-27T14:59:59+00:00"}
```

### Limits and caveats

- Only pages that reached the wiki's daily top 1,000 can be found. On English Wikipedia that means roughly 8,000 views or more that day; on smaller wikis the bar is much lower.
- Wikimedia lets each user read only about 10 article histories a minute, so beyond the first few, exact normal levels take about 6 seconds per article. The default run reads up to 10 and usually finishes in well under a minute; set `exactBaseline` to `false` for instant results with upper-limit baselines, or raise `maxLookups` for more exact rows in a longer run.
- If the run's time is about to run out, it stops reading and delivers the spikes found so far.
- Statistics for a day appear a few hours after it ends (UTC). Now and then a day's top list is unavailable for a wiki. That day then counts as unknown: the normal level stays an upper limit (`baselineIsUpperBound: true`) while most of the window is known (up to 3 of 7 days missing); with more missing days only articles whose exact daily views were read are returned.
- A few pages get large automated traffic that Wikimedia counts as people (sudden spikes on obscure pages, often only on one platform). Compare `access: desktop` with `mobile-web` runs if a spike looks odd.

### FAQ

**How fresh is the data?** Each run reads the latest published statistics, normally yesterday's (UTC).

**How do I get only new spikes each day?** Schedule a daily run with the default empty date; each run reports the newest day. Merge on `spikeKey`.

**Can I use other wikis?** Yes: any Wikipedia language (`ja`, `pt`, `zh-yue`...), or projects such as `fr.wiktionary`, `commons.wikimedia` and `www.wikidata`.

**What happens when nothing spikes?** The run succeeds with an empty dataset. Lower `minSpikeRatio` or `minViews` to see more.

### Price

**$0.001 per result row**, plus **$0.005 per run start**. A row is one article on one day: the same article spiking on two days, or on two wikis, is two rows. Rows with exact and with upper-limit normal levels cost the same. The run-start event is charged per GB of memory; the default 512 MB run is one start event. The start is charged even if the run saves no rows. Platform usage is included in these prices.

### Support

For questions or issues, contact us from the Actor page.

# Actor input Schema

## `projects` (type: `array`):

Wikis to scan: a language code ('en', 'de', 'ja'), a project such as 'en.wikipedia', 'fr.wiktionary' or 'commons.wikimedia', or a wiki address. Up to 10.

## `date` (type: `string`):

Day to report (UTC), YYYY-MM-DD. Leave empty for the latest day with published statistics (usually yesterday).

## `lastNDays` (type: `integer`):

Report this many days, ending on Date (or the latest day). 1 = a single day.

## `baselineDays` (type: `integer`):

An article's normal level is the median of its daily views over this many days before the reported day.

## `minSpikeRatio` (type: `number`):

Only report articles whose views are at least this many times their normal level, e.g. 3 or 2.5.

## `minViews` (type: `integer`):

Ignore articles with fewer views than this on the reported day.

## `access` (type: `string`):

Which readers to count.

## `excludeSpecialPages` (type: `boolean`):

Leave out the main page, search and other special pages, and pages outside the article space (talk, user, project, file, category, portal pages).

## `exactBaseline` (type: `boolean`):

Read the daily views of the strongest spikes whose normal level is otherwise only known as an upper limit (articles that were not among the day's 1,000 most viewed pages every day). Slower: about 10 articles a minute.

## `maxLookups` (type: `integer`):

At most this many articles get their exact daily views per run (about 10 a minute). The rest keep the estimated normal level, marked with baselineIsUpperBound. When a day's statistics are missing for a wiki, only articles with exact daily views are returned for the days that need it.

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

Maximum spikes returned, strongest first.

## Actor input object example

```json
{
  "projects": [
    "en.wikipedia"
  ],
  "lastNDays": 1,
  "baselineDays": 7,
  "minSpikeRatio": 3,
  "minViews": 1000,
  "access": "all-access",
  "excludeSpecialPages": true,
  "exactBaseline": true,
  "maxLookups": 10,
  "maxResults": 10
}
```

# 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 = {
    "projects": [
        "en.wikipedia"
    ],
    "lastNDays": 1,
    "baselineDays": 7,
    "minSpikeRatio": 3,
    "minViews": 1000,
    "access": "all-access",
    "excludeSpecialPages": true,
    "exactBaseline": true,
    "maxLookups": 10,
    "maxResults": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("automatic/wikipedia-pageview-spikes").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 = {
    "projects": ["en.wikipedia"],
    "lastNDays": 1,
    "baselineDays": 7,
    "minSpikeRatio": 3,
    "minViews": 1000,
    "access": "all-access",
    "excludeSpecialPages": True,
    "exactBaseline": True,
    "maxLookups": 10,
    "maxResults": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("automatic/wikipedia-pageview-spikes").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 '{
  "projects": [
    "en.wikipedia"
  ],
  "lastNDays": 1,
  "baselineDays": 7,
  "minSpikeRatio": 3,
  "minViews": 1000,
  "access": "all-access",
  "excludeSpecialPages": true,
  "exactBaseline": true,
  "maxLookups": 10,
  "maxResults": 10
}' |
apify call automatic/wikipedia-pageview-spikes --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,automatic/wikipedia-pageview-spikes"
        }
    }
}
```

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/699CMIQB8PbhvLOdN/builds/ajKz6jzvHlDARmgVw/openapi.json
