# Wikimedia Commons API
> Search millions of freely-licensed images and media as an API, from Wikimedia Commons. Pass a search term and get matching photos and illustrations with their direct full-resolution image URL, a ready-to-use thumbnail, dimensions, file size, MIME type, and crucially the licence (Creative Commons or public domain), licence URL and author/credit — everything you need to find and correctly attribute reusable media. Or look up a single file by name for its full details. Ideal for blogs, content and marketing tools, presentations, education and apps that need free, attributable imagery. Open data from Wikimedia Commons (always check each file's licence before reuse).

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/commons-api/..."
```

## Pricing
- **Free** (Free) — 3,700 calls/Mo, 2 req/s
- **Starter** ($5/Mo) — 49,800 calls/Mo, 8 req/s
- **Pro** ($13/Mo) — 244,000 calls/Mo, 20 req/s
- **Mega** ($34/Mo) — 1,207,000 calls/Mo, 50 req/s

## Endpoints

### Commons

#### `GET /v1/image` — One file by name

**Parameters:**
- `title` (query, required, string) — File name, e.g. Example.jpg (File: prefix optional) Example: `Example.jpg`
- `thumb_width` (query, optional, string) — Thumbnail width in px (80-2048, default 640)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/commons-api/v1/image?title=Example.jpg"
```

**Response:**
```json
{
    "data": {
        "file": {
            "date": "2026-05-28",
            "mime": "image/jpeg",
            "title": "Example.jpg",
            "width": 172,
            "author": "",
            "credit": "Own work",
            "height": 178,
            "license": "Public domain",
            "page_url": "https://commons.wikimedia.org/wiki/File:Example.jpg",
            "image_url": "https://upload.wikimedia.org/wikipedia/commons/a/a9/Example.jpg",
            "categories": "PD ineligible|PD text|Protected files|Vector version available|Example images|Commons prohibited file names|English-language image placeholders|PD-text missing SDC copyright status",
            "size_bytes": 9022,
            "license_url": null,
            "thumbnail_url": "https://upload.wikimedia.org/wikipedia/commons/a/a9/Example.jpg"
        }
    },
    "meta": {
        "timestamp": "2026-05-31T11:06:35.152Z",
        "request_id": "23c0a66f-a2d3-468e-85c2-d81522a2bddf"
    },
    "status": "ok",
    "message": "File retrieved",
    "success": true
}
```

#### `GET /v1/search` — Search Commons for media

**Parameters:**
- `q` (query, required, string) — Search term, e.g. mountain, eiffel tower Example: `mountain`
- `limit` (query, optional, string) — Results per page (1-50, default 12) Example: `12`
- `offset` (query, optional, string) — Pagination offset Example: `0`
- `thumb_width` (query, optional, string) — Thumbnail width in px (80-1024, default 320)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/commons-api/v1/search?q=mountain&limit=12&offset=0"
```

**Response:**
```json
{
    "data": {
        "count": 12,
        "limit": 12,
        "query": "mountain",
        "total": 12,
        "offset": 0,
        "results": [
            {
                "date": "2009-10-18 12:40:30",
                "mime": "image/jpeg",
                "title": "Himalayas, Ama Dablam, Nepal.jpg",
                "width": 4032,
                "author": "Vyacheslav Argenberg",
                "credit": "Own work",
                "height": 2688,
                "license": "CC BY 4.0",
                "page_url": "https://commons.wikimedia.org/wiki/File:Himalayas,_Ama_Dablam,_Nepal.jpg",
                "image_url": "https://upload.wikimedia.org/wikipedia/commons/2/29/Himalayas%2C_Ama_Dablam%2C_Nepal.jpg",
                "categories": "Ama Dablam|Malanphulan|Photos by Vyacheslav Argenberg|Images with annotations|Self-published work|Featured pictures on Wikipedia, English|Featured pictures of Nepal|Featured pictures on Wikipedia, Spanish|Photographs taken on 2009-10-18|Mountains with clouds|October 2009 Nepal photographs|Clouds and blue sky in Nepal|Mountains with snow in Nepal|Snow in Nepal in October|Featured pictures of the Himalayas|Photos by Vyacheslav Argenberg in Nepal|Photos by Vyacheslav Argenberg in 2009",
                "size_bytes": 7665281,
                "license_url": "https://creativecommons.org/licenses/by/4.0",
                "thumbnail_url": "https://upload.wikimedia.org/wikipedia/commons/thumb/2/29/Himalayas%2C_Ama_Dablam%2C_Nepal.jpg/330px-Hi
…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — Source & notes

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/commons-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "note": "Search and look up freely-licensed (Creative Commons / public-domain) images and media from Wikimedia Commons. /v1/search?q= returns matching files with direct image URLs, thumbnails, dimensions, license and author; /v1/image?title= returns one file's full details. Always check the per-file license before reuse.",
        "source": "Wikimedia Commons (commons.wikimedia.org)",
        "endpoints": [
            "/v1/search",
            "/v1/image",
            "/v1/meta"
        ]
    },
    "meta": {
        "timestamp": "2026-05-31T11:06:35.901Z",
        "request_id": "71a5a6ca-eee7-4609-8a5e-d97a5bcd4548"
    },
    "status": "ok",
    "message": "Meta retrieved",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/commons-api
OpenAPI spec: https://www.oanor.com/api/commons-api/openapi.json
