# Wikipedia Trends API
> Live readership-trend data from the Wikimedia Pageviews API — the official measure of what the world is reading on Wikipedia and its sister projects. See the most-viewed articles on any Wikipedia language edition for a given day (the daily trending list); pull the daily or monthly pageview trend for any single article over a date range; read a whole project's total pageviews over a range as a barometer of overall traffic; or rank several articles head-to-head by total views for topic-engagement comparison. Special / namespace pages (Main Page, Search, Portal…) are filtered out by default so the trending list is real articles. Read live from Wikimedia, nothing stored — data lags about 1-2 days, so ranges default to ending two days back. This is the Wikipedia readership-trend and topic-engagement layer for any trends, research, newsroom or analytics app — distinct from Wikipedia content APIs: this is the pageview, trending and engagement signal of what people are actually reading and how it changes.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/wikitrends-api/..."
```

## Pricing
- **Free** (Free) — 2,000 calls/Mo, 3 req/s
- **Starter** ($7/Mo) — 60,000 calls/Mo, 12 req/s
- **Pro** ($19/Mo) — 300,000 calls/Mo, 30 req/s
- **Business** ($46/Mo) — 1,500,000 calls/Mo, 60 req/s

## Endpoints

### Top

#### `GET /v1/top` — Most-viewed articles for a day — the trending list

**Parameters:**
- `project` (query, optional, string) — Wiki project or bare language code Example: `en.wikipedia`
- `date` (query, optional, string) — Day YYYY-MM-DD (defaults 2 days back) Example: `2026-06-08`
- `limit` (query, optional, string) — Max results (1-1000) Example: `50`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/wikitrends-api/v1/top?project=en.wikipedia&date=2026-06-08&limit=50"
```

**Response:**
```json
{
    "data": {
        "top": [
            {
                "rank": 4,
                "title": "Obsession (2025 film)",
                "views": 291972,
                "article": "Obsession_(2025_film)"
            },
            {
                "rank": 5,
                "title": "2026 Peruvian general election",
                "views": 281754,
                "article": "2026_Peruvian_general_election"
            },
            {
                "rank": 6,
                "title": "2026 FIFA World Cup",
                "views": 264644,
                "article": "2026_FIFA_World_Cup"
            },
            {
                "rank": 7,
                "title": "Backrooms (film)",
                "views": 174832,
                "article": "Backrooms_(film)"
            },
            {
                "rank": 8,
                "title": "Alexander Zverev",
                "views": 163973,
                "article": "Alexander_Zverev"
            },
            {
                "rank": 9,
                "title": "Masters of the Universe (2026 film)",
                "views": 155937,
                "article": "Masters_of_the_Universe_(2026_film)"
            },
            {
                "rank": 10,
                "title": "Christian Eriksen",
                "views": 139845,
                "article": "Christian_Eriksen"
            },
            {
                "rank": 11,
                "title": "Deaths in 2026",
                "views": 132986,
    
…(truncated, see openapi.json for full schema)
```

### Article

#### `GET /v1/article` — Daily/monthly pageview trend for one article

**Parameters:**
- `article` (query, required, string) — Article title (underscores ok) Example: `Cristiano_Ronaldo`
- `project` (query, optional, string) — Wiki project Example: `en.wikipedia`
- `from` (query, optional, string) — Start date YYYY-MM-DD Example: `2026-06-01`
- `to` (query, optional, string) — End date YYYY-MM-DD Example: `2026-06-08`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/wikitrends-api/v1/article?article=Cristiano_Ronaldo&project=en.wikipedia&from=2026-06-01&to=2026-06-08"
```

**Response:**
```json
{
    "data": {
        "to": "2026-06-08",
        "from": "2026-06-01",
        "count": 8,
        "title": "Cristiano Ronaldo",
        "access": "all-access",
        "series": [
            {
                "date": "2026-06-01",
                "views": 35837
            },
            {
                "date": "2026-06-02",
                "views": 38298
            },
            {
                "date": "2026-06-03",
                "views": 39473
            },
            {
                "date": "2026-06-04",
                "views": 39922
            },
            {
                "date": "2026-06-05",
                "views": 41528
            },
            {
                "date": "2026-06-06",
                "views": 49555
            },
            {
                "date": "2026-06-07",
                "views": 52183
            },
            {
                "date": "2026-06-08",
                "views": 48521
            }
        ],
        "source": "Wikimedia Pageviews",
        "article": "Cristiano_Ronaldo",
        "project": "en.wikipedia",
        "granularity": "daily",
        "total_views": 345317
    },
    "meta": {
        "timestamp": "2026-06-10T13:59:42.003Z",
        "request_id": "90c541b2-ee02-4a12-a9f3-0610fdfc5bd0"
    },
    "status": "ok",
    "message": "Article trend retrieved successfully",
    "success": true
}
```

### Aggregate

#### `GET /v1/aggregate` — A project's total pageviews over a range

**Parameters:**
- `project` (query, optional, string) — Wiki project Example: `en.wikipedia`
- `from` (query, optional, string) — Start date YYYY-MM-DD Example: `2026-06-01`
- `to` (query, optional, string) — End date YYYY-MM-DD Example: `2026-06-08`
- `granularity` (query, optional, string) — daily or monthly Example: `daily`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/wikitrends-api/v1/aggregate?project=en.wikipedia&from=2026-06-01&to=2026-06-08&granularity=daily"
```

**Response:**
```json
{
    "data": {
        "to": "2026-06-08",
        "from": "2026-06-01",
        "count": 8,
        "access": "all-access",
        "series": [
            {
                "date": "2026-06-01",
                "views": 314766231
            },
            {
                "date": "2026-06-02",
                "views": 311407635
            },
            {
                "date": "2026-06-03",
                "views": 308605746
            },
            {
                "date": "2026-06-04",
                "views": 303125887
            },
            {
                "date": "2026-06-05",
                "views": 311150207
            },
            {
                "date": "2026-06-06",
                "views": 310820458
            },
            {
                "date": "2026-06-07",
                "views": 327860680
            },
            {
                "date": "2026-06-08",
                "views": 341995000
            }
        ],
        "source": "Wikimedia Pageviews",
        "project": "en.wikipedia",
        "granularity": "daily",
        "total_views": 2529731844
    },
    "meta": {
        "timestamp": "2026-06-10T13:59:42.131Z",
        "request_id": "4b824cc6-1fa5-44c7-adc2-103dc9a72305"
    },
    "status": "ok",
    "message": "Aggregate views retrieved successfully",
    "success": true
}
```

### Compare

#### `GET /v1/compare` — Rank several articles by total views

**Parameters:**
- `articles` (query, required, string) — Pipe/comma-separated article titles (2-6) Example: `Python_(programming_language)|Java_(programming_language)`
- `project` (query, optional, string) — Wiki project Example: `en.wikipedia`
- `from` (query, optional, string) — Start date YYYY-MM-DD Example: `2026-06-01`
- `to` (query, optional, string) — End date YYYY-MM-DD Example: `2026-06-08`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/wikitrends-api/v1/compare?articles=Python_%28programming_language%29%7CJava_%28programming_language%29&project=en.wikipedia&from=2026-06-01&to=2026-06-08"
```

**Response:**
```json
{
    "data": {
        "to": "2026-06-08",
        "from": "2026-06-01",
        "count": 2,
        "source": "Wikimedia Pageviews",
        "project": "en.wikipedia",
        "ranking": [
            {
                "days": 8,
                "rank": 1,
                "found": true,
                "title": "Python (programming language)",
                "article": "Python_(programming_language)",
                "total_views": 53020
            },
            {
                "days": 8,
                "rank": 2,
                "found": true,
                "title": "Java (programming language)",
                "article": "Java_(programming_language)",
                "total_views": 29365
            }
        ]
    },
    "meta": {
        "timestamp": "2026-06-10T13:59:42.291Z",
        "request_id": "ffe99c16-9a71-4e2b-b98d-afa18f5fb310"
    },
    "status": "ok",
    "message": "Comparison completed successfully",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Service metadata

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/wikitrends-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "note": "Pageview data lags ~1-2 days; range/date defaults end 2 days back. project defaults to en.wikipedia (a bare lang code like 'de' becomes de.wikipedia).",
        "source": "Wikimedia Pageviews REST API (wikimedia.org, live)",
        "service": "wikitrends-api",
        "endpoints": {
            "GET /v1/top": "Most-viewed articles for a day — the trending list (project=en.wikipedia, date=2026-06-08, limit=50, exclude_special=true).",
            "GET /v1/meta": "This document.",
            "GET /v1/article": "Daily/monthly pageview trend for one article (article=Cristiano_Ronaldo, project=en.wikipedia, from=2026-06-01, to=2026-06-08).",
            "GET /v1/compare": "Rank several articles by total views (articles=Python_(programming_language)|Java_(programming_language), from=2026-06-01, to=2026-06-08).",
            "GET /v1/aggregate": "A project's total pageviews over a range (project=en.wikipedia, from=2026-06-01, to=2026-06-08, granularity=daily)."
        },
        "description": "Live readership-trend data from the Wikimedia Pageviews API — the official measure of what the world is reading on Wikipedia and its sister projects. The top endpoint returns the most-viewed articles on any Wikipedia language edition for a given day (the daily trending list); the article endpoint returns the daily or monthly pageview trend for any single article over a date range; the aggregate endpoint returns a whole project's total pageviews over a r
…(truncated, see openapi.json for full schema)
```


---
Marketplace page: https://www.oanor.com/api/wikitrends-api
OpenAPI spec: https://www.oanor.com/api/wikitrends-api/openapi.json
