# Wikimedia Commons API

> Wikimedia Commons returns free-to-use images with creator and licensing details, available as a workflow and API.

Wikimedia Commons (Commons) finds free-to-use images for a topic, returning links, creator and licensing details; it needs a search query.

- Page: https://fous.com/tools/wikimedia-commons
- Handle: `@wikimedia-commons`
- Category: [Media processing](https://fous.com/tools/category/media)
- Source website: https://commons.wikimedia.org
- Last verified: Sep 29, 2026

## Methods

### Search free images

Operation `search_free_images`, version 1. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

Find free-to-use Wikimedia Commons images for a topic, ordered by Commons relevance, with image links, creator and licensing details. Licensing and creator fields depend on the details supplied by each file page; public-domain files may link to the file’s licensing section.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `query` | string | yes | `"Golden Gate Bridge at night"` | What the image should show, for example Golden Gate Bridge at night. |
| `max_results` | integer | no | `20` | Maximum number of images to return, for example 20. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "query"
  ],
  "properties": {
    "query": {
      "type": "string",
      "minLength": 1,
      "description": "What the image should show, for example Golden Gate Bridge at night.",
      "examples": [
        "Golden Gate Bridge at night",
        "humpback whale song",
        "river landscape svg"
      ]
    },
    "max_results": {
      "type": "integer",
      "default": 20,
      "maximum": 50,
      "minimum": 1,
      "description": "Maximum number of images to return, for example 20.",
      "x-fous-developer": true,
      "examples": [
        20,
        5,
        3
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "query": "Golden Gate Bridge at night",
      "max_results": 20
    },
    {
      "query": "humpback whale song",
      "max_results": 5
    },
    {
      "query": "river landscape svg",
      "max_results": 3
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `images` | array |  | Images in Commons relevance order. |
| `images[].title` | string | `"Golden Gate Bridge by night.jpg"` | File title without the File: prefix. |
| `images[].width` | integer | `1800` | Original width in pixels. |
| `images[].author` | string or null | `"Daniel Schwen"` | Creator in plain text, when credited. |
| `images[].height` | integer | `1283` | Original height in pixels. |
| `images[].description` | string or null | `"Golden Gate Bridge at looking south-south-east by night looking south across the Golden Gate towards San Francisco."` | Plain-text image description, when available. |
| `images[].licence_link` | string | `"http://creativecommons.org/licenses/by-sa/3.0/"` | Licence terms or the licensing section of the file page. |
| `images[].licence_name` | string | `"CC BY-SA 3.0"` | Named licence or public-domain status. |
| `images[].file_page_link` | string | `"https://commons.wikimedia.org/wiki/File:Golden_Gate_Bridge_by_night.jpg"` | Wikimedia Commons file page. |
| `images[].thumbnail_link` | string | `"https://thumb.wikimedia.org/wikipedia/commons/thumb/c/c2/Golden_Gate_Bridge_by_night.jpg/960px-Golden_Gate_Bridge_by_ni` | Link to a thumbnail about 640 pixels wide. |
| `images[].attribution_text` | string | `"\"Golden Gate Bridge by night.jpg\" by Daniel Schwen, CC BY-SA 3.0 (http://creativecommons.org/licenses/by-sa/3.0/), vi` | Ready-to-paste credit including the source and licence. |
| `images[].original_image_link` | string | `"https://upload.wikimedia.org/wikipedia/commons/c/c2/Golden_Gate_Bridge_by_night.jpg?utm_source=commons.wikimedia.org&ut` | Link to the full-size image. |
| `images[].attribution_required` | boolean | `true` | Whether the stated licence requires creator credit. |

**Example input**

```json
{
  "query": "Golden Gate Bridge at night",
  "max_results": 20
}
```

**Example output**

```json
{
  "images": [
    {
      "title": "Golden Gate Bridge by night.jpg",
      "width": 1800,
      "author": "Daniel Schwen",
      "height": 1283,
      "description": "Golden Gate Bridge at looking south-south-east by night looking south across the Golden Gate towards San Francisco.",
      "licence_link": "http://creativecommons.org/licenses/by-sa/3.0/",
      "licence_name": "CC BY-SA 3.0",
      "file_page_link": "https://commons.wikimedia.org/wiki/File:Golden_Gate_Bridge_by_night.jpg",
      "thumbnail_link": "https://thumb.wikimedia.org/wikipedia/commons/thumb/c/c2/Golden_Gate_Bridge_by_night.jpg/960px-Golden_Gate_Bridge_by_night.jpg?utm_source=commons.wikimedia.org&utm_campaign=imageinfo&utm_content=thumb…",
      "attribution_text": "\"Golden Gate Bridge by night.jpg\" by Daniel Schwen, CC BY-SA 3.0 (http://creativecommons.org/licenses/by-sa/3.0/), via Wikimedia Commons (https://commons.wikimedia.org/wiki/File:Golden_Gate_Bridge_by_…",
      "original_image_link": "https://upload.wikimedia.org/wikipedia/commons/c/c2/Golden_Gate_Bridge_by_night.jpg?utm_source=commons.wikimedia.org&utm_campaign=imageinfo&utm_content=original",
      "attribution_required": true
    }
  ]
}
```

## Quick start

Replace `YOUR_API_KEY` with a Fous API key. To create one, open Developers at the bottom of Fous Studio, turn on Developer mode, then go to API keys (https://app.fous.com/keys). Change the values in `input` to run the same tool on new data.

```bash
curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 180 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "api": "@wikimedia-commons",
  "visibility": "public",
  "operation": "search_free_images",
  "version": 1,
  "input": {
    "query": "Golden Gate Bridge at night",
    "max_results": 20
  },
  "response": {
    "format": "json"
  }
}'
```

```python
# Save as fous.py and run with python3 fous.py. No packages needed.
import json
import urllib.error
import urllib.request

api_key = "YOUR_API_KEY"

body = json.loads("{\n  \"api\": \"@wikimedia-commons\",\n  \"visibility\": \"public\",\n  \"operation\": \"search_free_images\",\n  \"version\": 1,\n  \"input\": {\n    \"query\": \"Golden Gate Bridge at night\",\n    \"max_results\": 20\n  },\n  \"response\": {\n    \"format\": \"json\"\n  }\n}")
request = urllib.request.Request(
    "https://api.fous.com/v1/query",
    data=json.dumps(body).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    },
    method="POST",
)
try:
    with urllib.request.urlopen(request, timeout=180) as response:
        result = json.load(response)
except urllib.error.HTTPError as error:
    raise RuntimeError(f"HTTP {error.code}: {error.read().decode('utf-8', errors='replace')}") from error
if result.get("success") is False:
    raise RuntimeError(result.get("error", {}).get("message", "Request failed"))
print(json.dumps(result["data"]["output"], indent=2))
```

```typescript
// Save as fous.mts and run with npx tsx fous.mts.
const apiKey = "YOUR_API_KEY";

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(180_000),
  body: JSON.stringify({
  "api": "@wikimedia-commons",
  "visibility": "public",
  "operation": "search_free_images",
  "version": 1,
  "input": {
    "query": "Golden Gate Bridge at night",
    "max_results": 20
  },
  "response": {
    "format": "json"
  }
}),
});
type ApiResult = { success: boolean; data?: { output: unknown }; error?: { message: string } };
const result: ApiResult = await response.json();
if (!response.ok || result.success === false) {
  throw new Error(result.error?.message ?? `HTTP ${response.status}`);
}
if (!result.data) throw new Error("Missing API response data");
console.log(result.data.output);
```

## Use from an AI assistant

Connect this tool to Claude Code, Claude Desktop, Cursor, VS Code, Codex and any MCP client as its own MCP server. Each method is a typed tool whose arguments are the method’s input.

- Server URL: `https://api.fous.com/mcp/tools/wikimedia-commons`
- Authorization: `Authorization: Bearer <Fous API key>`

**Tools**

- `search_free_images`: Search free images. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `fous_get_run`: the result of a run that was still going, by its `request_id`. Free.

Claude Code:

```bash
claude mcp add --scope user --transport http fous-wikimedia-commons https://api.fous.com/mcp/tools/wikimedia-commons --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"
```

To give the assistant every tool, connect `https://api.fous.com/mcp`: it finds one with `fous_search_tools` and runs it with `fous_run_tool`. Setup for other clients: https://fous.com/llms-full.txt.

## Use cases

- Find images for a presentation on a specific topic
- Check image licence details before publishing
- Prepare image credits for a project
- Browse relevant Commons images for editorial content

## FAQ

### Can I run it with my own inputs?

Yes. Change the inputs in Studio and press Run, or send new inputs from your code, or ask a connected AI assistant.

### Can I call this Wikimedia Commons tool as an API?

Yes. Send a POST request to /v1/query with your Fous API key and the inputs, and get JSON back.

### How much does it cost?

Each completed run costs 1 credit. Failed runs without a completed receipt are free; completed work can remain charged if delivery is interrupted. With pay as you go, a credit costs 1¢. Monthly plans cost less per credit.

### Do I need a Wikimedia Commons account?

No. You only need a Fous account.

### How current is the data?

Fous gets the data from commons.wikimedia.org when you run it. Some results are reused for up to 24 hours, and results that use your account or key are never reused. It was last verified on Sep 29, 2026.

### What images are available for my topic?

Search free images finds images for a topic, ordered by Commons relevance.

### Who created an image, and what licence applies?

Search free images returns creator and licensing details when those details are supplied on the file page.

### Where can I find an image’s full-size file?

Search free images returns a link to the original image and its Wikimedia Commons file page.

## Related

- [Pexels API](https://fous.com/tools/pexels.md): Pexels offers free stock photos and videos, with searches returning up to 80 results in Pexels search order.
- [Unsplash API](https://fous.com/tools/unsplash.md): Discover photos shared on Unsplash.
- [Wikipedia API](https://fous.com/tools/wikipedia.md): Wikipedia returns article summaries, images, facts, relevant search matches, readable text and daily historical events, plus human-view counts from July 2015 onward.
- [Google Search API](https://fous.com/tools/google-search.md): Google Search returns public web, image, job, event, related-question, and autocomplete results in Google’s order, with answers and details when available; results may be fewer, omit information, or be empty.
- [NASA API](https://fous.com/tools/nasa.md): NASA provides astronomy pictures from June 16, 1995 onward, up to 100 media matches, inclusive UTC asteroid approaches, recent approximate natural events, and upcoming ISS sightings for listed cities.
- [Britannica API](https://fous.com/tools/britannica.md): Britannica returns public encyclopedia articles with introductions, quick facts, headings, update dates and images, plus search results with titles, descriptions, links and images when shown.
- [Wikidata API](https://fous.com/tools/wikidata.md): Wikidata is a free public knowledge base returning facts and item lists about people, places, organizations, and more; values may be historical and dates incomplete.
- [Google Lens API](https://fous.com/tools/google-lens.md): Identify images and find visually similar pages online.
- [All Media processing tools](https://fous.com/tools/category/media)
