Public Commons Media Search
Search Wikipedia and Wikimedia Commons to discover public media assets, find article titles, list media on pages, and retrieve file URLs with metadata.
Actions
search_titles
Search Wikipedia for article titles matching a query.
Required fields:
action:"search_titles"q: Search query string
Optional fields:
project: Wikimedia project (default:"wikipedia"). Must NOT be"commons".language: Language code (default:"en")limit: Maximum results, 1-50 (default: 50)
Example:
{
"action": "search_titles",
"q": "solar eclipse",
"language": "en",
"limit": 10
}
Returns a list of matching pages with title, description, and excerpt.
list_page_media
List all media files (images, audio, video) embedded on a specific Wikipedia page.
Required fields:
action:"list_page_media"title: Canonical page title (e.g.,"Solar_eclipse")
Optional fields:
project: Wikimedia project (default:"wikipedia"). Must NOT be"commons".language: Language code (default:"en")
Example:
{
"action": "list_page_media",
"title": "Golden_Gate_Bridge",
"language": "en"
}
Returns a list of media items found on the page.
get_file
Retrieve detailed file metadata and URLs (original, preferred, thumbnail) for a specific media file.
Required fields:
action:"get_file"file_title: Full file title including theFile:prefix (e.g.,"File:Example.jpg")
Optional fields:
project: Wikimedia project (default:"wikipedia"). Set to"commons"when the file is hosted on Wikimedia Commons.language: Language code (default:"en"). Required when project is not"commons".
Example — Wikipedia file:
{
"action": "get_file",
"file_title": "File:Golden_Gate_Bridge_20100906.jpg",
"project": "wikipedia",
"language": "en"
}
Example — Commons file:
{
"action": "get_file",
"file_title": "File:Hubble_ultra_deep_field.jpg",
"project": "commons"
}
Returns the file title, description URL, and links to original, preferred, and thumbnail versions of the file.
search_commons_media
Search Wikimedia Commons directly for media files (images, audio, video, SVGs). Supports pagination for browsing large result sets.
Required fields:
action:"search_commons_media"q: Search query string
Optional fields:
limit: Maximum results, 1-50 (default: 50)offset: Pagination offset (default: 0). Use thenext_offsetvalue from a previous response to get the next page.
Example:
{
"action": "search_commons_media",
"q": "northern lights aurora",
"limit": 10
}
Pagination example:
{
"action": "search_commons_media",
"q": "northern lights aurora",
"limit": 10,
"offset": 10
}
Returns matching file titles, page IDs, and text snippets. Includes next_offset when more results are available.
Common Workflows
Find and download a Wikipedia image
- Use
search_titlesto find the article (e.g.,"q": "Eiffel Tower") - Use
list_page_mediawith the returned title to see all media on the page - Use
get_filewith the desiredfile_title(include theFile:prefix) to get the direct URL
Search Commons for stock-style media
- Use
search_commons_mediawith a descriptive query (e.g.,"q": "sunset over ocean") - Pick a result and use
get_filewithprojectset to"commons"and the file title to get URLs
Browse media in another language
- Set
languageto any valid code (e.g.,"fr","de","ja") when usingsearch_titles,list_page_media, orget_filewith Wikipedia
Important Notes
- The
file_titleparameter must always include theFile:prefix (e.g.,"File:Example.png"). - The
projectparameter should be set to"commons"only forget_filewhen the file is hosted on Wikimedia Commons. Forsearch_titlesandlist_page_media, use"wikipedia"(the default). search_commons_mediaalways searches Wikimedia Commons regardless of theprojectorlanguagesettings.- All media found through this tool is from Wikimedia projects and is generally available under open licenses (Creative Commons, public domain, etc.). Always check the file description page for specific license terms.
- Results are capped at 50 per request. Use
offsetwithsearch_commons_mediato paginate through larger result sets.







