# Wikimedia Commons Media Scraper (`parseforge/wikimedia-commons-media-scraper`) Actor

Scrapes media file metadata from Wikimedia Commons by search query, category, or exact File: titles. Returns each file as a flat row with its URL, description, author, license, and dimensions.

- **URL**: https://apify.com/parseforge/wikimedia-commons-media-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Education, Automation, Developer tools
- **Features:** Limited permissions
- **Stats:** 14 total users, 2 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.85 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

[![ParseForge](https://raw.githubusercontent.com/ParseForge/apify-assets/main/banner-v4.webp)](https://apify.com/parseforge?fpr=vmoqkp)

### Wikimedia Commons Media Scraper

**Scrape media file metadata from Wikimedia Commons by search query, category, or exact file title, up to a million per run.** Each file comes with its URL, description, author, license, and dimensions. No API key required. Export to CSV, JSON, Excel, or XML.

Wikimedia Commons holds over 100 million freely licensed media files, but browsing categories or running manual searches is slow when you need structured data. This Actor reads the public API directly, letting you pull file metadata in bulk from any search term, category, or a list of exact File: page titles. You get a clean dataset of URLs, authors, licenses, and image dimensions, ready for your content pipeline or research project.

| Who uses it | What they scrape Wikimedia Commons for |
|---|---|
| Content creators | Build a searchable catalog of freely licensed images for a specific topic |
| Digital archivists | Harvest metadata from entire Commons categories for preservation projects |
| SEO specialists | Gather image URLs and attribution details for compliant media use on websites |
| Researchers | Analyze the distribution of media types, licenses, or authors across topics |

### What it does

This Actor collects media file metadata from Wikimedia Commons by search, category, or exact title, and returns each file as a flat row with its URL, description, author, license, and dimensions.

- 🔍 **Search by query:** Enter any free-text term like 'mona lisa' or 'golden gate bridge' and get matching media files.
- 📂 **Files in a category:** Provide a category name such as 'Cats' or 'Category:Bridges in Paris' and list all files within it.
- 📋 **Exact File: titles:** Supply a list of specific File: page titles like 'File:Mona Lisa.jpg' and fetch their metadata directly.

Results export to CSV, JSON, Excel, or XML, or straight from the API.

### What you can do with Wikimedia Commons data

**🖼️ Build a topic-based image catalog.**

A content creator searches for 'solar system' and exports a CSV of all matching Commons images with their license and attribution, ready for a blog or video project.

**📚 Harvest an entire category for archival.**

A digital archivist scrapes the 'Category:Historical photographs of Berlin' to preserve metadata and file URLs before a website migration.

**🔎 Audit license compliance across a media library.**

An SEO specialist pulls metadata for a list of File: titles already used on a client site to verify each image still carries a valid Creative Commons license.

**📊 Analyze media type distribution in a domain.**

A researcher scrapes a category like 'Diagrams of human anatomy' and aggregates the data by file type and author to understand contribution patterns.

### Why choose this scraper

|  | What you get |
|---|---|
| **No API key** | Reads the public Wikimedia API with no registration or authentication required. |
| **Bulk extraction** | Collect up to a million file records in a single run for large-scale projects. |
| **Fixed schema** | Every file returns the same fields: URL, description, author, license, dimensions, and more. |
| **Flexible input** | Mix search terms, categories, and exact titles across runs without changing the setup. |

### How it compares

No other Store actor targets Wikimedia Commons the same way, so the honest comparison is with the alternatives teams actually weigh.

| | Wikimedia Commons Media Scraper | Build it in-house | By hand |
|---|---|---|---|
| Setup | Run it now, zero config | Days of engineering | None, but hours per pull |
| When Wikimedia Commons changes | Maintained for you | You fix it | You re-learn the page |
| Proxies, retries, anti-bot | Built in | Your problem | Browser only |
| Output | Fixed JSON schema, CSV/Excel export | Whatever you build | Copy-paste |
| Cost | Pay per result | Engineering time | Analyst hours |

### Configure the run

Drive the Actor from search queries, category names, and exact file titles, alone or together, and set a maximum item limit so only the files you need reach your dataset. The Input tab lists every parameter.

A first run with the defaults:

```json
{
  "search": "cat",
  "titles": [
    "File:Mona Lisa.jpg"
  ],
  "maxItems": 10
}
```

A larger pull:

```json
{
  "search": "cat",
  "titles": [
    "File:Mona Lisa.jpg"
  ],
  "maxItems": 200
}
```

### Pricing

Pay-per-result: **$0.0063 per result** collected. You pay only for the results written to your dataset.

| Results collected | Approximate cost |
|---|---|
| 100 results | $0.63 |
| 1,000 results | $6.30 |
| 10,000 results | $63.00 |

New Apify accounts start with $5 in free credit.

### Free users

Free-plan runs return up to 10 results as a preview. [Upgrade your Apify plan](https://console.apify.com/sign-up?fpr=vmoqkp) to collect up to 1,000,000 results per run.

### Run it

1. [Create a free Apify account with $5 in credit](https://console.apify.com/sign-up?fpr=vmoqkp).
2. Open the [Wikimedia Commons Media Scraper](https://apify.com/parseforge/wikimedia-commons-media-scraper?fpr=vmoqkp).
3. Set your inputs and any filters, then click **Start**.
4. Export the results as CSV, Excel, JSON, or XML from the **Dataset** tab.

Run it programmatically through the [Apify API](https://docs.apify.com/api/v2) (`run-sync-get-dataset-items`) or the [ApifyClient](https://docs.apify.com/api/client/js) for JavaScript and Python.

### Use with AI agents (MCP)

Give an AI agent live access to Wikimedia Commons through the Model Context Protocol. Add the Actor to Claude, Cursor, or any MCP client:

```bash
claude mcp add --transport http apify "https://mcp.apify.com?tools=parseforge/wikimedia-commons-media-scraper"
```

Then prompt it in plain language to run the scraper and read back the results.

### Troubleshooting

**Why am I getting no results for my search query?**

Check that your search term is spelled correctly and is not too specific. Try a broader term first. Also confirm that the Mode is set to 'Search files by query' and that you have not accidentally left a category or titles list filled in.

**The Actor returns fewer files than my maxItems setting.**

The Actor stops when it has collected your requested number of files or when the source runs out of matching results. If the category is small or the search query is narrow, fewer files will be returned.

**My category input is not returning any files.**

Verify the category name exists on Wikimedia Commons. You can enter it with or without the 'Category:' prefix. Try browsing the category on commons.wikimedia.org first to confirm it contains files.

**Some files in my results are missing author or license information.**

Wikimedia Commons metadata is community-contributed, and some files may have incomplete information. The Actor returns whatever metadata is available; empty fields mean the data was not provided on the file's page.

**The run takes a long time with a high maxItems value.**

Large requests can take time because the Actor respects the API's rate limits. Reduce the maxItems value or split your request into multiple smaller runs by using narrower categories or more specific search terms.

### FAQ

| Question | Answer |
|---|---|
| Do I need a Wikimedia account or API key to use this Actor? | No. The Actor reads the public Wikimedia Commons API, which does not require authentication or an API key for read access. |
| What metadata fields does the Actor return for each file? | Each row includes the file URL, page URL, title, description, author, license, file type, dimensions, and the date it was uploaded. The exact field list is shown in the sample output on the Actor's page. |
| Can I scrape both images and other media types like videos or audio? | Yes. Wikimedia Commons contains images, videos, audio files, and documents. The Actor returns metadata for any media type that matches your input. |
| How do I scrape all files inside a specific Commons category? | Set the Mode to 'Files in a category' and enter the category name, with or without the 'Category:' prefix. The Actor will list every file in that category up to your maximum item limit. |
| What is the difference between search mode and category mode? | Search mode runs a full-text query across file titles and descriptions, like using the search box on the Commons website. Category mode returns every file that belongs to a specific Commons category, regardless of its title or description text. |
| Can I provide a list of specific file names to scrape? | Yes. Use the 'Exact File: titles' mode and paste a list of File: page titles, such as 'File:Mona Lisa.jpg'. The Actor fetches metadata only for those exact files. |
| How many files can I collect in one run? | You can set the maximum up to 1,000,000 files per run. The Actor stops when it reaches your limit or when no more matching files are available. |
| Does the Actor download the actual media files? | No. It collects metadata about the files, including the direct URL where the file can be downloaded. You can use that URL in a separate download step if needed. |
| What export formats are supported? | You can export your dataset as CSV, JSON, Excel, or XML from the Apify platform after the run completes. |
| Is the license information included so I can attribute correctly? | Yes. The Actor returns the license name and, where available, the author and attribution details required by Creative Commons and other free licenses. |

### Related actors

Browse the full [ParseForge collection](https://apify.com/parseforge?fpr=vmoqkp) for more scrapers.

🆘 **Need help?** Email parseforge@protonmail.com with your run ID, your input, and what you expected.

⚠️ **Disclaimer.** This Actor is unofficial and is not affiliated with, endorsed by, or sponsored by Wikimedia Foundation, Inc. It collects only publicly available data. You are responsible for using the collected data in compliance with the source's terms of service and applicable data-protection laws, including GDPR, CCPA, and PIPL. Do not use it to collect personal data unlawfully.

# Actor input Schema

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

How to find media files on Wikimedia Commons. 'Search' runs a full text file search. 'Category' lists files in a category. 'Titles' fetches an exact list of File: pages you provide.

## `search` (type: `string`):

Only used when Mode is 'Search files by query'. A free text query, for example 'mona lisa' or 'golden gate bridge'. Leave empty for other modes.

## `category` (type: `string`):

Only used when Mode is 'Files in a category'. A category name with or without the 'Category:' prefix, for example 'Cats' or 'Category:Bridges in Paris'. Leave empty for other modes.

## `titles` (type: `array`):

Only used when Mode is 'Exact File: titles'. A list of File: page titles, for example 'File:Mona Lisa.jpg'. Leave empty for other modes.

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

How many media files to collect per run.

## Actor input object example

```json
{
  "mode": "search",
  "search": "cat",
  "titles": [
    "File:Mona Lisa.jpg"
  ],
  "maxItems": 10
}
```

# Actor output Schema

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

No description

# 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 = {
    "search": "cat",
    "titles": [
        "File:Mona Lisa.jpg"
    ],
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/wikimedia-commons-media-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 = {
    "search": "cat",
    "titles": ["File:Mona Lisa.jpg"],
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("parseforge/wikimedia-commons-media-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 '{
  "search": "cat",
  "titles": [
    "File:Mona Lisa.jpg"
  ],
  "maxItems": 10
}' |
apify call parseforge/wikimedia-commons-media-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,parseforge/wikimedia-commons-media-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/qUR5k3CYYnEUKbXfC/builds/jAEN0VDqX9GFZMTIm/openapi.json
