# Wikimedia Commons

> Search Wikimedia Commons for freely licensed photos, video, audio and documents, and read what each one needs to be reused: its URL, a preview at any size, its licence, author and credit line. Browse by category, find files taken near a place, read a file's structured data and where it is used across Wikipedia, and watch what is being uploaded and changed.

App · Images & Design · 20 actions. Web page: https://docs.lodol.com/docs/integrations/wikimedia-commons

## Actions

### Browse the category index

Walk the category index alphabetically, with each category's counts beside it. Where 'Search categories' matches words, this reads the index itself: give it a prefix to see every category beginning with it.

**Inputs**

- Name starts with (`starts_with`, text): Only categories whose name begins with this text, without the 'Category:' in front.
- Start from (`start_from`, text): Begin the listing at this name instead of the start of the alphabet. Pass the last name from a previous run to read the next page.
- At least this many members (`minimum_members`, number): Skip categories holding fewer members than this. Set it to 1 to leave out the empty ones. At least 0.
- Number of results (`limit`, number): How many rows to return, up to 500. From 1 to 500. Default: `20`.

**Outputs**

- `categories` (list)
- `count` (number)
- `starts_with` (text)

**Example output**

```json
{
  "categories": [
    {
      "file_count": 0,
      "hidden": false,
      "member_count": 32,
      "name": "Eiffel Tower",
      "page_count": 1,
      "subcategory_count": 31,
      "title": "Category:Eiffel Tower",
      "url": "https://commons.wikimedia.org/wiki/Category:Eiffel_Tower"
    },
    {
      "file_count": 41,
      "hidden": false,
      "member_count": 43,
      "name": "Eiffel Tower, Las Vegas",
      "page_count": 0,
      "subcategory_count": 2,
      "title": "Category:Eiffel Tower, Las Vegas",
      "url": "https://commons.wikimedia.org/wiki/Category:Eiffel_Tower,_Las_Vegas"
    }
  ],
  "count": 2,
  "starts_with": "Eiffel Tower"
}
```

### Browse the file index

Walk the file index by name, or by when files were uploaded. Which filters apply depends on the order, because that is how Commons indexes the table: a name prefix needs the name order, and an uploader or a date window needs one of the date orders.

**Inputs**

- Order (`sort`, text): Read the index by name, or by upload time. The uploader and date filters need one of the time orders. One of: `name` (By name), `newest_first` (Newest uploads first), `oldest_first` (Oldest uploads first). Default: `name`.
- Name starts with (`starts_with`, text): Only names beginning with this text. Matching is on the file name itself, without the 'File:' in front.
- Uploaded by (`uploaded_by`, text): Only files uploaded by this account. Leave empty for everyone's.
- Uploaded on or after (`uploaded_after`, date and time): Only files uploaded at or after this moment. Leave empty for no earliest date.
- Uploaded on or before (`uploaded_before`, date and time): Only files uploaded at or before this moment. Pair it with 'Uploaded on or after' to read a single day or week.
- Number of results (`limit`, number): How many rows to return, up to 500. From 1 to 500. Default: `20`.

**Outputs**

- `count` (number)
- `files` (list)
- `sort` (text)
- `starts_with` (text)
- `uploaded_by` (text)

**Example output**

```json
{
  "count": 1,
  "files": [
    {
      "file_url": "https://upload.wikimedia.org/wikipedia/commons/3/3c/Eiffel_Tower_at_night%2C_16_October_2014.jpg",
      "height": 3456,
      "media_type": "BITMAP",
      "mime": "image/jpeg",
      "name": "Eiffel Tower at night, 16 October 2014.jpg",
      "page_url": "https://commons.wikimedia.org/wiki/File:Eiffel_Tower_at_night,_16_October_2014.jpg",
      "pageid": 38036802,
      "size": 2673059,
      "title": "File:Eiffel Tower at night, 16 October 2014.jpg",
      "uploaded_at": "2015-01-25T23:47:51Z",
      "uploader": "MarielaPerez5",
      "width": 4608
    }
  ],
  "sort": "name",
  "starts_with": "Eiffel Tower at night",
  "uploaded_by": ""
}
```

### Get a file's description page

Read the raw wikitext of a file's description page. Everything Commons knows about a file that is not in its structured data is written here in templates, so read it when a workflow needs something the shaped fields do not carry.

**Inputs**

- File (`file`, text, required): The file on Commons. Its name is enough ('Tour Eiffel Wikimedia Commons.jpg'), with or without the 'File:' in front, and a link to the file's page or to the image itself works too.

**Outputs**

- `edit_comment` (text)
- `edited_at` (text)
- `edited_by` (text)
- `page_url` (text)
- `pageid` (number)
- `revision_id` (number)
- `title` (text)
- `wikitext` (text): The page source, templates and all.

**Example output**

```json
{
  "edit_comment": "Adding a category based on EXIF data.",
  "edited_at": "2025-07-15T01:32:49Z",
  "edited_by": "Rkieferbot",
  "page_url": "https://commons.wikimedia.org/wiki/File:MSM_sunset.jpg",
  "pageid": 1697369,
  "revision_id": 1057518898,
  "title": "File:MSM sunset.jpg",
  "wikitext": "== {{int:filedesc}} ==\n{{Information\n|Description=Mont Saint-Michel in Normandy (Manche), France at night.\n|Source={{own}}\n|Date=2006-12-20\n|Author=[[user:Benh]]\n}}\n\n== {{int:license-header}} ==\n{{self|GFDL|Cc-by-sa-3.0-migrated}}\n\n[[Category:Mont Saint-Michel at night]]"
}
```

### Get a file's structured data

Read a file's captions and its Wikidata statements, such as depicts (P180). Commons has been re-describing its files as data rather than prose, and this is the machine-readable half: it says what a photo shows as an item id rather than as a sentence in one language.

**Inputs**

- File (`file`, text, required): The file on Commons. Its name is enough ('Tour Eiffel Wikimedia Commons.jpg'), with or without the 'File:' in front, and a link to the file's page or to the image itself works too.

**Outputs**

- `caption_count` (number)
- `captions` (list)
- `depicts` (list): Wikidata items the file is stated to show.
- `entity_id` (text): The file's media-info entity, e.g. 'M6926930'.
- `page_url` (text)
- `pageid` (number)
- `statement_count` (number)
- `statements` (list)
- `title` (text)

**Example output**

```json
{
  "caption_count": 2,
  "captions": [
    {
      "language": "en",
      "text": "the \"tour Eiffel\", Paris, France"
    },
    {
      "language": "ru",
      "text": "\u042d\u0439\u0444\u0435\u043b\u0435\u0432\u0430 \u0431\u0430\u0448\u043d\u044f"
    }
  ],
  "depicts": [
    {
      "item_id": "Q243",
      "url": "https://www.wikidata.org/wiki/Q243"
    }
  ],
  "entity_id": "M6926930",
  "page_url": "https://commons.wikimedia.org/wiki/File:Tour_Eiffel_Wikimedia_Commons.jpg",
  "pageid": 6926930,
  "statement_count": 2,
  "statements": [
    {
      "count": 1,
      "property": "depicts",
      "property_id": "P180",
      "values": [
        {
          "item_id": "Q243",
          "language": "",
          "latitude": null,
          "longitude": null,
          "type": "item",
          "url": "https://www.wikidata.org/wiki/Q243",
          "value": "Q243"
        }
      ]
    },
    {
      "count": 1,
      "property": "coordinates of the point of view",
      "property_id": "P1259",
      "values": [
        {
          "item_id": "",
          "language": "",
          "latitude": 48.858093,
          "longitude": 2.294694,
          "type": "coordinate",
          "url": "",
          "value": "48.858093, 2.294694"
        }
      ]
    }
  ],
  "title": "File:Tour Eiffel Wikimedia Commons.jpg"
}
```

### Get a file's versions

List the versions of the file itself, newest first. A Commons file can be re-uploaded over with a crop, a higher resolution or a restoration, and each version keeps its own URL, so a workflow can tell whether the file it recorded is still the one being served.

**Inputs**

- File (`file`, text, required): The file on Commons. Its name is enough ('Tour Eiffel Wikimedia Commons.jpg'), with or without the 'File:' in front, and a link to the file's page or to the image itself works too.
- Number of versions (`limit`, number): How many versions to return, up to 500. From 1 to 500. Default: `10`.

**Outputs**

- `count` (number)
- `page_url` (text)
- `pageid` (number)
- `revisions` (list)
- `title` (text)

**Example output**

```json
{
  "count": 2,
  "page_url": "https://commons.wikimedia.org/wiki/File:Tour_Eiffel_Wikimedia_Commons.jpg",
  "pageid": 6926930,
  "revisions": [
    {
      "comment": "Filled in a hole.",
      "file_url": "https://upload.wikimedia.org/wikipedia/commons/a/a8/Tour_Eiffel_Wikimedia_Commons.jpg",
      "height": 5367,
      "is_current": true,
      "mime": "image/jpeg",
      "sha1": "ecddecabc256113d4b17589350de9284b135643c",
      "size": 5279797,
      "uploaded_at": "2009-06-02T21:08:07Z",
      "uploaded_by": "Benh",
      "width": 2900
    },
    {
      "comment": "Eiffel Tower, seen from the champ de Mars, Paris",
      "file_url": "https://upload.wikimedia.org/wikipedia/commons/archive/a/a8/20090602210807%21Tour_Eiffel_Wikimedia_Commons.jpg",
      "height": 5367,
      "is_current": false,
      "mime": "image/jpeg",
      "sha1": "6b1a2c60bd8a0f0a2fbb3e5b2b0e1a4c9d3f7e21",
      "size": 5252798,
      "uploaded_at": "2009-06-02T18:08:12Z",
      "uploaded_by": "Benh",
      "width": 2900
    }
  ],
  "title": "File:Tour Eiffel Wikimedia Commons.jpg"
}
```

### Get category details

Count what one category holds, without listing any of it. The counts are of direct members only, which is how a workflow decides whether a category is worth walking into before asking for its contents.

**Inputs**

- Category (`category`, text, required): The category on Commons, with or without the 'Category:' in front. Categories are how Commons is organised; find one with 'Search categories' or 'Suggest titles'.

**Outputs**

- `file_count` (number)
- `hidden` (true/false)
- `member_count` (number)
- `name` (text)
- `page_count` (number): Gallery and other pages filed here.
- `pageid` (number)
- `subcategory_count` (number)
- `title` (text)
- `url` (text)

**Example output**

```json
{
  "file_count": 0,
  "hidden": false,
  "member_count": 32,
  "name": "Eiffel Tower",
  "page_count": 1,
  "pageid": 635013,
  "subcategory_count": 31,
  "title": "Category:Eiffel Tower",
  "url": "https://commons.wikimedia.org/wiki/Category:Eiffel_Tower"
}
```

### Get contributor details

Look up a Commons contributor: how long they have been here, how active they are and what rights they hold. Read it to check who is behind an upload before reusing their work, or to credit them by the name their account carries.

**Inputs**

- Account name (`username`, text, required): The contributor's account name on Commons, as it appears on an upload. A link to their user page works too.

**Outputs**

- `block_reason` (text)
- `edit_count` (number)
- `gender` (text)
- `groups` (list): Rights granted to this account, beyond an ordinary user's.
- `is_blocked` (true/false)
- `name` (text)
- `registered_at` (text)
- `uploads_url` (text): The list of everything this account has uploaded.
- `user_page_url` (text)
- `userid` (number)

**Example output**

```json
{
  "block_reason": "",
  "edit_count": 8427,
  "gender": "male",
  "groups": [
    "filemover",
    "patroller",
    "rollbacker"
  ],
  "is_blocked": false,
  "name": "Benh",
  "registered_at": "2006-04-20T16:56:09Z",
  "uploads_url": "https://commons.wikimedia.org/wiki/Special:ListFiles/Benh",
  "user_page_url": "https://commons.wikimedia.org/wiki/User:Benh",
  "userid": 37935
}
```

### Get file details

Everything about one file, including how it must be credited. Commons files are free to reuse but nearly all of them ask for attribution, so this returns the licence, the author and the credit line alongside the file's URL, size and dimensions.

**Inputs**

- File (`file`, text, required): The file on Commons. Its name is enough ('Tour Eiffel Wikimedia Commons.jpg'), with or without the 'File:' in front, and a link to the file's page or to the image itself works too.
- Description language (`language`, text): Which language to return the description and credit in. Commons descriptions are written in many languages at once; a file with none in the language chosen falls back to what it has. Defaults to English. Default: `en`.
- Thumbnail width (`thumbnail_width`, number): How wide the preview image of each result should be, in pixels. Commons renders it on demand, so nothing is downloaded until the URL is used. From 40 to 4000. Default: `320`.

**Outputs**

- `artist` (text): Who made it, as the credit should name them.
- `attribution_required` (true/false): Whether the licence requires the author to be named.
- `caption` (text)
- `credit` (text): Where it came from, e.g. 'Own work'.
- `date_created` (text)
- `description` (text): What the file shows, as plain text.
- `file_url` (text)
- `height` (number)
- `language` (text)
- `latitude` (number)
- `license` (text): Short licence name, e.g. 'CC BY-SA 4.0'.
- `license_code` (text)
- `license_url` (text)
- `longitude` (number)
- `media_type` (text)
- `mime` (text)
- `name` (text)
- `page_url` (text)
- `pageid` (number)
- `restrictions` (text): Non-copyright restrictions, such as a trademark.
- `sha1` (text)
- `size` (number)
- `thumbnail_url` (text)
- `title` (text)
- `uploaded_at` (text)
- `uploader` (text)
- `usage_terms` (text)
- `width` (number)

**Example output**

```json
{
  "artist": "Benh LIEU SONG",
  "attribution_required": false,
  "caption": "Tour Eiffel Wikimedia Commons.jpg",
  "credit": "Own work",
  "date_created": "2009-06-01",
  "description": "Eiffel Tower, seen from the Champ de Mars, Paris, France",
  "file_url": "https://upload.wikimedia.org/wikipedia/commons/a/a8/Tour_Eiffel_Wikimedia_Commons.jpg",
  "height": 5367,
  "language": "en",
  "latitude": 48.858093,
  "license": "Public domain",
  "license_code": "pd",
  "license_url": "",
  "longitude": 2.294694,
  "media_type": "BITMAP",
  "mime": "image/jpeg",
  "name": "Tour Eiffel Wikimedia Commons.jpg",
  "page_url": "https://commons.wikimedia.org/wiki/File:Tour_Eiffel_Wikimedia_Commons.jpg",
  "pageid": 6926930,
  "restrictions": "",
  "sha1": "ecddecabc256113d4b17589350de9284b135643c",
  "size": 5279797,
  "thumbnail_url": "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a8/Tour_Eiffel_Wikimedia_Commons.jpg/330px-Tour_Eiffel_Wikimedia_Commons.jpg",
  "title": "File:Tour Eiffel Wikimedia Commons.jpg",
  "uploaded_at": "2009-06-02T21:08:07Z",
  "uploader": "Benh",
  "usage_terms": "Public domain",
  "width": 2900
}
```

### Get random files

Pull random files from the whole repository, for a daily picture post, a screensaver feed, or sampling what Commons holds.

**Inputs**

- How many (`limit`, number): How many random files to return, up to 50. From 1 to 50. Default: `5`.
- Thumbnail width (`thumbnail_width`, number): How wide the preview image of each result should be, in pixels. Commons renders it on demand, so nothing is downloaded until the URL is used. From 40 to 4000. Default: `320`.

**Outputs**

- `count` (number)
- `files` (list)

**Example output**

```json
{
  "count": 1,
  "files": [
    {
      "file_url": "https://upload.wikimedia.org/wikipedia/commons/1/18/Pennsylvania_State_Route_61_-_4167588723.jpg",
      "height": 1200,
      "media_type": "BITMAP",
      "mime": "image/jpeg",
      "name": "Pennsylvania State Route 61 - 4167588723.jpg",
      "page_url": "https://commons.wikimedia.org/wiki/File:Pennsylvania_State_Route_61_-_4167588723.jpg",
      "pageid": 141200723,
      "size": 429533,
      "thumbnail_url": "https://upload.wikimedia.org/wikipedia/commons/thumb/1/18/Pennsylvania_State_Route_61_-_4167588723.jpg/330px-Pennsylvania_State_Route_61_-_4167588723.jpg",
      "title": "File:Pennsylvania State Route 61 - 4167588723.jpg",
      "uploaded_at": "2023-11-21T20:46:32Z",
      "uploader": "Sercactusbot",
      "width": 1600
    }
  ]
}
```

### Get the categories a file is in

List the categories one file is filed under, which is how Commons says what a file is about. Housekeeping categories are hidden on the site and left out here unless asked for.

**Inputs**

- File (`file`, text, required): The file on Commons. Its name is enough ('Tour Eiffel Wikimedia Commons.jpg'), with or without the 'File:' in front, and a link to the file's page or to the image itself works too.
- Include housekeeping categories (`include_hidden`, true/false): Include the categories Commons uses for its own maintenance, such as licence tracking. Off by default, because they say nothing about the subject. Default: `false`.
- Number of categories (`limit`, number): How many categories to return, up to 500. From 1 to 500. Default: `50`.

**Outputs**

- `categories` (list)
- `count` (number)
- `include_hidden` (true/false)
- `pageid` (number)
- `title` (text)

**Example output**

```json
{
  "categories": [
    {
      "hidden": false,
      "name": "Eiffel Tower in 2009",
      "title": "Category:Eiffel Tower in 2009",
      "url": "https://commons.wikimedia.org/wiki/Category:Eiffel_Tower_in_2009"
    },
    {
      "hidden": false,
      "name": "Blue gradient",
      "title": "Category:Blue gradient",
      "url": "https://commons.wikimedia.org/wiki/Category:Blue_gradient"
    }
  ],
  "count": 2,
  "include_hidden": false,
  "pageid": 6926930,
  "title": "File:Tour Eiffel Wikimedia Commons.jpg"
}
```

### Get thumbnail URL

Ask Commons to render one file at a given width and return the URL, for embedding it in an email, a document or a message without moving the original. Works for video and PDF too, which are rendered as a first frame or a first page. Commons rounds up to its nearest standard size, so the image served can be a little wider than the one asked for.

**Inputs**

- File (`file`, text, required): The file on Commons. Its name is enough ('Tour Eiffel Wikimedia Commons.jpg'), with or without the 'File:' in front, and a link to the file's page or to the image itself works too.
- Width (`width`, number): How wide the rendered image should be, in pixels. From 40 to 4000. Default: `800`.

**Outputs**

- `file_url` (text)
- `height` (number): Height of the original file.
- `mime` (text)
- `page_url` (text)
- `pageid` (number)
- `requested_width` (number)
- `thumbnail_height` (number)
- `thumbnail_url` (text)
- `thumbnail_width` (number)
- `title` (text)
- `width` (number): Width of the original file.

**Example output**

```json
{
  "file_url": "https://upload.wikimedia.org/wikipedia/commons/a/a8/Tour_Eiffel_Wikimedia_Commons.jpg",
  "height": 5367,
  "mime": "image/jpeg",
  "page_url": "https://commons.wikimedia.org/wiki/File:Tour_Eiffel_Wikimedia_Commons.jpg",
  "pageid": 6926930,
  "requested_width": 640,
  "thumbnail_height": 1184,
  "thumbnail_url": "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a8/Tour_Eiffel_Wikimedia_Commons.jpg/960px-Tour_Eiffel_Wikimedia_Commons.jpg",
  "thumbnail_width": 640,
  "title": "File:Tour Eiffel Wikimedia Commons.jpg",
  "width": 2900
}
```

### Get where a file is used

List the pages across every Wikimedia project that use this file. Commons is the shared repository behind all of them, so one photo can be on a Wikipedia article in forty languages at once. This is the measure of how widely a file is actually used.

**Inputs**

- File (`file`, text, required): The file on Commons. Its name is enough ('Tour Eiffel Wikimedia Commons.jpg'), with or without the 'File:' in front, and a link to the file's page or to the image itself works too.
- Number of pages (`limit`, number): How many using pages to return, up to 500. From 1 to 500. Default: `50`.

**Outputs**

- `count` (number)
- `pageid` (number)
- `project_count` (number): How many distinct projects use it.
- `projects` (list)
- `title` (text)
- `usages` (list)

**Example output**

```json
{
  "count": 2,
  "pageid": 6926930,
  "project_count": 2,
  "projects": [
    "af.wikipedia.org",
    "ar.wikipedia.org"
  ],
  "title": "File:Tour Eiffel Wikimedia Commons.jpg",
  "usages": [
    {
      "page_title": "1889",
      "url": "https://af.wikipedia.org/wiki/1889",
      "wiki": "af.wikipedia.org"
    },
    {
      "page_title": "\u0628\u0631\u062c_\u0625\u064a\u0641\u0644",
      "url": "https://ar.wikipedia.org/wiki/%D8%A8%D8%B1%D8%AC_%D8%A5%D9%8A%D9%81%D9%84",
      "wiki": "ar.wikipedia.org"
    }
  ]
}
```

### List recent changes

Read the recent-changes feed, filtered to what a workflow watches for. Bots do most of the editing on Commons, so they are left out unless asked for, which is what makes this readable as 'what did people change'.

**Inputs**

- Part of the site (`namespace`, text): Only changes to pages in this part of Commons. File is the media itself; Category is its subject index.
- Kinds of change (`change_types`, list): Which kinds of change to include. Leave none chosen for all of them. One or more of: `edit` (Edits to existing pages), `new` (New pages), `log` (Logged actions), `categorize` (Category changes).
- Tagged with (`tag`, text): Only changes carrying this tag. A tag is the mark a tool or a filter leaves on an edit, so this is how 'edits made with HotCat' is asked for.
- Changed by (`changed_by`, text): Only changes made by this account.
- Changed on or after (`changed_after`, date and time): Only changes at or after this moment. Commons keeps about 30 days of recent changes.
- Changed on or before (`changed_before`, date and time): Only changes at or before this moment.
- Include bot edits (`include_bots`, true/false): Include changes made by bots. Off by default, because bots make most of the edits on Commons. Default: `false`.
- Order (`sort`, text): Whether to start from the newest or the oldest. One of: `newest_first` (Newest first), `oldest_first` (Oldest first). Default: `newest_first`.
- Number of results (`limit`, number): How many rows to return, up to 500. From 1 to 500. Default: `20`.

**Outputs**

- `change_types` (list)
- `changes` (list)
- `count` (number)
- `include_bots` (true/false)
- `namespace` (number)
- `sort` (text)
- `tag` (text)

**Example output**

```json
{
  "change_types": [
    "edit"
  ],
  "changes": [
    {
      "changed_at": "2026-08-27T20:31:44Z",
      "changed_by": "Eskivor",
      "comment": "Moving to Category:Silver Celtic coins from Gallica",
      "is_bot": false,
      "is_minor": true,
      "is_new": false,
      "name": "Monnaie - Argent, fonds celtique.jpg",
      "page_url": "https://commons.wikimedia.org/wiki/File:Monnaie_-_Argent,_fonds_celtique.jpg",
      "pageid": 137589288,
      "previous_revision_id": 1268426623,
      "revision_id": 1268460772,
      "size_change": 7,
      "tags": [],
      "title": "File:Monnaie - Argent, fonds celtique.jpg",
      "type": "edit"
    }
  ],
  "count": 1,
  "include_bots": false,
  "namespace": 6,
  "sort": "newest_first",
  "tag": ""
}
```

### List recent uploads

Read the upload log: what was uploaded to Commons, by whom and when. The log records the act of uploading, so unlike the file index it can tell a brand new file from a new version of an existing one.

**Inputs**

- Uploaded by (`uploaded_by`, text): Only files uploaded by this account. Leave empty for everyone's.
- Uploaded on or after (`uploaded_after`, date and time): Only files uploaded at or after this moment. Leave empty for no earliest date.
- Uploaded on or before (`uploaded_before`, date and time): Only files uploaded at or before this moment. Pair it with 'Uploaded on or after' to read a single day or week.
- Which uploads (`upload_kind`, text): Whether to include new versions of existing files. One of: `any` (New files and new versions), `new_files` (New files only), `overwrites` (New versions only). Default: `any`.
- Order (`sort`, text): Whether to start from the newest or the oldest. One of: `newest_first` (Newest first), `oldest_first` (Oldest first). Default: `newest_first`.
- Number of results (`limit`, number): How many rows to return, up to 500. From 1 to 500. Default: `20`.

**Outputs**

- `count` (number)
- `sort` (text)
- `upload_kind` (text)
- `uploaded_by` (text)
- `uploads` (list)

**Example output**

```json
{
  "count": 1,
  "sort": "newest_first",
  "upload_kind": "new_files",
  "uploaded_by": "",
  "uploads": [
    {
      "comment": "Uploaded via Curator",
      "kind": "upload",
      "log_id": 406176231,
      "name": "Weimar - Postamt - geo.hlipp.de - 40038.jpg",
      "page_url": "https://commons.wikimedia.org/wiki/File:Weimar_-_Postamt_-_geo.hlipp.de_-_40038.jpg",
      "pageid": 198302429,
      "title": "File:Weimar - Postamt - geo.hlipp.de - 40038.jpg",
      "uploaded_at": "2026-08-27T20:11:11Z",
      "uploaded_by": "PantheraLeo1359531"
    }
  ]
}
```

### List subcategories

List the subcategories of one category. Commons splits a large subject into narrower ones by date, place, medium and condition, so this is how a workflow walks down to the files it actually wants.

**Inputs**

- Category (`category`, text, required): The category on Commons, with or without the 'Category:' in front. Categories are how Commons is organised; find one with 'Search categories' or 'Suggest titles'.
- Order (`sort`, text): What order to list the members in. 'By name' is the order the category page itself shows. One of: `name` (By name), `newest_first` (Most recently added first), `oldest_first` (First added first). Default: `name`.
- Number of results (`limit`, number): How many rows to return, up to 500. From 1 to 500. Default: `20`.

**Outputs**

- `category` (text)
- `category_title` (text)
- `category_url` (text)
- `count` (number)
- `subcategories` (list)

**Example output**

```json
{
  "category": "Eiffel Tower",
  "category_title": "Category:Eiffel Tower",
  "category_url": "https://commons.wikimedia.org/wiki/Category:Eiffel_Tower",
  "count": 2,
  "subcategories": [
    {
      "added_to_category_at": "2025-06-18T00:34:52Z",
      "name": "Eiffel Tower by decade",
      "pageid": 30353279,
      "title": "Category:Eiffel Tower by decade",
      "url": "https://commons.wikimedia.org/wiki/Category:Eiffel_Tower_by_decade"
    },
    {
      "added_to_category_at": "2025-06-18T00:35:10Z",
      "name": "Eiffel Tower at night",
      "pageid": 3140462,
      "title": "Category:Eiffel Tower at night",
      "url": "https://commons.wikimedia.org/wiki/Category:Eiffel_Tower_at_night"
    }
  ]
}
```

### List the files in a category

List the files filed directly under one category, each with its URL and a preview. Only direct members: Commons categories nest, so a file in 'Eiffel Tower at night' is not in 'Eiffel Tower'. Walk down with 'List subcategories'.

**Inputs**

- Category (`category`, text, required): The category on Commons, with or without the 'Category:' in front. Categories are how Commons is organised; find one with 'Search categories' or 'Suggest titles'.
- Order (`sort`, text): What order to list the members in. 'By name' is the order the category page itself shows. One of: `name` (By name), `newest_first` (Most recently added first), `oldest_first` (First added first). Default: `name`.
- Number of results (`limit`, number): How many results to return, up to 50. From 1 to 50. Default: `10`.
- Thumbnail width (`thumbnail_width`, number): How wide the preview image of each result should be, in pixels. Commons renders it on demand, so nothing is downloaded until the URL is used. From 40 to 4000. Default: `320`.

**Outputs**

- `category` (text)
- `category_title` (text)
- `category_url` (text)
- `count` (number)
- `files` (list)

**Example output**

```json
{
  "category": "Eiffel Tower in 2009",
  "category_title": "Category:Eiffel Tower in 2009",
  "category_url": "https://commons.wikimedia.org/wiki/Category:Eiffel_Tower_in_2009",
  "count": 1,
  "files": [
    {
      "added_to_category_at": "2025-06-17T19:17:44Z",
      "file_url": "https://upload.wikimedia.org/wikipedia/commons/b/bb/3949ParigiTourEiffel.JPG",
      "height": 600,
      "media_type": "BITMAP",
      "mime": "image/jpeg",
      "name": "3949ParigiTourEiffel.JPG",
      "page_url": "https://commons.wikimedia.org/wiki/File:3949ParigiTourEiffel.JPG",
      "pageid": 18120328,
      "size": 150047,
      "thumbnail_url": "https://upload.wikimedia.org/wikipedia/commons/thumb/b/bb/3949ParigiTourEiffel.JPG/330px-3949ParigiTourEiffel.JPG",
      "title": "File:3949ParigiTourEiffel.JPG",
      "uploaded_at": "2012-05-06T09:23:11Z",
      "uploader": "Cavagnaro",
      "width": 800
    }
  ]
}
```

### Search categories

Search Commons for categories by subject. Commons files everything into categories rather than folders, so this is usually the first step: find the category, then list what is in it.

**Inputs**

- Search for (`query`, text, required): The subject to find categories about.
- Number of results (`limit`, number): How many results to return, up to 50. From 1 to 50. Default: `10`.

**Outputs**

- `categories` (list)
- `count` (number)
- `query` (text)
- `total_hits` (number)

**Example output**

```json
{
  "categories": [
    {
      "name": "Eiffel Tower",
      "pageid": 635013,
      "snippet": "Tour Eiffel; Torre Eiffel; Eiffelturm",
      "title": "Category:Eiffel Tower",
      "url": "https://commons.wikimedia.org/wiki/Category:Eiffel_Tower"
    }
  ],
  "count": 1,
  "query": "Eiffel Tower",
  "total_hits": 655
}
```

### Search files

Search Wikimedia Commons for freely licensed photos, video, audio, documents and 3D models. Each result comes back ready to use: the file's own URL, a preview at the width you ask for, its dimensions and who uploaded it.

**Inputs**

- Search for (`query`, text, required): What to search for. Commons searches the file's description, its captions in every language, and its categories.
- Kind of file (`media_type`, text): Narrow the search to one kind of media. Leave it unset to search all of them. One of: `bitmap` (Photos and scans), `drawing` (Drawings and diagrams (SVG)), `video`, `audio`, `office` (Documents (PDF, DjVu)), `3d` (3D models).
- Order (`sort`, text): What order to return the matches in. One of: `relevance` (Best match), `newest_first` (Newest uploads first), `oldest_first` (Oldest uploads first), `recently_edited` (Recently edited first), `random`. Default: `relevance`.
- Number of results (`limit`, number): How many results to return, up to 50. From 1 to 50. Default: `10`.
- Thumbnail width (`thumbnail_width`, number): How wide the preview image of each result should be, in pixels. Commons renders it on demand, so nothing is downloaded until the URL is used. From 40 to 4000. Default: `320`.

**Outputs**

- `count` (number)
- `files` (list)
- `media_type` (text)
- `query` (text)
- `sort` (text)
- `total_hits` (number): How many files match in total, not just on this page.

**Example output**

```json
{
  "count": 1,
  "files": [
    {
      "file_url": "https://upload.wikimedia.org/wikipedia/commons/a/a8/Tour_Eiffel_Wikimedia_Commons.jpg",
      "height": 5367,
      "media_type": "BITMAP",
      "mime": "image/jpeg",
      "name": "Tour Eiffel Wikimedia Commons.jpg",
      "page_url": "https://commons.wikimedia.org/wiki/File:Tour_Eiffel_Wikimedia_Commons.jpg",
      "pageid": 6926930,
      "size": 5279797,
      "snippet": "the tour Eiffel, Paris, France",
      "thumbnail_url": "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a8/Tour_Eiffel_Wikimedia_Commons.jpg/330px-Tour_Eiffel_Wikimedia_Commons.jpg",
      "title": "File:Tour Eiffel Wikimedia Commons.jpg",
      "uploaded_at": "2009-06-02T21:08:07Z",
      "uploader": "Benh",
      "width": 2900
    }
  ],
  "media_type": "bitmap",
  "query": "Eiffel Tower",
  "sort": "relevance",
  "total_hits": 16321
}
```

### Search files near a location

Find geotagged files taken within a radius of a point, nearest first. Commons records where a photo was taken, so this answers 'what does this place look like' from coordinates alone.

**Inputs**

- Latitude (`latitude`, number, required): Latitude of the point to search around, in degrees. From -90 to 90.
- Longitude (`longitude`, number, required): Longitude of the point to search around, in degrees. From -180 to 180.
- Within (`radius_meters`, number): How far from the point to search, in metres. Commons will not search wider than 10 kilometres. From 10 to 10000. Default: `1000`.
- Number of results (`limit`, number): How many results to return, up to 50. From 1 to 50. Default: `10`.
- Thumbnail width (`thumbnail_width`, number): How wide the preview image of each result should be, in pixels. Commons renders it on demand, so nothing is downloaded until the URL is used. From 40 to 4000. Default: `320`.

**Outputs**

- `count` (number)
- `files` (list)
- `latitude` (number)
- `longitude` (number)
- `radius_meters` (number)

**Example output**

```json
{
  "count": 1,
  "files": [
    {
      "distance_meters": 0,
      "file_url": "https://upload.wikimedia.org/wikipedia/commons/0/07/Eiffel_Tower_by_night%2C_Paris%2C_FRANCE.jpg",
      "height": 2283,
      "latitude": 48.8584,
      "longitude": 2.2945,
      "media_type": "BITMAP",
      "mime": "image/jpeg",
      "name": "Eiffel Tower by night, Paris, FRANCE.jpg",
      "page_url": "https://commons.wikimedia.org/wiki/File:Eiffel_Tower_by_night,_Paris,_FRANCE.jpg",
      "pageid": 56382763,
      "size": 6565407,
      "thumbnail_url": "https://upload.wikimedia.org/wikipedia/commons/thumb/0/07/Eiffel_Tower_by_night%2C_Paris%2C_FRANCE.jpg/330px-Eiffel_Tower_by_night%2C_Paris%2C_FRANCE.jpg",
      "title": "File:Eiffel Tower by night, Paris, FRANCE.jpg",
      "uploaded_at": "2017-04-30T09:52:32Z",
      "uploader": "Yann",
      "width": 4061
    }
  ],
  "latitude": 48.8584,
  "longitude": 2.2945,
  "radius_meters": 200
}
```

### Suggest titles

Complete a partial title the way the search box on Commons does. Where 'Search files' matches the words on a page, this matches the start of its name, which turns a half-remembered file or category into the exact title the other actions need.

**Inputs**

- Starts with (`prefix`, text, required): The first part of the title.
- Look for (`scope`, text): Which kind of page to suggest titles from. One of: `files`, `categories`, `galleries`. Default: `files`.
- Number of suggestions (`limit`, number): How many suggestions to return, up to 100. From 1 to 100. Default: `10`.

**Outputs**

- `count` (number)
- `prefix` (text)
- `scope` (text)
- `suggestions` (list)

**Example output**

```json
{
  "count": 2,
  "prefix": "Eiffel Tower",
  "scope": "categories",
  "suggestions": [
    {
      "name": "Eiffel Tower",
      "title": "Category:Eiffel Tower",
      "url": "https://commons.wikimedia.org/wiki/Category:Eiffel_Tower"
    },
    {
      "name": "Eiffel Tower at night",
      "title": "Category:Eiffel Tower at night",
      "url": "https://commons.wikimedia.org/wiki/Category:Eiffel_Tower_at_night"
    }
  ]
}
```
