# Wikipedia Pageviews Trends Scraper (`zerobreak/wikipedia-pageviews-trends-scraper`) Actor

Wikimedia Trending Articles Scraper is a Python tool to extract top-viewed article titles, daily traffic counts, language rankings, and historical popularity metrics from the Wikimedia REST API. It exports structured trend datasets into clean CSV or JSON formats for content research.

- **URL**: https://apify.com/zerobreak/wikipedia-pageviews-trends-scraper.md
- **Developed by:** [ZeroBreak](https://apify.com/zerobreak) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 1,000 results

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 Pageviews Trends Scraper — Daily and Monthly Article Traffic Statistics

![Wikipedia Pageviews Trends Scraper cover](https://images.bigibyte.com/cdn-cgi/image/width=1260,height=540,fit=cover,format=webp/apify-actors-covers/wikipedia-pageviews-trends-scraper-cover.png)

### Overview

Wikipedia Pageviews Trends Scraper collects daily or monthly pageview statistics for Wikipedia articles. Specify article titles, a date range, and collection preferences to retrieve historical viewing trends in a structured dataset.

Analyze article popularity, compare interest across topics, and track changes in readership over time. Export your results in JSON, CSV, Excel, and other supported Apify dataset formats.

### Features

- **Article Pageviews:** Collect pageview statistics for selected Wikipedia articles.
- **Daily and Monthly Data:** Choose daily or monthly reporting granularity.
- **Multiple Articles:** Retrieve pageview records for multiple article titles.
- **Custom Date Ranges:** Specify start and end dates for historical analysis.
- **Project Selection:** Select the Wikimedia project, such as `en.wikipedia`.
- **Access Filtering:** Choose the access type, such as `all-access`.
- **Agent Filtering:** Select the traffic agent category, such as `user`.
- **Duplicate Prevention:** Avoid duplicate records based on project, article, granularity, timestamp, access, and agent.
- **Maximum Item Control:** Set a limit on the number of records collected.
- **Structured Dataset:** Export pageview statistics for further analysis and visualization.

### Collection Mode

| Mode | Description |
|---|---|
| `articlePageviews` | Retrieves daily or monthly pageview statistics for each article in the supplied list. |

### Input Parameters

| Parameter | Type | Description |
|---|---|---|
| `mode` | String | Collection mode. Use `articlePageviews`. |
| `articles` | Array | Wikipedia article titles to collect pageview statistics for. |
| `project` | String | Wikimedia project identifier, such as `en.wikipedia`. |
| `granularity` | String | Pageview reporting interval: `daily` or `monthly`. |
| `start` | String | Start date in `YYYYMMDD` format. |
| `end` | String | End date in `YYYYMMDD` format. |
| `access` | String | Access type, such as `all-access`. |
| `agent` | String | Traffic agent category, such as `user`. |
| `maxItems` | Integer | Maximum number of records to collect. |
| `requestDelaySecs` | Number | Delay between requests in seconds. |
| `userAgent` | String | User-Agent value used for requests. |
| `requestTimeoutSecs` | Integer | Maximum time allowed for an individual request, in seconds. |

### Example Input

```json
{
  "mode": "articlePageviews",
  "articles": [
    "Python_(programming_language)"
  ],
  "project": "en.wikipedia",
  "granularity": "daily",
  "start": "20260901",
  "end": "20260930",
  "access": "all-access",
  "agent": "user",
  "maxItems": 50,
  "requestDelaySecs": 1,
  "userAgent": "ActorResearch/1.0 (+https://apify.com)",
  "requestTimeoutSecs": 30
}
```

### What Data Does This Actor Extract?

| Field | Description |
|---|---|
| `project` | Wikimedia project associated with the pageview data. |
| `article` | Wikipedia article title. |
| `granularity` | Reporting interval, such as daily or monthly. |
| `timestamp` | Time bucket associated with the pageview record. |
| `access` | Access category used for the statistics. |
| `agent` | Traffic agent category used for the statistics. |
| `views` | Number of pageviews recorded for the article during the time bucket. |
| `scrapedAt` | Date and time when the record was collected. |

### Example Output

```json
{
  "project": "en.wikipedia",
  "article": "Python_(programming_language)",
  "granularity": "daily",
  "timestamp": "2026090100",
  "access": "all-access",
  "agent": "user",
  "views": 4731,
  "scrapedAt": "2026-10-26T00:00:00+00:00"
}
```

### Use Cases

- **Topic Demand Research:** Measure how frequently Wikipedia articles are viewed over a selected period.
- **SEO Research:** Compare pageview trends across related topics and article titles.
- **Content Planning:** Identify rising or declining interest before planning new content.
- **Trend Monitoring:** Track changes in article popularity through recurring collections.
- **Historical Analysis:** Build datasets of pageview statistics for reporting and visualization.
- **Topic Comparison:** Compare readership across multiple articles within the same date range.

### Working with Your Dataset

After a successful run, access your collected records through the Apify Dataset tab.

Export the results in JSON, CSV, Excel, and other supported formats for analysis, reporting, charts, or further processing.

### FAQ

**Who is this actor for?**

It is designed for SEO researchers, analysts, content strategists, and developers who need structured Wikipedia pageview statistics.

**Can I collect daily and monthly pageviews?**

Yes. Set `granularity` to `daily` or `monthly` to choose the reporting interval.

**How do I set the date range?**

Use `start` and `end` in `YYYYMMDD` format. For example, `20260901` and `20260930`.

**Can I collect multiple articles?**

Yes. Provide multiple Wikipedia article titles in the `articles` array.

**What does the access parameter mean?**

It specifies the access category for the pageview statistics, such as `all-access`.

**What does the agent parameter mean?**

It specifies the traffic agent category used for the statistics, such as `user`.

**Can I run it on a schedule?**

Yes. Configure Apify schedules to collect pageview statistics at your preferred intervals.

**What export formats are available?**

You can export the dataset in JSON, CSV, Excel, and other supported Apify dataset formats.

### Disclaimer

This Actor is an independent tool and is not affiliated with, endorsed by, sponsored by, or officially associated with Wikimedia Foundation or Wikipedia. It collects publicly available pageview statistics. Users are responsible for ensuring that their use of collected data complies with applicable terms and laws.

### Is Web Scraping Legal?

Collecting information that is already public is generally legal. There is no single law that bans all forms of web scraping. The limits are the usual ones: do not break into accounts, do not take private or confidential data, and be careful with personal data and copyrighted works. A site's terms can also restrict how you access it. Facts such as a public name, price, or rating are not the same thing as republishing someone's article or photo.

This actor collects information from public pages. It does not log in and it does not bypass access controls.

For a longer explanation, see Apify's article [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/).

# Actor input Schema

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

What to fetch. Article pageviews returns daily or monthly views per article.

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

Article titles with underscores (for example Python\_(programming_language)).

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

Wiki project host, for example en.wikipedia or de.wikipedia.

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

daily or monthly pageview buckets.

## `start` (type: `string`):

Range start as YYYYMMDD.

## `end` (type: `string`):

Range end as YYYYMMDD.

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

Access filter for the pageviews API.

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

Agent filter for the pageviews API.

## `maxItems` (type: `integer`):

Stop after this many successful rows. Hard max is 1000.

## `requestDelaySecs` (type: `number`):

Seconds to wait between requests.

## `userAgent` (type: `string`):

User-Agent header sent with each request. Wikimedia requires a descriptive UA with a contact URL.

## `timeoutSecs` (type: `integer`):

Overall run budget in seconds.

## `requestTimeoutSecs` (type: `integer`):

Per-request timeout in seconds.

## `proxyConfiguration` (type: `object`):

Optional proxy. Leave off unless you need it.

## Actor input object example

```json
{
  "mode": "articlePageviews",
  "articles": [
    "Python_(programming_language)"
  ],
  "project": "en.wikipedia",
  "granularity": "daily",
  "start": "20260901",
  "end": "20260930",
  "access": "all-access",
  "agent": "user",
  "maxItems": 100,
  "requestDelaySecs": 1,
  "userAgent": "ActorResearch/1.0 (+https://apify.com)",
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

Dataset rows in the overview table.

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

Full dataset for this run.

## `items` (type: `string`):

Dataset items as JSON.

# 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": [
        "Python_(programming_language)"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("zerobreak/wikipedia-pageviews-trends-scraper").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": ["Python_(programming_language)"] }

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

```

## MCP server setup

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

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/GuId0apnjou1RUges/builds/pMsr0ABY1SyMJzPfe/openapi.json
