# Wikimedia Commons File Search API

Search Wikimedia Commons File via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by Wikimedia, pass parameters such as action, format, formatversion, and retrieve structured data including commons page identifier, file page title, and search-result index to discover source media, build an editorial shortlist, and connect to file metadata.

Documentation: https://openany.si/market/apis/wikipedia/wikimedia-commons-file-search/
API ID: c0967425-5e95-4bc7-b102-f85adbbb6620
Provider: wikimedia
Contract revision: 7
Method: GET
Endpoint: https://api.openany.si/v1/agent-apis/wikimedia/commons/search
Page update time: 2026-12-03T02:36:40.006Z
Access: OpenAny REST
OpenAny MCP: availability is not supplied by this REST contract. Check get_api on the configured OpenAny MCP server before execution.
Request content type: none
Execution mode: sync
Authentication: Authorization: Bearer $OPENANY_API_KEY

## Billing
Price: $0 / call
API-key calls use your shared balance. Review the published billing rules before making a paid request.
Price source: OpenAny public API contract. Price update time: not supplied.
Contract update time: 2026-12-03T02:36:40.006Z. This is not a price-change timestamp.
```json
{
  "currency": "USD",
  "mode": "fixed",
  "priceMicroUsd": "0",
  "rounding": null,
  "unit": "call",
  "unitQuantity": null
}
```

## Request parameters
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Wikimedia Commons File Search API request inputs",
  "$comment": "Declared input types grouped by HTTP location. Path, query and header values describe decoded inputs and are serialized as text on the wire; body is the payload. This is not an exhaustive provider contract or a schema for the raw HTTP request.",
  "type": "object",
  "properties": {
    "path": {
      "type": "object",
      "properties": {}
    },
    "query": {
      "type": "object",
      "properties": {
        "action": {
          "type": "string",
          "description": "Set to query.",
          "enum": [
            "query"
          ]
        },
        "generator": {
          "type": "string",
          "description": "Set to search.",
          "enum": [
            "search"
          ]
        },
        "gsrnamespace": {
          "type": "string",
          "description": "Set to 6.",
          "enum": [
            "6"
          ]
        },
        "gsrlimit": {
          "type": "integer",
          "description": "Maximum number of files to return.",
          "minimum": 1,
          "maximum": 10
        },
        "gsrsearch": {
          "type": "string",
          "description": "Search keywords.",
          "minLength": 1,
          "maxLength": 255
        },
        "format": {
          "type": "string",
          "description": "Set to json.",
          "enum": [
            "json"
          ]
        },
        "formatversion": {
          "type": "string",
          "description": "Set to 2.",
          "enum": [
            "2"
          ]
        }
      },
      "required": [
        "action",
        "generator",
        "gsrnamespace",
        "gsrlimit",
        "gsrsearch",
        "format",
        "formatversion"
      ]
    },
    "headers": {
      "type": "object",
      "properties": {}
    }
  },
  "required": [
    "path",
    "query",
    "headers"
  ]
}
```

## Response fields
Source: Inferred from examples; not an exhaustive provider schema.
```json
{
  "type": "object",
  "properties": {
    "batchcomplete": {
      "type": "boolean"
    },
    "continue": {
      "type": "object",
      "properties": {
        "continue": {
          "type": "string"
        },
        "gsroffset": {
          "type": "integer"
        }
      }
    },
    "query": {
      "type": "object",
      "properties": {
        "pages": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "index": {
                "type": "integer"
              },
              "ns": {
                "type": "integer"
              },
              "pageid": {
                "type": "integer"
              },
              "title": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}
```

## Request example
Scenario: Documentation example
```bash
curl \
  'https://api.openany.si/v1/agent-apis/wikimedia/commons/search?action=query&format=json&formatversion=2&generator=search&gsrlimit=2&gsrnamespace=6&gsrsearch=Isaac+Newton' \
  -X GET \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json'
```

## Response example
Published documentation example. Verify the actual response after an approved call.
Sample response · Documented HTTP 200
```json
{
  "batchcomplete": true,
  "continue": {
    "continue": "gsroffset||",
    "gsroffset": 2
  },
  "query": {
    "pages": [
      {
        "index": 1,
        "ns": 6,
        "pageid": 6364764,
        "title": "File:Sir Isaac Newton by Sir Godfrey Kneller, Bt.jpg"
      },
      {
        "index": 2,
        "ns": 6,
        "pageid": 62394615,
        "title": "File:Sir Isaac Newton bust in METU Campus Ankara Turkey.jpg"
      }
    ]
  }
}
```

## Error handling
400: Check the request fields.
401 / 403: Verify credentials and access permissions.
402: Inspect payment requirements and balance.
429: Respect returned retry guidance.
5xx: Inspect the error and usage record before retrying a paid operation.

Integration guide: https://openany.si/docs/
Agent setup: https://openany.si/SKILL.md
