API Anything

Wikimedia Commons APIunofficial

Public Wikimedia Commons image search, file pages and category galleries.

all live 3 operations, checked by the installs that call them.

Seeded by the maintainers.

Try it

Set up API Anything for your agents:

npx -y api-anything setup

Then ask your agent, which finds this site by itself, or call it from a shell:

api-anything pull commons
api-anything call commons getFile title=File:Mona_Lisa,_by_Leonardo_da_Vinci,_from_C2RMF_retouched.jpg

Operations

OperationMethodLoginWritesStatus
getFile(title) -> description, date, source, author, licenses, licenseLinks, original, fileInfo, categories

Read displayed file-page information, visible license templates, original file link and visible categories.

GET no no Live0 confirmations · success unknown; last worked unknown
listCategory(category) -> title, url, thumbnail

Files in the first category gallery page, with filenames, file page links and thumbnails.

GET no no Live0 confirmations · success unknown; last worked unknown
searchMedia(q) -> title, url, thumbnail

First page of MediaSearch image results, with filenames, file page links and thumbnails.

GET no no Live0 confirmations · success unknown; last worked unknown

Notes

No account is needed. Each file has its own license: check the file page and attribute as required before reuse. Do not infer that attribution is unnecessary from missing fields.

  • searchMedia searches images and returns the first page only. Titles omit File:; add that prefix when passing a title to getFile. The URL is the file description page, not the original.
  • getFile reads the displayed page. Fields may be absent or incomplete: license templates vary, and an empty licenses array does not mean the file has no license. License links can include explanatory links as well as license URLs. Attribution requirements are not returned as a flag. fileInfo is displayed text, including dimensions, size and MIME type where present. Categories are visible categories only. The author and description can contain several languages or extra biographical text.
  • listCategory takes a category name without Category: and returns the first gallery page, not subcategories. A category with no direct files can report input instead of an empty list. Large galleries can be truncated.

About these operations

Each operation is a request learned from Wikimedia Commons's own web pages: API Anything replays it over plain HTTP and falls back to a browser when it must. Read them as JSON.

← All shared sites