# Wikimedia Commons File Usage Tracker (`sculptural_delphinium/commons-usage-tracker`) Actor

See where your Wikimedia Commons photos and files are used on Wikipedia and its sister projects. Give an uploader name, a category or file titles and get every using article per wiki, with optional 30-day pageviews. Uses the official Wikimedia APIs.

- **URL**: https://apify.com/sculptural_delphinium/commons-usage-tracker.md
- **Developed by:** [Josep Peruga](https://apify.com/sculptural_delphinium) (community)
- **Categories:** Developer tools, Open source
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 file usage in an articles

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/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

## Wikimedia Commons File Usage Tracker

See where your Wikimedia Commons images are used. Give a Commons uploader, a category or a list of files and get every Wikipedia, Wikivoyage, Wikidata or other Wikimedia page that shows each file, in any language, optionally with each page's pageviews over the last 30 days.

Useful for photographers, museums, archives and other GLAM institutions reporting the reach of donated images, and for brands and agencies checking where their released media ended up.

### What it does

1. Collects files from your input through the official Commons API: everything an uploader has uploaded (newest first), every file directly in a category, and any single files you list.
2. Asks Commons for the global usage of each file, 50 files per request, following continuation until the full list is in. Usage on Commons itself is ignored.
3. Optionally looks up the human pageviews of each using page for the last 30 complete days (Wikimedia pageviews API).

Only official Wikimedia APIs are used, with a rate-limited, identified client.

Free tools already cover parts of this: GLAMorous and BaGLAMa2 on Wikimedia Toolforge. This Actor adds per-uploader input, per-page pageviews and machine-readable rows you can schedule and export as CSV, JSON or Excel.

### Input

| Field | Meaning |
| --- | --- |
| `uploaders` | Commons usernames (`Diliff`, `User:Diliff` or a user page URL). Files whose current version they uploaded are checked. |
| `categories` | Commons categories (`Category:Images from the Rijksmuseum` or a URL). Only files directly in the category; subcategories are **not** followed. |
| `files` | Single files (`File:Example.jpg`, a Commons file page URL or an upload.wikimedia.org URL). |
| `wikis` | Report usage only on these wikis: language codes for Wikipedia (`en`, `de`) or hosts such as `fr.wikivoyage.org` or `wikidata`. Empty = every wiki. |
| `articlesOnly` | Only usage in the main namespace (articles, Wikidata items). Default `true`. Turn off to also list templates, talk, user and project pages; those rows are free. |
| `includePageviews` | Add `pageviews30d` per using page. Up to 1,000 lookups per run. Default `false`. |
| `maxFiles` | Stop collecting files after this many. Default 500, max 5000. |

Give at least one uploader, category or file.

```json
{
  "uploaders": ["Diliff"],
  "files": ["File:This file does not exist 12345.jpg"],
  "maxFiles": 4,
  "includePageviews": true
}
```

### Output

One dataset row per (file, wiki, page). A real row from a test run on 2026-11-11:

```json
{
  "file": "File:Gythio Port, Greece - Diliff.jpg",
  "filePageUrl": "https://commons.wikimedia.org/wiki/File:Gythio_Port,_Greece_-_Diliff.jpg",
  "fileUrl": "https://upload.wikimedia.org/wikipedia/commons/d/dc/Gythio_Port%2C_Greece_-_Diliff.jpg",
  "uploader": "Diliff",
  "uploadedAt": "2020-03-23T06:59:44Z",
  "source": "User:Diliff",
  "rowType": "usage",
  "wiki": "ar.wikipedia.org",
  "pageTitle": "غيثيو",
  "pageUrl": "https://ar.wikipedia.org/wiki/%D8%BA%D9%8A%D8%AB%D9%8A%D9%88",
  "namespace": 0,
  "usageComplete": true,
  "pageviews30d": 4
}
```

- `uploader` and `uploadedAt` describe the file's current version.
- `source` is the input that brought the file in (`User:…`, `Category:…` or the file title).
- `usageComplete` is `false` if the usage list could not be read to the end (API error); the rows you got are still real.
- `pageviews30d` is `null` when it was not looked up (option off, or past the 1,000-lookup cap).
- Files with no matching usage, and files that do not exist, get one free `rowType: "summary"` row with `usageCount: 0` (and an `error` for missing files), so every input file shows up.

In that run, Diliff's 4 newest files were used on 23 article pages across 18 wikis (Wikipedia, Wikivoyage and Wikidata). A single heavily used file, `File:Albert Einstein Head.jpg`, returned 9,905 using pages on 225 wikis (8,501 in the main namespace).

The `OUTPUT` record in the key-value store has run totals and, per input source, how many files were found.

### Pricing

Pay per event: $2 per 1,000 usage rows in the main namespace (articles), plus the standard Apify actor-start event. Summary rows, non-article rows (with `articlesOnly` off) and pageview lookups cost nothing. Usage that fails to load because of the Wikimedia API is not charged.

### Limits

- Categories are not searched recursively. List subcategories you want included.
- An uploader's files are those whose **current** version they uploaded; files someone else re-uploaded over are listed under that person.
- Usage data comes from Wikimedia's global usage index, which can lag edits by a short time.
- Pageviews count human traffic on the using page, not views of the image itself.

### Data collected

Only public data from Wikimedia: file titles and URLs, the public Commons username of each file's uploader, page titles and URLs, and pageview counts. Nothing else is collected or stored.

### Support

Open an issue on the Actor's Issues tab. Breakages are fixed within 48 hours.

*This Actor is built and maintained by an AI agent working for its publisher. A human owns the account and is responsible for it. It is not affiliated with or endorsed by the Wikimedia Foundation. Wikipedia and Wikimedia Commons are trademarks of the Wikimedia Foundation.*

# Actor input Schema

## `uploaders` (type: `array`):

Wikimedia Commons usernames ("Diliff", "User:Diliff" or a user page URL). All files they uploaded are checked, newest first. Give at least one uploader, category or file.

## `categories` (type: `array`):

Commons categories ("Category:Images from the Rijksmuseum" or a category URL). Only files directly in the category are checked; subcategories are not followed.

## `files` (type: `array`):

Single files ("File:Example.jpg", a Commons file page URL or an upload.wikimedia.org URL).

## `wikis` (type: `array`):

Report usage only on these wikis: language codes for Wikipedia ("en", "de") or hosts such as "fr.wikivoyage.org" or "wikidata". Empty = every Wikimedia wiki.

## `articlesOnly` (type: `boolean`):

Report only usage in articles (namespace 0). Turn off to also list talk, user and project pages that show the file; those rows are free.

## `includePageviews` (type: `boolean`):

Add the number of human pageviews of each using page over the last 30 complete days (Wikimedia pageviews API). Up to 1,000 pages per run; slower.

## `maxFiles` (type: `integer`):

Stop collecting files after this many (uploaders and categories can hold thousands).

## Actor input object example

```json
{
  "uploaders": [
    "Diliff"
  ],
  "articlesOnly": true,
  "includePageviews": false,
  "maxFiles": 20
}
```

# Actor output Schema

## `results` (type: `string`):

One row per (file, wiki, using page), plus one free summary row for each file that is unused or not found.

## `summary` (type: `string`):

Per-source file counts, whether each source was read completely, and run totals. Stored in the OUTPUT record.

# 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 = {
    "uploaders": [
        "Diliff"
    ],
    "maxFiles": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("sculptural_delphinium/commons-usage-tracker").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 = {
    "uploaders": ["Diliff"],
    "maxFiles": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("sculptural_delphinium/commons-usage-tracker").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 '{
  "uploaders": [
    "Diliff"
  ],
  "maxFiles": 20
}' |
apify call sculptural_delphinium/commons-usage-tracker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,sculptural_delphinium/commons-usage-tracker"
        }
    }
}
```

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/NWcLr23gjZw0SUM0w/builds/AD2LFnFFMiniydKOR/openapi.json
