# Pageviews Wmcloud — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Access Wikipedia pageview analytics across articles, languages, and time periods. Retrieve per-article view counts, top-viewed pages, cross-language traffic breakdowns, site-wide aggregates, category-level mass analysis, redirect traffic attribution, user contribution metrics, and Wikimedia Commons media request counts.

**Category:** Other | **Website:** [pageviews.wmcloud.org/](https://pageviews.wmcloud.org/) | **Docs:** [parse.bot/marketplace/b19f458a-d749-44f1-a20a-74c7a291a36d/pageviews-wmcloud-org-api](https://parse.bot/marketplace/b19f458a-d749-44f1-a20a-74c7a291a36d/pageviews-wmcloud-org-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-pageviews-wmcloud-org-api-b19f458a/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_langviews

Fetch pageview counts for a single Wikipedia page across the top 30 language editions by traffic. Returns total views per language for the specified date range.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `agent` | string | No | Agent type filter. |
| `page` | string | Yes | Page title (e.g. 'Cat'). |
| `platform` | string | No | Platform filter. |
| `project` | string | No | Source project domain used to resolve the Wikidata entity. |
| `range` | string | No | Date range preset. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-pageviews-wmcloud-org-api-b19f458a/get_langviews \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"agent":"<string>","page":"<string>","platform":"<string>","project":"<string>","range":"<string>"}'
```

### get_massviews

Fetch pageview counts for pages belonging to a Wikipedia category or linked from a page. Returns up to 50 pages sorted by total views descending.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `agent` | string | No | Agent type filter. |
| `platform` | string | No | Platform filter. |
| `range` | string | No | Date range preset. |
| `source` | string | No | Source type for page discovery. |
| `target` | string | Yes | Category name (without 'Category:' prefix) or page title for wikilinks source. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-pageviews-wmcloud-org-api-b19f458a/get_massviews \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"agent":"<string>","platform":"<string>","range":"<string>","source":"<string>","target":"<string>"}'
```

### get_mediaviews

Fetch media request counts for one or more Wikimedia Commons files over a date range. Returns a map keyed by file name with daily request data and total counts.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `files` | string | Yes | Pipe-separated file names without 'File:' prefix (e.g. 'Cat_poster_1.jpg\|Dog.jpg'). |
| `project` | string | No | Project domain where the files are hosted. |
| `range` | string | No | Date range preset. |
| `referer` | string | No | Referer filter. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-pageviews-wmcloud-org-api-b19f458a/get_mediaviews \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"files":"<string>","project":"<string>","range":"<string>","referer":"<string>"}'
```

### get_pageviews

Fetch pageview counts for one or more Wikipedia pages over a date range, including daily breakdown, totals, and optional metadata (edits, editors, page size, protection status). Returns a map keyed by page title.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `agent` | string | No | Agent type filter. |
| `end` | string | No | End date in YYYY-MM-DD format. Must be used together with start. |
| `pages` | string | Yes | Pipe-separated list of page titles (e.g. 'Cat\|Dog'). |
| `platform` | string | No | Platform filter. |
| `project` | string | No | Wikipedia project domain (e.g. en.wikipedia.org, de.wikipedia.org). |
| `range` | string | No | Date range preset. Ignored if start and end are provided. |
| `start` | string | No | Start date in YYYY-MM-DD format. Must be used together with end. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-pageviews-wmcloud-org-api-b19f458a/get_pageviews \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"agent":"<string>","end":"<string>","pages":"<string>","platform":"<string>","project":"<string>","range":"<string>","start":"<string>"}'
```

### get_redirectviews

Fetch pageview counts broken down by all redirect pages pointing to a given Wikipedia article. Fetches up to 20 redirects to avoid timeouts on popular pages.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `page` | string | Yes | Canonical page title (e.g. 'Cat'). |
| `project` | string | No | Project domain. |
| `range` | string | No | Date range preset. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-pageviews-wmcloud-org-api-b19f458a/get_redirectviews \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"page":"<string>","project":"<string>","range":"<string>"}'
```

### get_siteviews

Fetch total pageview counts for one or more Wikimedia projects (sites) over time with daily granularity. Returns a map keyed by site domain.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `agent` | string | No | Agent type filter. |
| `platform` | string | No | Platform filter. |
| `range` | string | No | Date range preset. |
| `sites` | string | Yes | Pipe-separated list of site domains (e.g. 'en.wikipedia.org\|de.wikipedia.org'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-pageviews-wmcloud-org-api-b19f458a/get_siteviews \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"agent":"<string>","platform":"<string>","range":"<string>","sites":"<string>"}'
```

### get_topviews

Fetch the most-viewed pages for a given Wikipedia project and date. Returns up to 1000 top articles ranked by view count.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `date` | string | No | Date in YYYY-MM-DD format or the literal string 'yesterday'. |
| `platform` | string | No | Platform filter. |
| `project` | string | No | Wikipedia project domain. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-pageviews-wmcloud-org-api-b19f458a/get_topviews \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"date":"<string>","platform":"<string>","project":"<string>"}'
```

### get_userviews

Fetch pageview counts for articles created by a specific Wikipedia user. Returns up to 30 articles the user created in the main namespace, sorted by total views descending.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `project` | string | No | Project domain. |
| `range` | string | No | Date range preset. |
| `user` | string | Yes | Wikipedia username (e.g. 'Cullen328'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-pageviews-wmcloud-org-api-b19f458a/get_userviews \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"project":"<string>","range":"<string>","user":"<string>"}'
```
