Image and photo

Wikimedia Commons API

by commons.wikimedia.org

Image and photo Added on October 31st, 2026 Checked and working on November 2nd, 2026
Visit commons.wikimedia.org →

What it does

Wikimedia Commons holds more than 100 million freely licensed images, sounds and videos, used by Wikipedia and many other sites. The MediaWiki API lets you search files, get their URLs in any size, and read their licence, author and description, which you need to credit them correctly. Responses are JSON. Free, no key needed; check the licence of each file before you use it.
  • API
  • HTTP-GET
  • JSON
  • REST

At a glance

API key
Not needed · More APIs with no key
Pricing
Free, no key needed; check the licence of each file before you use it.
From the browser
Yes (CORS)
Formats
JSON
Interface
REST, HTTP-GET
Provider
commons.wikimedia.org
Last checked
Working on November 2nd, 2026

More information: https://commons.wikimedia.org/wiki/Commons:API

Is this your service? Show that it is listed

Put this badge on your website or in your README; it links to this page. About the badge

Listed on Free Web Services

commons.wikimedia.org
Wikimedia Commons API

Example request

curl

curl 'https://commons.wikimedia.org/w/api.php?action=query&list=search&srsearch=London&srnamespace=6&srlimit=1&format=json&origin=*'

JavaScript

const response = await fetch("https://commons.wikimedia.org/w/api.php?action=query&list=search&srsearch=London&srnamespace=6&srlimit=1&format=json&origin=*");
const data = await response.json();
console.log(data);

Python

import requests

response = requests.get(
    "https://commons.wikimedia.org/w/api.php?action=query&list=search&srsearch=London&srnamespace=6&srlimit=1&format=json&origin=*",
    timeout=30,
)
print(response.json())

The JavaScript works in a web page as well as in Node.js 18 or newer.

Did it work for you?

Tell us what you found when you tried Wikimedia Commons API.