# IIIF Presentation Harvester (`datamule/iiif-presentation-harvester`) Actor

Point at ANY IIIF manifest or collection (Wellcome, Bodleian, Harvard, Library of Congress and thousands more) and get flat metadata rows: label, description, metadata pairs, rights, thumbnail, canvas count, plus per-canvas image info. Handles IIIF Presentation API 2.x and 3.x. Pay per manifest.

- **URL**: https://apify.com/datamule/iiif-presentation-harvester.md
- **Developed by:** [Datamule](https://apify.com/datamule) (community)
- **Categories:** Developer tools, E-commerce
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.35 / 1,000 records

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## IIIF Presentation Harvester

**Point at ANY IIIF manifest or collection URL and get flat, structured metadata rows — one actor for the whole GLAM world.**

**IIIF** (*International Image Interoperability Framework*) Presentation API is the metadata backbone of galleries, libraries, archives and museums. **Wellcome Collection, the Bodleian, Harvard, Yale, the Library of Congress, the Bibliothèque nationale de France, the Getty** and thousands more expose IIIF manifests describing digitised books, manuscripts, photographs, maps and artworks. Every one of them serves the same `Manifest` / `Collection` JSON document shape.

Every other "museum" or "digital collection" scraper wraps **one** institution. This actor is the **generic runner**: give it any IIIF manifest or collection URL and it turns the metadata into dataset rows — cleanly flattened columns plus a lossless copy of each original manifest.

### What it does

- **Manifest** → one flat row: id, label, description/summary, the `metadata` label/value pairs, canvas (page/image) count, thumbnail, rights/license, attribution, provider, homepage, navDate, plus a lossless `raw` copy of the whole manifest.
- **Collection** → walked breadth-first over its manifest references (and nested sub-collections), harvesting each manifest up to your `maxRecords` cap.
- **Per-canvas image info** (optional) → with `includeImageInfo` on, one extra row per canvas: canvas id, label, width, height, the **IIIF Image API service base** (used to build tile / region / full-size image URLs like `{service}/full/max/0/default.jpg`), the direct image URL, and format.

Handles **both** major versions of the Presentation API transparently:

- **IIIF Presentation API 2.x** — `@id` / `@type: sc:Manifest`, `label` as a plain string, canvases under `sequences[].canvases[]`, images under `images[].resource`, `license` + `attribution`.
- **IIIF Presentation API 3.x** — `id` / `type: Manifest`, every human string as a **language map** (`{"en": ["…"]}`), canvases under `items[]`, images under `items[].items[].body`, `rights` + `requiredStatement`.

The version is detected from `@context` and every language map is collapsed to a plain string (preferring English), so the output columns are identical regardless of source version.

### Input

| Field | Type | Description |
|-------|------|-------------|
| `manifestUrl` | string | The IIIF manifest **or** collection URL, e.g. `https://iiif.wellcomecollection.org/presentation/v2/b18035723`. |
| `collectionUrl` | string | Optional alias when pointing at a collection. `manifestUrl` wins if both are set. |
| `includeImageInfo` | boolean | Also emit one row per canvas (image/page) with dimensions and the IIIF Image service base. Default off. |
| `maxRecords` | integer | **Global** cap on the number of manifests harvested from a collection. Default 100. |
| `bearer` | string (secret) | Optional bearer token for gated deployments. Never logged. |
| `extraHeaders` | object | Optional extra HTTP headers, e.g. `{"x-api-key": "…"}`. Never logged. |

### Output

One dataset item per manifest (and, with `includeImageInfo`, per canvas). A manifest row from the Wellcome Collection, for example:

```json
{
  "_type": "manifest",
  "iiifVersion": 2,
  "_sourceUrl": "https://iiif.wellcomecollection.org/presentation/v2/b18035723",
  "manifestId": "https://iiif.wellcomecollection.org/presentation/v2/b18035723",
  "label": "Wunder der Vererbung / von Fritz Bolle.",
  "metadata": [
    {"label": "Publication/creation", "value": "Murnau ; München : Sebastian Lux, [1951]"},
    {"label": "Physical description", "value": "31 pages : illustrations ; 15 cm."}
  ],
  "canvasCount": 36,
  "thumbnail": "https://iiif.wellcomecollection.org/thumbs/b18035723_0004.JP2/full/72,100/0/default.jpg",
  "rights": "http://creativecommons.org/licenses/by-nc/4.0/",
  "raw": { "…": "the complete manifest" }
}
````

Missing fields are `null`; `raw` always preserves the complete original manifest so nothing is lost.

### Finding manifests

Any IIIF-compliant institution exposes manifest URLs on its object/viewer pages (look for a IIIF logo or a "IIIF manifest" link). The [IIIF community](https://iiif.io/community/) maintains lists of adopters, and most GLAM APIs document their manifest URL pattern.

### Pricing

Pay-per-event: **$0.0005 per manifest** (one harvested manifest row). Per-canvas image rows, when enabled, are bundled with their manifest at no extra charge. For a collection, leave `maxRecords` at the default 100 or raise it to harvest a larger set.

### Notes & limits

- Scope is the IIIF **Presentation API** (manifests and collections). The IIIF **Image API** is not fetched — but each canvas's Image service base is emitted so you can build image URLs yourself.
- A malformed URL, a non-JSON response, or an HTTP 4xx returns a clear error; an empty collection simply yields 0 records.
- Binary image tiles are never downloaded — this actor harvests **metadata**, keeping runs fast and cheap.

# Actor input Schema

## `manifestUrl` (type: `string`):

The URL of any IIIF Presentation API manifest OR collection — the metadata standard served by galleries, libraries, archives and museums worldwide. Manifest examples: https://iiif.wellcomecollection.org/presentation/v2/b18035723 (Wellcome), https://iiif.bodleian.ox.ac.uk/iiif/manifest/e32a277e-91e2-4a6d-8ba6-cc4bad230410.json (Bodleian). A collection URL is walked to harvest every manifest it lists. Both IIIF Presentation API 2.x and 3.x are handled automatically. One actor works against thousands of institutions.

## `collectionUrl` (type: `string`):

Optional alias for the URL field when pointing at a IIIF collection (a document that lists manifests and/or sub-collections). If both are set, manifestUrl takes precedence. A collection is walked breadth-first over its sub-collections, harvesting each manifest up to the Max records cap.

## `includeImageInfo` (type: `boolean`):

When enabled, emit one extra row per canvas (page/image) in each manifest — canvas id, label, width, height, the IIIF Image API service base (used to build tile/region/full-size image URLs) and the direct image URL and format. Canvas rows are bundled with their manifest at no extra charge. Leave off for one metadata row per manifest.

## `maxRecords` (type: `integer`):

A GLOBAL cap on the number of manifests to harvest when a collection URL is given (each harvested manifest is one billable event). Default 100. Ignored for a single manifest (which is always one manifest). Per-canvas rows do not count against this cap.

## `bearer` (type: `string`):

Optional bearer token for gated IIIF deployments (sent as Authorization: Bearer \*\*\*). Not required for public GLAM manifests. Never logged.

## `extraHeaders` (type: `object`):

Optional extra HTTP headers as a JSON object, e.g. {"x-api-key": "..."} for gated servers. Not required for public servers. Header values are never logged.

## Actor input object example

```json
{
  "manifestUrl": "https://iiif.wellcomecollection.org/presentation/v2/b18035723",
  "includeImageInfo": false,
  "maxRecords": 100
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# 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 = {
    "manifestUrl": "https://iiif.wellcomecollection.org/presentation/v2/b18035723"
};

// Run the Actor and wait for it to finish
const run = await client.actor("datamule/iiif-presentation-harvester").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 = { "manifestUrl": "https://iiif.wellcomecollection.org/presentation/v2/b18035723" }

# Run the Actor and wait for it to finish
run = client.actor("datamule/iiif-presentation-harvester").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "manifestUrl": "https://iiif.wellcomecollection.org/presentation/v2/b18035723"
}' |
apify call datamule/iiif-presentation-harvester --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=datamule/iiif-presentation-harvester",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "IIIF Presentation Harvester",
        "description": "Point at ANY IIIF manifest or collection (Wellcome, Bodleian, Harvard, Library of Congress and thousands more) and get flat metadata rows: label, description, metadata pairs, rights, thumbnail, canvas count, plus per-canvas image info. Handles IIIF Presentation API 2.x and 3.x. Pay per manifest.",
        "version": "0.1",
        "x-build-id": "1cpXYPdYL3lHNPgV6"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/datamule~iiif-presentation-harvester/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-datamule-iiif-presentation-harvester",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/datamule~iiif-presentation-harvester/runs": {
            "post": {
                "operationId": "runs-sync-datamule-iiif-presentation-harvester",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/datamule~iiif-presentation-harvester/run-sync": {
            "post": {
                "operationId": "run-sync-datamule-iiif-presentation-harvester",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "manifestUrl": {
                        "title": "IIIF manifest or collection URL",
                        "type": "string",
                        "description": "The URL of any IIIF Presentation API manifest OR collection — the metadata standard served by galleries, libraries, archives and museums worldwide. Manifest examples: https://iiif.wellcomecollection.org/presentation/v2/b18035723 (Wellcome), https://iiif.bodleian.ox.ac.uk/iiif/manifest/e32a277e-91e2-4a6d-8ba6-cc4bad230410.json (Bodleian). A collection URL is walked to harvest every manifest it lists. Both IIIF Presentation API 2.x and 3.x are handled automatically. One actor works against thousands of institutions."
                    },
                    "collectionUrl": {
                        "title": "IIIF collection URL (alias)",
                        "type": "string",
                        "description": "Optional alias for the URL field when pointing at a IIIF collection (a document that lists manifests and/or sub-collections). If both are set, manifestUrl takes precedence. A collection is walked breadth-first over its sub-collections, harvesting each manifest up to the Max records cap."
                    },
                    "includeImageInfo": {
                        "title": "Include per-canvas image info",
                        "type": "boolean",
                        "description": "When enabled, emit one extra row per canvas (page/image) in each manifest — canvas id, label, width, height, the IIIF Image API service base (used to build tile/region/full-size image URLs) and the direct image URL and format. Canvas rows are bundled with their manifest at no extra charge. Leave off for one metadata row per manifest.",
                        "default": false
                    },
                    "maxRecords": {
                        "title": "Max records (manifests)",
                        "minimum": 1,
                        "type": "integer",
                        "description": "A GLOBAL cap on the number of manifests to harvest when a collection URL is given (each harvested manifest is one billable event). Default 100. Ignored for a single manifest (which is always one manifest). Per-canvas rows do not count against this cap.",
                        "default": 100
                    },
                    "bearer": {
                        "title": "Bearer token",
                        "type": "string",
                        "description": "Optional bearer token for gated IIIF deployments (sent as Authorization: Bearer ***). Not required for public GLAM manifests. Never logged."
                    },
                    "extraHeaders": {
                        "title": "Extra request headers",
                        "type": "object",
                        "description": "Optional extra HTTP headers as a JSON object, e.g. {\"x-api-key\": \"...\"} for gated servers. Not required for public servers. Header values are never logged."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
