Pricing update: Free users

International Image Interoperability Framework (IIIF) API reference

The International Image Interoperability Framework (IIIF) provides a standardized way of delivering and describing images shared on the web. This is the reference documentation for how you can interact with the asset pipeline using IIIF.

The Sanity asset pipeline supports the International Image Interoperability Framework API (IIIF). The URL schema for IIIF supported APIs looks like this: {scheme}://{server}{/prefix}/{identifier}

For the Sanity asset pipeline, that translates to:

https://cdn.sanity.io/image/{projectId}/{dataset}/iiif/{identifier}

You can go to the official IIIF API reference to find all the identifiers and different ways of querying images in your dataset.

Examples

General image info

If you go to https://cdn.sanity.io/images/zp7mbokg/production/iiif/G3i4emG6B8JnTmGoN0UjgAp8-300x450.jpg/info.json it will return this JSON structure:

{
    "@context": "http://iiif.io/api/image/2/context.json",
    "@id": "https://cdn.sanity.io/images/zp7mbokg/production/iiif/G3i4emG6B8JnTmGoN0UjgAp8-300x450.jpg",
    "protocol": "http://iiif.io/api/image",
    "profile": [
        "http://iiif.io/api/image/2/level2.json"
    ],
    "width": 300,
    "height": 450,
    "sizes": [
        {
            "width": 50,
            "height": 75
        },
        {
            "width": 200,
            "height": 300
        },
        {
            "width": 600,
            "height": 900
        },
        {
            "width": 1200,
            "height": 1800
        },
        {
            "width": 2000,
            "height": 3000
        }
    ],
    "tiles": [
        {
            "width": 512,
            "scaleFactors": [
                1,
                2,
                4,
                8,
                16
            ]
        }
    ]
}

Default, full-size

Identifier: /full/full/0/default.jpg

https://cdn.sanity.io/images/zp7mbokg/production/iiif/G3i4emG6B8JnTmGoN0UjgAp8-300x450.jpg/full/full/0/default.jpg

Sean Gunn in full proportions

Square crop, 75% size, gray color, png format

Identifier: square/pct:25/0/gray.png

https://cdn.sanity.io/images/zp7mbokg/production/iiif/G3i4emG6B8JnTmGoN0UjgAp8-300x450.jpg/square/pct:75/0/gray.png

Sean Gunn in a square crop and grey color

Was this article helpful?