# Free Image Search - Licensed Images with Attribution (Commons) (`appdata-labs/commons-image-search`) Actor

Search Wikimedia Commons for free-licensed photos you may reuse, even commercially. Each image comes with file and thumbnail URLs, size, licence, author and a ready-made attribution line. Official MediaWiki API, no login, no API key. Filter to public domain and CC0 only.

- **URL**: https://apify.com/appdata-labs/commons-image-search.md
- **Developed by:** [Kobkoon Janngam](https://apify.com/appdata-labs) (community)
- **Categories:** Agents, MCP servers, SEO tools
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 image returneds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Free Image Search — licensed images with attribution, from Wikimedia Commons

**Search millions of free-licensed photos you are allowed to reuse, even commercially.** Each row is one image with its full-size and thumbnail URLs, dimensions, licence, author and a ready-made attribution line. For bloggers, marketers, app and game builders, dataset curators and AI agents that need pictures they can actually publish.

**Quick start:** press **Start** with no configuration. It returns 20 photos of a mountain lake. Then type what you need in `searchQuery`: `golden retriever puppy`, `Eiffel Tower at night`, `solar panels on a roof`.

### Sample output

| rank | title | license | author | size | attributionText |
|---|---|---|---|---|---|
| 1 | File:Mountains in snow, Mountain lake, Chola Valley, Nepal, Himalayas.jpg | CC BY 4.0 | Vyacheslav Argenberg | 4032×2688 | Mountains in snow, Mountain lake, Chola Valley, Nepal, Himalayas by Vyacheslav Argenberg, CC BY 4.0, via Wikimedia Commons |
| 2 | File:Zagedan Lakes, Mountain cirque, Caucasus Mountains.jpg | CC BY 4.0 | Vyacheslav Argenberg | 4912×3264 | Zagedan Lakes, Mountain cirque, Caucasus Mountains by Vyacheslav Argenberg, CC BY 4.0, via Wikimedia Commons |
| 7 | File:Mount Shasta, Lake Siskiyou, SW view.jpg | CC BY-SA 4.0 | Radomianin | 5806×3503 | Mount Shasta, Lake Siskiyou, SW view by Radomianin, CC BY-SA 4.0, via Wikimedia Commons |
| 8 | File:Northern part of Lake Wanaka with surrounding mountains, New Zealand.jpg | CC BY-SA 4.0 | Michal Klajban | 14714×2740 | Northern part of Lake Wanaka with surrounding mountains, New Zealand by Michal Klajban, CC BY-SA 4.0, via Wikimedia Commons |

These rows come from a run on 1 November 2026.

Every row also carries `fileUrl` (the original file), `thumbnailUrl` (a resized copy at your `thumbnailWidth`), `width`, `height`, `mime`, `sizeBytes`, `licenseUrl`, `attributionRequired` (true or false), `credit`, `description` (up to 500 characters, HTML removed), `dateCreated`, `pageUrl` (the file's Commons page), `searchQuery` and `rank`. A row is about 1.4 KB, so a hundred results fit in an AI agent's context.

### Why these images and not Google Images

A Google Images scraper returns pictures that belong to someone else. Most cannot be reused without asking. **Every file on Wikimedia Commons is under a free licence**: Commons accepts no "non-commercial" or "no derivatives" licences. You may use these images in a product, an ad, a post or a training set, as long as you follow the licence, which for most of them means crediting the author. This Actor gives you that credit line ready to paste.

### What you can do with it

- **Illustrate articles and posts** with pictures you are allowed to publish, and paste `attributionText` under each.
- **Give an AI agent pictures it can cite.** One call answers "find me a reusable photo of a red panda" with the licence attached.
- **Build image datasets** with clear provenance: every row names its licence and author.
- **Stay strictly attribution-free** with `licenseFilter: "public-domain"`, which keeps only public domain and CC0 images.

### Input

| Field | Default | Notes |
|---|---|---|
| `searchQuery` | `mountain lake` | Plain words. Photos and other bitmaps by default; add `filetype:drawing` for SVG drawings. |
| `maxItems` | `20` | Up to 500 per run, in Commons' relevance order. |
| `thumbnailWidth` | `800` | Pixel width of `thumbnailUrl`. Wikimedia serves the nearest standard size at or above it. |
| `licenseFilter` | `any` | `any` or `public-domain` (public domain and CC0 only). |

### Empty results and errors

A search that matches nothing **succeeds with an empty dataset** and says so in the log, so a scheduled run or an agent never mistakes "no images" for a crash. An empty query or an unknown licence filter fails at once with a plain message. The `SUMMARY` record in the key-value store says how many files were read, returned and removed by the filter.

### How it works

The Actor calls the **MediaWiki Action API** on commons.wikimedia.org, which is documented for programmatic use. It needs no login and no API key. Requests go one at a time with a descriptive User-Agent and `maxlag`, as Wikimedia's API etiquette asks. Each request returns up to 50 images. The Actor returns links and metadata; it does not download or re-host the files.

### Pricing

You pay per image returned: **$4 per 1,000 images**. Images removed by the licence filter cost nothing. The run respects your spending limit.

### FAQ

**Do I have to credit the author?** For CC BY and CC BY-SA images, yes. `attributionRequired` tells you, and `attributionText` is a credit line in the form Creative Commons recommends. Share-alike (SA) licences also ask you to share adaptations under the same licence. Read `licenseUrl` when in doubt.

**Is the licence information guaranteed?** It is what the uploader declared on Commons and the community reviews it, but this Actor cannot verify rights itself. For high-stakes use, open `pageUrl` and check the file page.

**Why is the thumbnail wider than I asked?** Wikimedia serves thumbnails in standard widths and picks the nearest one at or above yours. The image is the same.

### Disclaimer

This is an unofficial tool, not affiliated with or endorsed by the Wikimedia Foundation. Wikimedia Commons and Wikipedia are trademarks of the Wikimedia Foundation. Images belong to their authors and are used under the licences shown in each row; you are responsible for following those licences when you reuse them.

# Actor input Schema

## `searchQuery` (type: `string`):

What the image should show, in plain words, as you would type it into an image search. English works best. Photos and other bitmaps are returned unless you add a Commons filetype yourself, for example "filetype:drawing" for SVG drawings.

## `maxItems` (type: `integer`):

Return at most this many images, in Commons' relevance order. Up to 500 per run. One API request fetches 50 images.

## `thumbnailWidth` (type: `integer`):

Width in pixels of the thumbnail URL returned with each image (thumbnailUrl), 50 to 4000. Wikimedia serves the nearest standard size at or above this width. The full-size original is always in fileUrl.

## `licenseFilter` (type: `string`):

"any" returns every free licence Commons accepts (CC BY, CC BY-SA, CC0, public domain and similar): all allow commercial reuse, most with attribution. "public-domain" keeps only public domain and CC0 images, which need no attribution. Removed images are not charged.

## Actor input object example

```json
{
  "searchQuery": "golden retriever puppy",
  "maxItems": 100,
  "thumbnailWidth": 1280,
  "licenseFilter": "public-domain"
}
```

# Actor output Schema

## `rows` (type: `string`):

Free-licensed images matching the search, with licence, author and attribution text

## `summary` (type: `string`):

The search, how many files were read and returned, how many the licence filter removed, and whether the spending limit stopped the run.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "searchQuery": "mountain lake",
    "maxItems": 20,
    "thumbnailWidth": 800,
    "licenseFilter": "any"
};

// Run the Actor and wait for it to finish
const run = await client.actor("appdata-labs/commons-image-search").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "searchQuery": "mountain lake",
    "maxItems": 20,
    "thumbnailWidth": 800,
    "licenseFilter": "any",
}

# Run the Actor and wait for it to finish
run = client.actor("appdata-labs/commons-image-search").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "searchQuery": "mountain lake",
  "maxItems": 20,
  "thumbnailWidth": 800,
  "licenseFilter": "any"
}' |
apify call appdata-labs/commons-image-search --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,appdata-labs/commons-image-search"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/eEe11vksMPf198XwK/builds/hQvRXiNj9pCfYRhsJ/openapi.json
