# Wikipedia Trends: pageviews and top articles (`catblik/wikipedia-trends`) Actor

Free-data alternative to Google Trends: daily or monthly Wikipedia pageview history, growth stats and top articles from the official Wikimedia API.

- **URL**: https://apify.com/catblik/wikipedia-trends.md
- **Developed by:** [asaf meizner](https://apify.com/catblik) (community)
- **Categories:** Developer tools, SEO tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 article trend returneds

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 Trends: pageviews, growth and top articles

An open-data way to track public attention to topics. Note: Wikipedia pageviews measure reading of Wikipedia articles, not Google search interest, so treat it as a related signal, not a Google Trends replacement. It reads the **official Wikimedia Pageviews API** (open data, no scraping, no login) and returns, for each Wikipedia article you list, the daily or monthly pageview history plus ready-made statistics: total, average, peak day and the percentage change between the first and the second half of the period. A second mode returns the most viewed articles of any day or month.

Wikipedia attention is a good proxy for public interest in a person, company, product, technology, disease or event, and it works in every language edition.

### What you get

**Mode `articles`** (one row per article, charged as `article-trend`):

```json
{
  "article": "ChatGPT",
  "project": "en.wikipedia",
  "granularity": "daily",
  "url": "https://en.wikipedia.org/wiki/ChatGPT",
  "from": "2026-09-18",
  "to": "2026-10-17",
  "totalViews": 1234567,
  "avgViews": 41152.2,
  "peakDate": "2026-10-02",
  "peakViews": 60211,
  "changePct": 4.8,
  "series": [{"date": "2026-09-18", "views": 39000}, "..."]
}
```

**Mode `top`** (one row per article, charged as `top-article`): rank and views of the most viewed articles for a day (`granularity: daily`) or a month (`granularity: monthly`). Meta pages such as Main Page and Special pages are removed.

### Input examples

Compare three topics over the last 30 days:

```json
{"articles": ["Bitcoin", "Ethereum", "Solana"]}
```

Monthly history for a full year, any language:

```json
{"articles": ["https://de.wikipedia.org/wiki/Elektroauto"], "granularity": "monthly",
 "startDate": "2025-10-01", "endDate": "2026-09-30"}
```

Top 100 articles of a day:

```json
{"mode": "top", "startDate": "2026-10-15", "maxTop": 100}
```

### Options

- `project`: language edition such as `en.wikipedia`, `de.wikipedia`. A full article URL overrides it.
- `access`: `all-access`, `desktop`, `mobile-web`, `mobile-app`.
- `agent`: `user` (default, excludes spiders and automated traffic), `all-agents`, `spider`, `automated`.
- `includeSeries`: set to `false` to get only the summary statistics.
- Data starts in July 2015 and lags by one to three days (top mode falls back to the latest published day if you give no date).

### Pricing (pay per event)

- `article-trend`: 0.004 USD per article returned.
- `top-article`: 0.0005 USD per top-list entry returned.

### Notes

Data comes from `wikimedia.org/api/rest_v1/metrics/pageviews` under Wikimedia's open data terms, requested politely with an identifying User-Agent and a short delay between requests. Articles with no data in the range (typo, page did not exist yet) are skipped with a log warning and are not charged. The data counts page requests, not unique people.

# Actor input Schema

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

'articles' returns the pageview history of the articles you list. 'top' returns the most viewed articles of one day or month.

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

Article titles or full Wikipedia URLs (mode 'articles'). Example: Python (programming language), ChatGPT.

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

Language edition, e.g. en.wikipedia, de.wikipedia, fr.wikipedia.

## `granularity` (type: `string`):

Daily or monthly buckets (mode top: ranking of one day or of a whole month).

## `startDate` (type: `string`):

Default: 30 days before the end date. For mode 'top': the day (or month) to rank.

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

Default: yesterday.

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

Device filter.

## `agent` (type: `string`):

'user' excludes known spiders and automated traffic.

## `includeSeries` (type: `boolean`):

Return the full time series in each row; disable for only summary statistics.

## `maxTop` (type: `integer`):

Mode 'top' only.

## Actor input object example

```json
{
  "mode": "articles",
  "articles": [
    "ChatGPT",
    "Bitcoin"
  ],
  "project": "en.wikipedia",
  "granularity": "daily",
  "access": "all-access",
  "agent": "user",
  "includeSeries": true,
  "maxTop": 50
}
```

# 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 = {
    "articles": [
        "ChatGPT",
        "Bitcoin"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("catblik/wikipedia-trends").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": [
        "ChatGPT",
        "Bitcoin",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("catblik/wikipedia-trends").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": [
    "ChatGPT",
    "Bitcoin"
  ]
}' |
apify call catblik/wikipedia-trends --silent --output-dataset

```

## MCP server setup

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

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/v6rT4luPniojIhB5r/builds/GMh3sVdKGkahuzFGz/openapi.json
