# Wikimedia Commons Geolocated Files Scraper (`parseforge/wikimedia-commons-geo-scraper`) Actor

Queries Wikimedia Commons for files tagged with GPS coordinates and returns each matching record as a flat row with title, pageid, size, wordcount, snippet, and timestamp. Filter by any keyword.

- **URL**: https://apify.com/parseforge/wikimedia-commons-geo-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** AI, Travel, Other
- **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 Geolocated Files Scraper

**Scrape geolocated files from Wikimedia Commons by any search term, up to a million per run.** Each file record includes its title, page ID, size, word count, snippet, and timestamp, filtered by coordinates directly from the API. No login or API key needed. Export to CSV, JSON, Excel, or XML.

Wikimedia Commons hosts millions of freely licensed media files, many with embedded GPS coordinates, but finding and downloading those geolocated files in bulk is manual and slow. This Actor queries the Commons API for files tagged with location data, filters them by your search keywords, and returns every match in a single structured dataset. You can pull everything from a broad geographic category or zero in on geotagged photos of a specific landmark.

| Who uses it | What they scrape Wikimedia Commons for |
|---|---|
| GIS analysts | Building a corpus of openly licensed geotagged images for mapping projects. |
| Cultural heritage researchers | Cataloging location-specific archival photographs available on Wikimedia Commons. |
| Travel content creators | Finding free-to-use photos of destinations, landmarks, and natural sites with confirmed coordinates. |
| Machine learning engineers | Assembling a labeled dataset of images with precise latitude and longitude for geospatial models. |
| Open data journalists | Pulling geolocated media to illustrate stories with verifiable place-based evidence. |

### What it does

This Actor collects geolocated file records from Wikimedia Commons by search query and namespace, and returns each as a flat row with title, page ID, size, word count, snippet, and timestamp.

- 📍 **Geolocation-only filtering:** The search defaults to `haswbstatement:P625`, which returns only files that carry a coordinate statement.
- 🔢 **Namespace control:** Restrict results to the File namespace (6) by default, keeping replies clean and media-focused.
- 🔍 **Keyword narrowing:** Add a place name, monument name, or topic to the search query to return only geotagged files that match.
- 📦 **Bulk retrieval:** Paid users can export up to 1,000,000 records in a single run; free users can preview up to 10.

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

### What you can do with Wikimedia Commons data

**🗺️ Build an open geotagged photo map.**

A GIS analyst feeds a country name as a search term, collects thousands of geolocated Commons file records, and publishes an interactive map of freely reusable images.

**📸 Find free travel photos by exact location.**

A content creator searches for 'Eiffel Tower' with the default coordinate filter, gets only geotagged results, and downloads images that are safe for commercial reuse.

**🏛️ Catalogue heritage-site images with coordinates.**

A researcher runs the Actor with a monument name, exports a CSV of geolocated archival photographs, and cross-references them with a UNESCO site database.

**🤖 Train a geospatial computer vision model.**

An ML engineer scrapes Commons files tagged with 'mountain', filters by coordinate presence, and builds a labeled dataset where every image has a confirmed lat/lon pair.

### Why choose this scraper

| | What you get |
|---|---|
| **Geotag guarantee** | Only files that already have a P625 (coordinate) Wikibase statement are returned. |
| **Structured output** | Every row follows the same flat schema: title, pageid, size, wordcount, snippet, and timestamp. |
| **No authentication** | The Wikimedia Commons API is open; you never register an app or manage OAuth tokens. |
| **Flexible scale** | One run can return 10 preview items for a quick check or up to a million for a full dataset. |
| **Standard exports** | Dataset downloads as CSV, JSON, Excel, or XML so it fits into your existing pipeline. |

### What a Wikimedia Commons 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/Special:FilePath/Christ%20saviour%20explosion.jpg",
 "title": "File:Christ saviour explosion.jpg",
 "url": "https://commons.wikimedia.org/wiki/File%3AChrist%20saviour%20explosion.jpg",
 "pageid": 887912,
 "ns": 6,
 "size": 869,
 "wordcount": 65,
 "snippet": "English Destruction of the original Church of Christ the Saviour in Moscow, USSR, 5 December 1931 Russian Взрыв Храма Христа Спасителя, Москва, 5 декабря",
 "timestamp": "2026-08-14T06:19:24Z",
 "scrapedAt": "2026-09-04T03:35:53.604Z"
}
```

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 a Wikimedia Commons search term and a namespace integer. The default query finds every file with coordinates; layer your own keywords on top to narrow by topic or location. The Input tab lists every parameter.

A first run with the defaults:

```json
{
 "searchTerm": "haswbstatement:P625",
 "namespace": 6,
 "maxItems": 10
}
```

A larger pull:

```json
{
 "searchTerm": "haswbstatement:P625",
 "namespace": 6,
 "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 Geolocated Files Scraper](https://apify.com/parseforge/wikimedia-commons-geo-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-geo-scraper"
```

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

### Troubleshooting

**Why am I getting only 10 results even though I set Max Items to 500?**

On the Apify Free plan, Max Items is capped at 10. Upgrade to a paid plan to remove the preview limit and retrieve up to your requested maximum.

**I added a specific place name to the search query, but I am getting zero results.**

Ensure your search term is still combined with `haswbstatement:P625` if you want only geolocated results. A search query like 'Eiffel Tower haswbstatement:P625' works; 'Eiffel Tower' alone may return files without coordinates if you removed the coordinate filter.

**The dataset contains files that look unrelated to my location keyword.**

The Commons search API matches keywords across the file description text, not the coordinates themselves. Add more specific terms or post-filter your dataset programmatically using the snippet field, which contains a text preview of the file description.

**Why is the progress crawling so slowly?**

The Wikimedia Commons API applies rate limiting per client. High Max Items values will naturally take longer because the Actor respects the API's pacing. Reduce Max Items for faster previews or expect longer run times for bulk fetches.

### FAQ

| Question | Answer |
|---|---|
| Does this Actor download the actual image files? | No. It returns the metadata record for each geolocated file, including its title and page ID. You can use the title or page ID to construct the file URL and download the image yourself. |
| Do I need a Wikimedia account or API key to run this? | No. The Actor calls the public Wikimedia Commons API, which does not require authentication, an app registration, or API keys. |
| Can I filter results by a specific geographic area or bounding box? | The direct API search does not support bounding-box filtering. You can narrow results by adding a place name or landmark keyword to the search term. Files returned always contain a coordinate statement, so you can post-filter your dataset by lat/lon ranges. |
| What does the default search query 'haswbstatement:P625' mean? | It is a Wikibase query that asks the Commons search engine to return only files that have the property P625, which is the coordinate location property. This guarantees every record in your dataset is geolocated. |
| How many results can I get in a single run? | Free-tier users can preview up to 10 items. Paid users can set a Max Items value up to 1,000,000 per run. |
| Are all returned files freely licensed? | Wikimedia Commons files are available under free licenses or in the public domain, but you should verify the specific license of each file before reuse. The license is not part of the standard search API response fields. |
| Can I search namespaces other than files? | Yes. The namespace input defaults to 6 for files, but you can change it to any valid MediaWiki namespace integer, such as 14 for categories, to explore other content types with coordinates. |
| What export formats are available? | You can export your scraped dataset in CSV, JSON, Excel, or XML from the Apify platform run detail page or via API. |

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

### Pricing

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.

⚠️ **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

## `searchTerm` (type: `string`):

Wikimedia Commons search text for geolocated files. Default finds all files with coordinates. Add keywords to filter by topic or place.

## `namespace` (type: `integer`):

Wikimedia namespace to search. Default 6 restricts results to files only.

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

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

## Actor input object example

```json
{
  "searchTerm": "haswbstatement:P625",
  "namespace": 6,
  "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 = {
    "searchTerm": "haswbstatement:P625",
    "namespace": 6,
    "maxItems": 10
};

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

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

```

## MCP server setup

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