# 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/workflows/wikimedia-commons
- Handle: `@wikimedia-commons`
- Category: [Media processing](https://fous.com/workflows/category/media)
- Source website: https://commons.wikimedia.org
- Last verified: Sep 29, 2026
- Fous is not affiliated with Wikimedia Commons.

## Methods

### Search free images

Operation `search_free_images`, version 1. 1 credit per call.

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 | `"Humpback song.PNG"` | File title without the File: prefix. |
| `images[].width` | integer | `1219` | Original width in pixels. |
| `images[].author` | string or null | `"Redrawn from Payne, et al. (1983) by Pcb21"` | Creator in plain text, when credited. |
| `images[].height` | integer | `122` | Original height in pixels. |
| `images[].description` | string or null | `"Idealized schematic of the song of a Humpback Whale ( Megaptera novaeangliae )."` | 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:Humpback_song.PNG"` | Wikimedia Commons file page. |
| `images[].thumbnail_link` | string | `"https://thumb.wikimedia.org/wikipedia/commons/thumb/0/05/Humpback_song.PNG/960px-Humpback_song.PNG?utm_source=commons.w` | Link to a thumbnail about 640 pixels wide. |
| `images[].attribution_text` | string | `"\"Humpback song.PNG\" by Redrawn from Payne, et al. (1983) by Pcb21, CC BY-SA 3.0 (http://creativecommons.org/licenses/` | Ready-to-paste credit including the source and licence. |
| `images[].original_image_link` | string | `"https://upload.wikimedia.org/wikipedia/commons/0/05/Humpback_song.PNG?utm_source=commons.wikimedia.org&utm_campaign=ima` | Link to the full-size image. |
| `images[].attribution_required` | boolean | `true` | Whether the stated licence requires creator credit. |

**Example input**

```json
{
  "query": "humpback whale song",
  "max_results": 5
}
```

**Example output**

```json
{
  "images": [
    {
      "title": "Humpback song.PNG",
      "width": 1219,
      "author": "Redrawn from Payne, et al. (1983) by Pcb21",
      "height": 122,
      "description": "Idealized schematic of the song of a Humpback Whale ( Megaptera novaeangliae ).",
      "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:Humpback_song.PNG",
      "thumbnail_link": "https://thumb.wikimedia.org/wikipedia/commons/thumb/0/05/Humpback_song.PNG/960px-Humpback_song.PNG?utm_source=commons.wikimedia.org&utm_campaign=imageinfo&utm_content=thumbnail",
      "attribution_text": "\"Humpback song.PNG\" by Redrawn from Payne, et al. (1983) by Pcb21, CC BY-SA 3.0 (http://creativecommons.org/licenses/by-sa/3.0/), via Wikimedia Commons (https://commons.wikimedia.org/wiki/File:Humpbac…",
      "original_image_link": "https://upload.wikimedia.org/wikipedia/commons/0/05/Humpback_song.PNG?utm_source=commons.wikimedia.org&utm_campaign=imageinfo&utm_content=original",
      "attribution_required": true
    }
  ]
}
```

## Quick start

Call the API with a Fous API key (`FOUS_API_KEY`). To create one, turn on Developer mode in Fous Studio, then open Keys & connections → API keys (https://app.fous.com/keys).

```bash
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
: "${FOUS_API_KEY:?Set FOUS_API_KEY before running this example}"

curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 120 \
  -H "Authorization: Bearer $FOUS_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.
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
import json
import os
import urllib.error
import urllib.request

api_key = os.environ.get("FOUS_API_KEY")
if not api_key:
    raise RuntimeError("Set FOUS_API_KEY before running this example")

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=120) 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.
// First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
const apiKey = process.env.FOUS_API_KEY;
if (!apiKey) throw new Error("Set FOUS_API_KEY before running this example");

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(120_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);
```

Or describe the data in plain language: send `{"api":"@wikimedia-commons","prompt":"Describe the data you need, with every detail"}` to the same URL. Fous fills in the input, runs the method that fits and returns only the fields you asked for; `data.route.calls[].request` is the exact call it made. Routing is free; the run costs the same.

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

### Is Fous affiliated with Wikimedia Commons?

No. Fous is not affiliated with Wikimedia Commons. This workflow reads the public commons.wikimedia.org website and returns its data.

### How much does it cost?

Each run costs 1 credit. 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; repeating the same request within a day may return the saved result. Fous checks this workflow automatically; it last passed a check 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/workflows/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/workflows/unsplash.md): Discover photos shared on Unsplash.
- [Wikipedia API](https://fous.com/workflows/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/workflows/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/workflows/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/workflows/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/workflows/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/workflows/google-lens.md): Identify images and find visually similar pages online.
- [All Media processing workflows](https://fous.com/workflows/category/media)
