Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
iiisight 0.4
iiisight 0.4

Getting started

  • Installation
  • Quickstart

Guide

  • Fetching & clients
  • The normalized model
  • Tolerance & diagnostics
  • Images & tiles
  • Content Search
  • Content State
  • Authorization Flow 2.0
  • Image API conformance
  • Change Discovery
  • Command-line interface

Reference

  • API reference
  • Contributing to iiisight
  • Changelog
Back to top
View this page

Content Search¶

iiisight can discover a resource’s Content Search service, run a query, and return the hits as annotations in the normalized model. It handles both Content Search 2.0 (AnnotationPage responses) and the older 1.0 (sc:AnnotationList, upgraded automatically).

Searching¶

Pass a manifest (its search service is discovered), a Service, or a search base URL:

async with iiisight.AsyncClient() as client:
    manifest = await client.fetch_manifest(url)
    page = await client.search(manifest, "cathedral")
    for hit in page.items:
        print(hit.target, hit.body)
with iiisight.Client() as client:
    manifest = client.fetch_manifest(url)
    page = client.search(manifest, "cathedral")
    for hit in page.items:
        print(hit.target, hit.body)

The result is an AnnotationPage; each hit is an Annotation whose target points into the object (often with an xywh fragment) and whose body carries the matched text.

Extra parameters¶

Content Search supports parameters like motivation, date, and user:

page = await client.search(manifest, "cathedral", params={"motivation": "painting"})

Discovering the service yourself¶

service = iiisight.find_search_service(manifest)   # -> Service | None
if service:
    url = iiisight.search_url(service, "cathedral")
    # ... fetch `url` however you like, then:
    # page = iiisight.parse_search_response(response_json)
Next
Content State
Previous
Images & tiles
Copyright © 2026, Roger Howard
Made with Sphinx and @pradyunsg's Furo
On this page
  • Content Search
    • Searching
    • Extra parameters
    • Discovering the service yourself