# Wikipedia Trends Scraper: Top Articles by Country (`scrapemint/wikipedia-trends-scraper`) Actor

What every country is looking up on Wikipedia: daily top 1000 most-viewed articles per country or language, with rank movement between runs, plus daily view timeseries for any article. Official Wikimedia API, real view counts. For SEO, content, news and market signals. Keyless.

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

## Pricing

$3.00 / 1,000 wikipedia trend 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/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 by Country

Wikipedia is where the world goes to look things up, and its view counts are public, real numbers, not an index. This actor pulls the daily most-viewed articles for any country or language edition (up to 1000 ranks), and daily view histories for any list of articles. Straight from Wikimedia's official pageviews API. No login, no API key, no subscription.

Google Trends tells you a topic is rising on a 0 to 100 scale. Wikipedia tells you how many people actually looked it up, per day, per country. Together they are a complete attention dataset; pair this with the [Google Trends Scraper](https://apify.com/scrapemint/google-trends-scraper) and [Google News Scraper](https://apify.com/scrapemint/google-news-scraper).

### What you get

**Top mode** — one row per ranked article per chart:

| Field | Description |
|---|---|
| `scope`, `country` / `project` | Chart identity: a country (all languages combined) or a language edition (worldwide) |
| `date` | The day the chart is for (stats publish with about one day of lag) |
| `rank`, `views` | Position and real view count |
| `previousRank`, `rankChange`, `isNew` | Movement versus your previous run (with compare on) |
| `article`, `articleKey`, `articleUrl` | Title, raw key, and link |

**Timeseries mode** — one row per article per day: `article`, `date`, `views`, `project`, `articleUrl`.

Non-article noise (Main Page, search pages, meta namespaces) is filtered out by default so charts contain real topics.

### Input

- **Top mode**: country codes (`US, GB, DE, IN, BR, KE, ...`) and/or wiki projects (`en.wikipedia, ja.wikipedia`), chart depth up to 1000, optional specific date, movement tracking on a schedule.
- **Timeseries mode**: article titles, language edition, up to 365 days back.
- **Max rows per run**: cost cap.

### Pricing

Pay per result: **$0.003 per row**. First 2 rows of every run are free.

The daily top 100 for 5 countries is $1.50 a run. A 90-day view history for 20 articles is $5.40, once.

### Typical uses

- **SEO and content teams**: topic demand with real absolute numbers; catch topics whose attention is climbing before search volume tools update.
- **Newsrooms and newsletters**: "what the world looked up this week" formats, per market, automated.
- **Traders and analysts**: attention spikes on companies, products, people and events as a signal input.
- **Brand and PR monitoring**: daily views on your company's article versus competitors.
- **Researchers**: clean per-country attention data with no API key paperwork.

### Scheduling

Run top mode daily with "Compare with previous run" on: rank history is kept per chart in a named key-value store, so every run reports movers, new entries and exact view counts. Consume rows via the API, webhooks, or the Google Sheets integration.

### Data notes

Data comes from the official Wikimedia pageviews API and counts human (user) traffic only, excluding known bots and spiders. Daily stats publish with roughly one day of lag; the actor automatically steps back to the newest published day when no date is given.

# Actor input Schema

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

"Top articles" returns a ranked chart per country or language project for one day. "Article timeseries" returns daily views per article over a date range.

## `countries` (type: `array`):

ISO country codes, e.g. US, GB, DE, IN, BR, KE. One chart per country (all languages combined).

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

Language projects instead of / in addition to countries, e.g. en.wikipedia, de.wikipedia, ja.wikipedia. One chart per project (worldwide views).

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

YYYY-MM-DD. Empty = latest published day (stats lag about one day; the actor steps back automatically).

## `topN` (type: `integer`):

How many ranked articles per chart (API serves up to 1000).

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

Skip Main Page, search pages and other non-article namespaces so charts contain real topics.

## `compareWithPrevious` (type: `boolean`):

Remember ranks between runs and report previousRank, rankChange and isNew. Turn on with a schedule for daily movement tracking.

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

Article titles exactly as on Wikipedia, e.g. Bitcoin, Taylor Swift, ChatGPT.

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

Which language edition to read views from, e.g. en.wikipedia, es.wikipedia.

## `daysBack` (type: `integer`):

Length of the daily view history per article (up to 365).

## `maxRows` (type: `integer`):

Cap on rows returned. Controls total cost.

## Actor input object example

```json
{
  "mode": "top",
  "countries": [
    "US",
    "GB"
  ],
  "projects": [],
  "date": "",
  "topN": 50,
  "excludeSpecialPages": true,
  "compareWithPrevious": true,
  "articles": [],
  "project": "en.wikipedia",
  "daysBack": 30,
  "maxRows": 500
}
```

# 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 = {
    "mode": "top",
    "countries": [
        "US",
        "GB"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapemint/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 = {
    "mode": "top",
    "countries": [
        "US",
        "GB",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("scrapemint/wikipedia-trends-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "mode": "top",
  "countries": [
    "US",
    "GB"
  ]
}' |
apify call scrapemint/wikipedia-trends-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=scrapemint/wikipedia-trends-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/NDwfNfWxXzCFBdWkV/builds/ipJnjBDc5zODnTuOm/openapi.json
