# Wikipedia Trends Scraper - Top Articles, Country & Edits (`ninhothedev/wikipedia-trends-scraper`) Actor

$0.5/1K 🔥 Wikipedia trends scraper! Most-viewed articles by day & country plus edit activity. No key. JSON, CSV, Excel or API in seconds. Spot trends for SEO & content planning ⚡

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

## Pricing

from $0.50 / 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.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Wikipedia Trends Scraper — Top Articles, Country Traffic & Edit Activity

**Find out what the world actually looked up today.** This Actor pulls Wikipedia's daily trend rankings straight from the official Wikimedia REST Analytics API — **no API key, no login, no proxy required** — and turns them into clean, ranked rows you can export as JSON, CSV, Excel or feed into your own pipeline.

Wikipedia is the largest unfiltered record of public curiosity on the internet. When a film drops, a politician is appointed, or a disaster happens, the pageview ranking moves *hours* before most trend tools notice. This scraper gives you that ranking, per day, per language edition, and per country.

***

### How this differs from `wikipedia-pageviews-scraper`

We publish two Wikipedia analytics Actors. They solve **opposite** problems:

| | **wikipedia-trends-scraper** (this one) | [wikipedia-pageviews-scraper](https://apify.com/ninhothedev/wikipedia-pageviews-scraper) |
|---|---|---|
| **Question it answers** | *"What was most viewed?"* | *"How did **my** article perform?"* |
| **Input** | A date (+ project or country) | A list of article titles |
| **Direction** | **Discovery** — top-down rankings | **Measurement** — bottom-up time series |
| **Output** | Ranked lists (rank 1…N) | Per-article daily view series |
| **Extra data** | Top-per-country, most-edited pages | Per-article history, granularity options |

**Rule of thumb:** use *this* Actor to **discover** which articles are trending. Use `wikipedia-pageviews-scraper` to **track** articles you already care about. Many users run both — discover here, then feed the winning titles into the pageviews Actor for a full history.

***

### What you get

#### Mode `top` — most-viewed articles per day

The full daily ranking (up to 1,000 articles) for any Wikipedia language edition, with exact view counts.

#### Mode `by_country` — top articles per country

What readers **in a specific country** looked up, across all language editions mixed together. This is the interesting one: German readers hit `de.wikipedia`, `en.wikipedia` and `fr.wikipedia` on the same day, and this mode shows the blended reality. View counts are rounded (`views_ceil`) for privacy reasons.

#### Mode `edits` — most-edited pages per day

Editorial activity, not reader activity. A page with a sudden edit spike is a page where something is *happening* or being disputed — an early-warning signal that often precedes the traffic spike.

***

### Example output

**Mode `top`:**

```json
{
  "type": "top",
  "project": "en.wikipedia",
  "date": "2026-07-27",
  "rank": 4,
  "article": "The Odyssey (2026 film)",
  "views": 581815,
  "url": "https://en.wikipedia.org/wiki/The_Odyssey_(2026_film)",
  "source": "wikimedia",
  "scraped_at": "2026-07-28T14:13:05+00:00"
}
```

**Mode `by_country` (DE):**

```json
{
  "type": "by_country",
  "country": "DE",
  "date": "2026-07-27",
  "rank": 7,
  "article": "Franziska Hoppermann",
  "project": "de.wikipedia",
  "views_ceil": 45800,
  "url": "https://de.wikipedia.org/wiki/Franziska_Hoppermann",
  "source": "wikimedia",
  "scraped_at": "2026-07-28T14:13:06+00:00"
}
```

**Mode `edits`:**

```json
{
  "type": "edits",
  "project": "en.wikipedia",
  "date": "2026-06-30",
  "rank": 1,
  "article": "User:4meter4",
  "edits": 393,
  "url": "https://en.wikipedia.org/wiki/User:4meter4",
  "source": "wikimedia",
  "scraped_at": "2026-07-28T14:13:18+00:00"
}
```

One row per ranked article. Every field is nullable, so a missing value never breaks your downstream job.

***

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `mode` | select | `top` | `top`, `by_country` or `edits` |
| `project` | string | `en.wikipedia` | Wikimedia project host, e.g. `de.wikipedia`, `es.wikipedia`, `commons.wikimedia`. Used by `top` and `edits`. |
| `country` | string | `DE` | ISO 3166-1 alpha-2 code for `by_country` mode: `US`, `FR`, `GB`, `IN`, … |
| `dates` | array | `["2026-07-26"]` | One or more `YYYY-MM-DD` days. One API request per date. |
| `maxItems` | integer | `200` | Row cap across all dates (max 2000). |

```json
{
  "mode": "top",
  "project": "en.wikipedia",
  "dates": ["2026-07-26", "2026-07-25"],
  "maxItems": 200
}
```

***

### Important: the data lag (and automatic walk-back)

Wikimedia does not publish trend data in real time.

- **Pageview data (`top`, `by_country`) lags ~1–2 days.** Ask for today and you will usually get a 404.
- **Edit data (`edits`) lags much longer** — it comes from a monthly `mediawiki-history` snapshot, so the newest available day is typically **3–6 weeks** in the past.

**This Actor handles that for you.** If the requested date returns no data, it automatically walks back one day at a time (up to 5 days for pageviews, up to 70 days for edits) until it finds the most recent published day, and stamps the row with the date it actually used. You never get an empty run just because you asked for "yesterday". The run log tells you exactly which date was substituted.

If you need a guaranteed-fresh date, ask for **two days ago** for `top`/`by_country`, and **last month** for `edits`.

***

### Use cases

- **Trend research** — see what the public was actually curious about on any given day, with no keyword guessing and no sampling. Great for spotting cultural moments before they hit mainstream analytics.
- **SEO** — Wikipedia rankings are a free proxy for real informational search demand. If an article is climbing the top-1000, the topic has genuine search volume behind it, and Wikipedia usually outranks you for it — which tells you exactly which SERP you'd be fighting for.
- **Content planning** — mine the daily ranking for topics with proven interest, then check `by_country` to see whether that interest is global or local before you commission a piece.
- **News monitoring** — the `edits` mode surfaces pages under heavy revision, an early signal of breaking or contested events. Combine with `top` to separate "people are reading about this" from "people are arguing about this".

***

### Pricing

Roughly **$0.50 per 1,000 results**. Runs are fast and lightweight (512 MB, one API call per date), so a full 1,000-article daily ranking costs about half a dollar. No proxy costs, no API subscription — the Wikimedia Analytics API is free and its data is CC0.

***

### Related Actors

- [Wikipedia Pageviews Scraper](https://apify.com/ninhothedev/wikipedia-pageviews-scraper) — per-article daily/monthly view history for titles you specify
- [Wikipedia Featured Scraper](https://apify.com/ninhothedev/wikipedia-featured-scraper) — featured article, picture of the day, on-this-day events
- [Google Trends Scraper](https://apify.com/ninhothedev/google-trends-scraper) — search-interest curves to cross-check Wikipedia trends
- [Wikipedia Scraper](https://apify.com/ninhothedev/wikipedia-scraper) — full article content, summaries, infoboxes and links

***

### Notes & compliance

Data comes from the public [Wikimedia REST Analytics API](https://wikimedia.org/api/rest_v1/). It is aggregate and anonymous — no personal data is collected, and country-level counts are deliberately rounded by Wikimedia. Content is licensed CC0 / CC BY-SA; attribute Wikipedia when you republish. The Actor sends a descriptive User-Agent as Wikimedia's policy requires.

Redirects, `Main_Page`, and `Special:` pages appear in the raw ranking exactly as Wikimedia publishes them — filter them out downstream if you only want article content.

# Actor input Schema

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

What to scrape. 'top' returns the most-viewed articles of a Wikipedia project for each day. 'by\_country' returns the most-viewed articles among readers in one country (rounded view counts, all projects mixed). 'edits' returns the most-edited pages of a project for each day.

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

Wikimedia project host used for the 'top' and 'edits' modes, e.g. 'en.wikipedia', 'de.wikipedia', 'es.wikipedia' or 'commons.wikimedia'. Ignored in 'by\_country' mode, where the project comes from the API per article.

## `country` (type: `string`):

ISO 3166-1 alpha-2 country code for the 'by\_country' mode, e.g. 'DE', 'US', 'FR', 'GB', 'IN'. Only used when mode is 'by\_country'.

## `dates` (type: `array`):

One or more days to scrape, formatted as YYYY-MM-DD. One request per date. Wikimedia publishes pageview data with a ~1-2 day lag (edit data lags several weeks), so if a date has no data yet the Actor automatically walks back to the most recent available day. Leave empty to use today.

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

Maximum number of dataset rows to push across all dates. Each row is one ranked article. Use 25-50 for a quick top list, 1000 for the full ranking of several days.

## Actor input object example

```json
{
  "mode": "top",
  "project": "en.wikipedia",
  "country": "DE",
  "dates": [
    "2026-07-26"
  ],
  "maxItems": 200
}
```

# 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 = {
    "project": "en.wikipedia",
    "country": "DE",
    "dates": [
        "2026-07-26"
    ],
    "maxItems": 200
};

// Run the Actor and wait for it to finish
const run = await client.actor("ninhothedev/wikipedia-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 = {
    "project": "en.wikipedia",
    "country": "DE",
    "dates": ["2026-07-26"],
    "maxItems": 200,
}

# Run the Actor and wait for it to finish
run = client.actor("ninhothedev/wikipedia-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 '{
  "project": "en.wikipedia",
  "country": "DE",
  "dates": [
    "2026-07-26"
  ],
  "maxItems": 200
}' |
apify call ninhothedev/wikipedia-trends-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ninhothedev/wikipedia-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/MpvRh1M94yZlbF5cy/builds/MEmbuwLu5xDwvzPtl/openapi.json
