ParseForge Scrapers

Wikimedia Commons Template Scraper

parseforge/wikimedia-commons-templates-scraper

Developer toolsOther

Scrapes template pages from Wikimedia Commons via the public API. Returns each template's page ID, namespace, and title as a flat row. Filter by search term and set a max items limit.

Run this scraper See the API call
Total runs
3
Bookmarked
0
Last modified
17 hours ago

This scraper was last updated on .

What does the Wikimedia Commons Template Scraper return?

ParseForge

Wikimedia Commons Template Scraper

Scrape template content and metadata from Wikimedia Commons, up to a million per run. Every template comes with its page ID, namespace, and title. No API key or login required. Export to CSV, JSON, Excel, or XML.

Wikimedia Commons hosts thousands of templates that structure its media descriptions, licenses, and navigation. Finding and extracting their raw content or metadata manually is slow and repetitive. This Actor reads the public Wikimedia Commons API directly, filters templates by a search term, and returns each match in one fixed schema.

Who uses it What they scrape Wikimedia Commons for
Digital archivists Catalog which metadata templates are available for a specific media collection.
WikiProject maintainers Audit template usage and naming conventions across a Commons category.
GLAM professionals Identify the correct Commons templates for institution-specific upload campaigns.
Bot developers Build a local index of template titles to automate file description edits.

What it does

This Actor collects Wikimedia Commons template pages by search term or retrieves all templates, and returns each one as a flat row with its page ID, namespace, and title.

  • ๐Ÿ” Search filter: supply a search term to retrieve only templates whose title contains that string.
  • ๐Ÿ“„ Bulk retrieval: leave the search term empty to fetch every template in the Template namespace.
  • โš™๏ธ Max items control: set a hard limit on the number of templates returned, from 1 up to 1,000,000.

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

What you can do with Wikimedia Commons data

๐Ÿ—‚๏ธ Build a template inventory.

A digital archivist runs the Actor without a search term to get a complete list of all Commons templates, then filters the CSV for institution-related names.

๐Ÿ”Ž Find a specific license template.

A GLAM upload coordinator searches for 'CC-BY' to retrieve every Creative Commons license template title and its page ID for a batch upload script.

๐Ÿค– Feed a bot with template metadata.

A bot developer scrapes all template titles and page IDs once a week to keep a local lookup table for automated file description corrections.

๐Ÿ“Š Audit template naming patterns.

A WikiProject maintainer searches for 'Information' to list all information-template variants, then reviews the titles for consistency.

Why choose this scraper

What you get
Template title The exact page name of each template in the Commons Template namespace.
Page ID The stable numeric identifier for every template page.
Namespace Confirms the page belongs to the Template namespace (ns=10).
Flat output Every template is a single row, ready for spreadsheets or databases.

What a Wikimedia Commons record looks like

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

{
 "pageId": 3716844,
 "namespace": 10,
 "title": "Template:!!",
 "scrapedAt": "2026-09-04T04:56:51.035Z"
}

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 with an optional search term to filter templates by title, and set a maximum number of items to control the output size. The Input tab lists every parameter.

A first run with the defaults:

{
 "maxItems": 10
}

A larger pull:

{
 "maxItems": 200
}

Free users

Free-plan runs return up to 10 results as a preview. Upgrade your Apify plan to collect up to 1,000,000 results per run.

Run it

  1. Create a free Apify account with $5 in credit.
  2. Open the Wikimedia Commons Template Scraper.
  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 (run-sync-get-dataset-items) or the ApifyClient 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:

claude mcp add --transport http apify "https://mcp.apify.com?tools=parseforge/wikimedia-commons-templates-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 term?

The search does a prefix match on the template title. Check that your term matches the beginning of a template name. Try a shorter or more general prefix.

The run stopped before reaching my max items limit.

The Actor stops when the API returns no more matching templates. If your search term is specific, there may be fewer templates than your max items value.

I get an error about the API request failing.

Wikimedia Commons may occasionally rate-limit or have downtime. The Actor will retry automatically. If the problem persists, wait a few minutes and run it again.

The output only shows 10 items even though I set a higher max.

Free Apify accounts are capped at 10 items for this Actor. Upgrade to a paid plan to scrape more than 10 templates per run.

FAQ

Question Answer
Does this Actor download the template wikitext or the metadata? It returns the metadata for each template page: the page ID, namespace, and title. It does not fetch the raw wikitext content of the template.
Do I need a Wikimedia account or API key to use this? No. The Actor uses the public Wikimedia Commons API, which requires no authentication or API key.
How many templates can I scrape in one run? Free users are limited to 10 items for a preview. Paid users can set the max items up to 1,000,000 per run.
Can I filter templates by namespace other than Template? No, this Actor is hardcoded to the Template namespace (ns=10) on Wikimedia Commons. It cannot retrieve pages from other namespaces.
What format does the output come in? You can export the dataset as CSV, JSON, Excel, or XML from the Apify platform.
Does the search term support wildcards or regular expressions? The search term is passed to the Wikimedia API's 'apfrom' parameter, which does a prefix-based string match. It does not support wildcards or regex.
Will this Actor work for other Wikimedia projects like Wikipedia? No, it is configured specifically for Wikimedia Commons. For Wikipedia templates, you would need a different Actor targeting that site's API.
How often is the template data updated? The Actor fetches data live from the Wikimedia Commons API on each run, so you always get the current state of the templates.

๐Ÿ†˜ Need help? Email parseforge@protonmail.com with your run ID, your input, and what you expected.

What input does the Wikimedia Commons Template Scraper accept?

FieldTypeWhat it doesDefault
maxItems integer Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000 10
search string Optional search term to filter templates by title. Leave empty to retrieve all templates. not set

How much does the Wikimedia Commons Template Scraper cost?

from $3.62 per 1,000 results

Charged forWhat it isPrice each
result Single result in the default dataset. $0.00362 to $0.004

Tiered: the lower figure is the price on a higher Apify plan. Billing and the free credit live on Apify.

How do I call the Wikimedia Commons Template Scraper API?

One POST returns the dataset directly. Same shape for every scraper in the library, so swapping the slug is the only change.

POST ยท run and get results
curl -X POST "https://api.apify.com/v2/acts/parseforge~wikimedia-commons-templates-scraper/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "maxItems": 10
  }'

What example inputs can I use?

Use these inputs to see how a run is configured.

input.json
{
  "maxItems": 10
}

What do users say about the Wikimedia Commons Template Scraper?

No reviews yet. Be the first.

How do I report an issue with the Wikimedia Commons Template Scraper?

We build and maintain this scraper, so a problem with it comes to us. Report it on the Apify listing and the thread stays attached to the scraper where the next person can find it: open an issue.

Broken and urgent, or you would rather not post in public? Write to parseforge@protonmail.com and it reaches the people who wrote it.

What related scrapers can I use?

Run Wikimedia Commons Template Scraper on Apify All scrapers