# Wikimedia Commons SDC Scraper (`parseforge/wikimedia-commons-sdc-scraper`) Actor

Scrape structured data (SDC) from Wikimedia Commons media files by entity ID. Returns property-value pairs, qualifiers, and references for each file.

- **URL**: https://apify.com/parseforge/wikimedia-commons-sdc-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Other, AI, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.62 / 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?

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

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

### Wikimedia Commons SDC Scraper

**Scrape structured data from any Wikimedia Commons media file, up to a million entities per run.** Each file returns its SDC statements, property-value pairs, qualifiers, and references as a flat row. No login or API key. Export to CSV, JSON, Excel, or XML.

Wikimedia Commons hosts millions of media files, each with structured data (SDC) that describes the file's content, creator, license, and more. The official API requires complex queries and doesn't expose SDC directly. This actor reads the SDC from file pages and returns each entity's data in a consistent schema.

| Who uses it | What they scrape Wikimedia Commons SDC for |
|---|---|
| Digital asset managers | To audit metadata completeness across a library of Commons files. |
| Data scientists | To build datasets of image metadata for training or analysis. |
| GLAM institutions | To extract rights and provenance data from their contributed media. |
| Wikimedians | To monitor SDC usage or find files missing key statements. |

### What it does

This actor collects structured data (SDC) from Wikimedia Commons media files by entity ID, and returns each file's property-value pairs, qualifiers, and references as a flat row.

- **Structured data extraction:** Each file returns all SDC statements, including property IDs, values, qualifiers, and references.
- **Bulk by entity ID:** Input a comma-separated list of entity IDs (e.g. M123456) to scrape them all in one run.
- **Flat output:** Every entity becomes one row with columns for each property, so you can filter and analyze in any tool.

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

### What you can do with Wikimedia Commons SDC data

**Audit metadata completeness.**

A GLAM institution runs the actor on its contributed files to find which ones lack required SDC statements like creator or license.

**Build a research dataset.**

A data scientist collects SDC from thousands of images to study how Commons contributors describe cultural heritage objects.

**Monitor SDC adoption.**

A Wikimedia project manager tracks how many files in a category have SDC statements, using the actor to sample and count.

**Migrate metadata.**

A digital library extracts SDC from Commons files to map the data into its own metadata schema for reuse.

### Why choose this scraper

| | What you get |
|---|---|
| **Property IDs** | The SDC property (e.g. P180 for depicts) for each statement. |
| **Values** | The value of each property, which can be a string, URL, or another entity ID. |
| **Qualifiers** | Additional context for a statement, like precision or source. |
| **References** | The source or evidence for each statement, if provided. |
| **Flat schema** | All data in one row per file, ready for spreadsheets or databases. |

### What a Wikimedia Commons SDC record looks like

Every record returns as one flat JSON row. Here is a real one from a run:

```json
{
 "imageUrl": "https://commons.wikimedia.org/wiki/M123456",
 "entity_id": "M123456",
 "entity_type": "mediainfo",
 "media_type": "image/png",
 "sha1_hash": "3fedc6d4d11a97d49558cfa12d55f916bbf9215f",
 "sha1_determination_method": "Q13414952",
 "data_size_bytes": 6197,
 "data_size_unit": "byte",
 "height_pixels": 169,
 "height_unit": "pixel",
 "width_pixels": 62,
 "width_unit": "pixel",
 "scrapedAt": "2026-08-26T17:53:12.705Z"
}
```

Every value above comes from a real run. A field a record does not have comes back as `null`.

### Configure the run

Drive the actor from a list of Wikimedia Commons entity IDs. Each ID corresponds to a media file; the actor reads the SDC from its page and returns only the structured data statements. The Input tab lists every parameter.

A first run with the defaults:

```json
{
 "entityIds": "M123456",
 "maxItems": 10
}
```

A larger pull:

```json
{
 "entityIds": "M123456",
 "maxItems": 200
}
```

### 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](https://console.apify.com/sign-up?fpr=vmoqkp).
2. Open the [Wikimedia Commons SDC Scraper](https://apify.com/parseforge/wikimedia-commons-sdc-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 SDC 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-sdc-scraper"
```

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

### Troubleshooting

**Why am I getting no results?**

Check that your entity IDs are valid and start with 'M' followed by digits. Also ensure the files exist on Commons and are not deleted or restricted.

**The actor returns empty data for some files.**

Some files may have no structured data (SDC) at all. The actor will still list the file but with empty SDC fields. Verify the file page has SDC statements.

**My run is taking too long.**

Large lists of entity IDs can take time. The actor processes each file individually. Consider reducing the number of IDs or upgrading your Apify plan for faster runs.

**I see an error about invalid entity ID.**

Entity IDs must be in the format M followed by digits (e.g. M123456). Remove any spaces or extra characters from your list.

**The output has too many columns.**

The flat schema creates a column for each unique property found across all files. If you need a simpler output, filter the dataset after export.

### FAQ

| Question | Answer |
|---|---|
| What is an entity ID on Wikimedia Commons? | An entity ID is a code like M123456 that identifies a media file in the Commons database. You can find it in the file's URL or its page source. |
| How do I find entity IDs for the files I want? | You can get entity IDs from Commons category pages, search results, or by using the Commons API to list files. The actor expects a comma-separated list of these IDs. |
| What data does the actor return? | It returns the structured data statements for each file, including property IDs, values, qualifiers, and references. The exact fields depend on what SDC is present on the file page. |
| Can I scrape all files in a category? | The actor currently works from a list of entity IDs. To scrape a category, you would first get the file list from Commons and then pass the IDs to this actor. |
| Is there a limit on how many files I can scrape? | Free users are limited to 10 items for preview. Paid users can set a max up to 1,000,000 entities per run. |
| Do I need a Wikimedia account or API key? | No. The actor reads public file pages directly. No login or API key is required. |
| What export formats are available? | You can export the results as CSV, JSON, Excel, or XML from the Apify dataset. |
| How does the actor handle files with no SDC? | Files without any structured data will still appear in the results, but the SDC columns will be empty or null. |
| Can I scrape files from other Wikimedia projects like Wikipedia? | No. This actor is designed specifically for Wikimedia Commons SDC. Other projects use different data structures. |
| What if a file has multiple statements for the same property? | The actor returns all statements. In the flat output, multiple values for the same property may appear in separate rows or concatenated, depending on the schema. |

### 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.

### 💰 How much does it cost to scrape Wikimedia Commons SDC?

This Actor uses **pay-per-result** pricing: **$0.004 per result** collected. You are billed only for the results you receive, so a run that returns nothing costs nothing.

# Actor input Schema

## `entityIds` (type: `string`):

Comma-separated list of Wikimedia Commons entity IDs (e.g. M123456). Each ID corresponds to a media file with structured data.

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

Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000

## Actor input object example

```json
{
  "entityIds": "M123456",
  "maxItems": 10
}
```

# Actor output Schema

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

Complete dataset of all scraped records.

# 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 = {
    "entityIds": "M123456",
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/wikimedia-commons-sdc-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 = {
    "entityIds": "M123456",
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("parseforge/wikimedia-commons-sdc-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 '{
  "entityIds": "M123456",
  "maxItems": 10
}' |
apify call parseforge/wikimedia-commons-sdc-scraper --silent --output-dataset

```

## MCP server setup

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