# Usuarium public API: a guide for AI assistants

Usuarium (https://usuarium.elte.hu) is a scholarly database of medieval and early modern
liturgical books (manuscripts and printed books), run at Eötvös Loránd University, Budapest.
Its public API is read-only JSON, free, and needs no key.

Base URL: https://usuarium.elte.hu/api/v1
Machine-readable description (OpenAPI 3.1): https://usuarium.elte.hu/api/v1/openapi.json
Human documentation: https://usuarium.elte.hu/api-doc

## Resources (GET only)
- /sources, /sources/{id}: the sources (books). Main fields: id, short_title, original_title,
  age (date as written), age_order (sortable year), manuscript, library {id, name, city, country},
  origin {id, name, country_code}, genres, printers, catalogues, has_conspectus, url.
- /sources/{id}/conspectus: the conspectus items of one source.
- /conspectus, /conspectus/{id}: the conspectus items (the contents of the books). Main fields:
  id, source {id, short_title}, item (incipit as written), standard_item, rubrics, ceremony,
  page {id, label}, sequence, and coded fields as {code, label}: layer, rite, type, part,
  season, week, day, mass_hour, genre, series.
- A list answers {"data": [...], "page": {"limit", "next_cursor", "next"}}; one record
  answers {"data": {...}}. Every record has "url" (its Usuarium page): keep it when citing.

## Downloading
GET a list with limit=500, then follow page.next until it is null. page.next keeps your
filters. Lists are ordered by id; there is no total count.

## Rate limit
Per IP: bursts of 20, then 1 request every 5 seconds. Every request costs a token, errors
included. On HTTP 429, wait Retry-After seconds, then go on. Stay at about one request
every 5 seconds and never send requests in parallel. A full conspectus download takes
about 4 hours.

## Filtering
filter[field]=value means equality; filter[field][op]=value takes an operator:
eq, ne, in, lt, lte, gt, gte, contains, null. Several filters are ANDed.
Relations filter by id, coded fields by their integer code. Examples:
- https://usuarium.elte.hu/api/v1/sources/837/conspectus?limit=500
- https://usuarium.elte.hu/api/v1/sources?filter[library]=140
- https://usuarium.elte.hu/api/v1/conspectus?filter[item][contains]=Asperges
- https://usuarium.elte.hu/api/v1/sources?filter[manuscript]=false&filter[age_order][lt]=1501
ne excludes rows where the field is empty; in takes up to 100 comma-separated values
(no spaces); a bare YYYY-MM-DD date matches the whole day.

## Errors
{"error": {"status", "code", "message"}}. Codes:
invalid_filter, invalid_cursor, bad_request, not_found, method_not_allowed, rate_limited, server_error, query_timeout.

## Terms
Licence: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/);
research use.
Technical problems: gkaroly@gmail.com.
Questions about the data: foldvary.miklos@btk.elte.hu.

## Attribution
Wherever the data are used, credit Usuarium:

Anyone using the USUARIUM datasets in any way and for any purpose is hereby asked to acknowledge the copyright and the source of the data by including the following attribution statement:

> Data retrieved from USUARIUM: A Digital Library and Database for the Study of Latin Liturgical History in the Middle Ages and Early Modern Period (http://usuarium.elte.hu) built by Miklós István Földváry et al. at Eötvös Loránd University (Budapest, Hungary), Research Group of Liturgical History—from 2015 onwards.
