Wikimedia Commons API: Search free images
Finds free-to-use Wikimedia Commons images for a topic in Commons relevance order. Each image comes with its links, creator and licence details.
Unofficial. Not affiliated with or endorsed by Wikimedia Commons.
Inputs
Values from the run on Oct 26, 2026, shown under Output.
- Query, required
query What the image should show, for example Golden Gate Bridge at night.
Golden Gate Bridge at night
- Max Results optional
max_results Maximum number of images to return, for example 20.
20
Whole number from 1 to 50. Default
20.
Input as JSON
{ "query": "Golden Gate Bridge at night", "max_results": 20}Output
{ "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=thumbnail" , "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_night.jpg)" , "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 }, { "title": "Golden Gate Bridge and San Francisco skyline from Hawk Hill at Blue Hour dllu.jpg", "width": 13706, "author": "Daniel L. Lu (user:dllu)", "height": 4094, "description": "The Golden Gate Bridge and San Francisco as seen from Hawk Hill during blue hour.", "licence_link": "https://creativecommons.org/licenses/by-sa/4.0" , "licence_name": "CC BY-SA 4.0", "file_page_link": "https://commons.wikimedia.org/wiki/File:Golden_Gate_Bridge_and_San_Francisco_skyline_from_Hawk_Hill_at_Blue_Hour_dllu.jpg" , "thumbnail_link": "https://thumb.wikimedia.org/wikipedia/commons/thumb/2/20/Golden_Gate_Bridge_and_San_Francisco_skyline_from_Hawk_Hill_at_Blue_Hour_dllu.jpg/960px-Golden_Gate_Bridge_and_San_Francisco_skyline_from_Hawk_Hill_at_Blue_Hour_dllu.jpg?utm_source=commons.wikimedia.org&utm_campaign=imageinfo&utm_content=thumb…" , "attribution_text": "\"Golden Gate Bridge and San Francisco skyline from Hawk Hill at Blue Hour dllu.jpg\" by Daniel L. Lu (user:dllu), CC BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0), via Wikimedia Commons (https://commons.wikimedia.org/wiki/File:Golden_Gate_Bridge_and_San_Francisco_skyline_from_Hawk_Hill_a…" , "original_image_link": "https://upload.wikimedia.org/wikipedia/commons/2/20/Golden_Gate_Bridge_and_San_Francisco_skyline_from_Hawk_Hill_at_Blue_Hour_dllu.jpg?utm_source=commons.wikimedia.org&utm_campaign=imageinfo&utm_content=original" , "attribution_required": true }, { "title": "Fort Point National Historic Site and Golden Gate Bridge.jpg", "width": 2000, "author": "Brocken Inaglory", "height": 1333, "description": "Fort Point National Historic Site and Golden Gate Bridge.", "licence_link": "https://creativecommons.org/licenses/by-sa/3.0" , "licence_name": "CC BY-SA 3.0", "file_page_link": "https://commons.wikimedia.org/wiki/File:Fort_Point_National_Historic_Site_and_Golden_Gate_Bridge.jpg" , "thumbnail_link": "https://thumb.wikimedia.org/wikipedia/commons/thumb/a/a3/Fort_Point_National_Historic_Site_and_Golden_Gate_Bridge.jpg/960px-Fort_Point_National_Historic_Site_and_Golden_Gate_Bridge.jpg?utm_source=commons.wikimedia.org&utm_campaign=imageinfo&utm_content=thumbnail" , "attribution_text": "\"Fort Point National Historic Site and Golden Gate Bridge.jpg\" by Brocken Inaglory, CC BY-SA 3.0 (https://creativecommons.org/licenses/by-sa/3.0), via Wikimedia Commons (https://commons.wikimedia.org/wiki/File:Fort_Point_National_Historic_Site_and_Golden_Gate_Bridge.jpg)" , "original_image_link": "https://upload.wikimedia.org/wikipedia/commons/a/a3/Fort_Point_National_Historic_Site_and_Golden_Gate_Bridge.jpg?utm_source=commons.wikimedia.org&utm_campaign=imageinfo&utm_content=original" , "attribution_required": true } ]}Code
curl https://api.fous.com/v1/runs \ -H "Authorization: Bearer $FOUS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"method":"commons.wikimedia.org/search_free_images","input":{"query":"Golden Gate Bridge at night","max_results":20}}' # Save as fous.py, then run: python3 fous.pyimport json, os, timefrom urllib.error import HTTPErrorfrom urllib.request import Request, urlopenAPI = "https://api.fous.com/v1/runs" KEY = os.environ["FOUS_API_KEY"]HEADERS = { "Authorization": f"Bearer {KEY}", "Content-Type": "application/json" ,}def call(url, body=None): data = json.dumps(body).encode() if body else None request = Request(url, data, HEADERS) try: with urlopen(request, timeout=120) as r: return r.status, json.load(r) except HTTPError as error: message = json.load(error)["error"]["message"] raise RuntimeError(message) from errorstatus, run = call(API, { "method": "commons.wikimedia.org/search_free_images" , "input": { "query": "Golden Gate Bridge at night", "max_results": 20 }})# 202: still going after 30 s. Ask again until it ends.while status == 202: time.sleep(2) status, run = call(f"{API}/{run['id']}")print(json.dumps(run["data"], indent=2))// Save as fous.mjs, then run: node fous.mjsconst api = "https://api.fous.com/v1/runs" ;const headers = { Authorization: `Bearer ${process.env.FOUS_API_KEY}`, "Content-Type": "application/json" ,};let response = await fetch(api, { method: "POST", headers, body: JSON.stringify({ "method": "commons.wikimedia.org/search_free_images" , "input": { "query": "Golden Gate Bridge at night", "max_results": 20 } }), signal: AbortSignal.timeout(120_000),});let run = await response.json();// 202: still going after 30 s. Ask again until it ends.while (response.status === 202) { await new Promise((done) => setTimeout(done, 2_000)); response = await fetch(`${api}/${run.id}`, { headers }); run = await response.json();}if (!response.ok) throw new Error(run.error.message);console.log(run.data);# Connect your agent to Fous once, over MCP (Streamable HTTP):# https://api.fous.com/mcp# Set FOUS_API_KEY first: create a key at https://app.fous.com/keys.# Claude Codeclaude mcp add \ --scope user \ --transport http fous https://api.fous.com/mcp \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Codexcodex mcp add fous \ --url https://api.fous.com/mcp \ --bearer-token-env-var FOUS_API_KEY# Cursor, VS Code, Windsurf, Cline and morenpx -y add-mcp https://api.fous.com/mcp -g -n fous \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Then ask your agent:# "Use Fous to run commons.wikimedia.org/search_free_images# with {"query":"Golden Gate Bridge at night","max_results":20}"Over HTTP, the answer’s data holds the output. A run still going after 30 seconds answers 202 with its id: ask GET /v1/runs/{id} until it ends.
Schema
Input schema
{ "type": "object", "required": [ "query" ], "properties": { "query": { "type": "string", "minLength": 1, "description": "What the image should show, for example Golden Gate Bridge at night." }, "max_results": { "type": "integer", "default": 20, "maximum": 50, "minimum": 1, "description": "Maximum number of images to return, for example 20." } }}Output schema
{ "type": "object", "required": [ "images" ], "properties": { "images": { "type": "array", "items": { "type": "object", "properties": { "title": { "type": "string" }, "width": { "type": "integer" }, "author": { "type": [ "string", "null" ] }, "height": { "type": "integer" }, "description": { "type": [ "string", "null" ] }, "licence_link": { "type": "string" }, "licence_name": { "type": "string" }, "file_page_link": { "type": "string" }, "thumbnail_link": { "type": "string" }, "attribution_text": { "type": "string" }, "original_image_link": { "type": "string" }, "attribution_required": { "type": "boolean" } } } } }}- Price
- 1 credit per completed run (1¢ with pay as you go); failed runs are free.
- Method
commons.wikimedia.org/search_free_images- Returns
- title, description, image and thumbnail links, size, author, licence, attribution text, file page
Use it from your agent
Give your agent this line. It reads SKILL.md, gets a Fous API key and connects the Fous MCP server. Its run then takes the method commons.wikimedia.org/search_free_images with the inputs above.
Ask your agent
- Find me 10 freely licensed photos of the Eiffel Tower at sunset, with the author and licence for each so I can credit them properly.
- I need public domain or Creative Commons images of red pandas for a school presentation — give me around 15 with attribution text.
- Search Wikimedia Commons for pictures of the Mars Curiosity rover and return the full-size and thumbnail URLs.
- Get up to 30 reusable images of traditional Japanese tea ceremonies, including image dimensions and the file page link.
- Pull 5 Commons images of the Great Barrier Reef coral that I can legally put on my blog, along with who made them and the licence terms.
See more
Search free stock photos on Pexels by subject, orientation, and page. Returns up to 80 photos in search order; Pexels may broaden searches with few exact matches.
pexels.com/search_photosFinds Unsplash photos matching a search phrase, in search order, optionally by shape; excludes Unsplash+ photos unless included. Each result has image links, photographer, licence and photo page.
unsplash.com/search_photosSearches Britannica for encyclopedia articles and returns their titles, short descriptions, article links and images when shown. Excludes other search formats such as videos, questions and stories.
britannica.com/search_articlesSearches a Wikipedia language edition by keywords and returns matching articles in relevance order, with descriptions, snippets, word counts, last edit dates and links.
wikipedia.org/search_articlesFinds Pinterest pins for an idea in search order, with image, creator, board, saves and linked website. Limited to the first public search page.
pinterest.com/search_pinsSearches NASA public photos, videos or audio by words and creation year, returning matches in relevance order with thumbnails and full-size file links.
nasa.gov/search_imagesFinds public Hugging Face models by search words, with an optional task and sort order. License is null when the model does not publish one.
huggingface.co/search_modelsSearches PyPI by keywords and returns matching packages in relevance order, each with its latest version and that version's release date. Returns up to 100 results.
pypi.org/search_packages