Upstream quirks
The VIAF API spec at
https://developer.api.oclc.org/docs/viaf/openapi-external-prod.yaml
describes an idealized service; the live routes behave differently in ways
the client accounts for. All findings were verified live in November 2026.
Content negotiation
- The old
GET /viaf/{id}/viaf.jsonroute answers 404. Every route answers byAcceptheader:application/xmlreturns XML,application/jsonreturns JSON. Without anAcceptheader the routes answer 307 to the HTML site under/en/viaf/. The client therefore sendsAccept: application/xmlon every request and switches toapplication/jsononly for AutoSuggest. - A padded id (
00000000000102333412) resolves like the bare number.
SRU search
- The
explainanswer advertisesmaximumRecordsdefault 250, but the server clampsmaximumRecordsto 10 for the full cluster schema and to 250 for BriefVIAF. The client rejects apage_sizeabove the schema's cap before sending. - An empty
queryparameter (for examplequery=) does not answer zero records: the route returns HTTP 200 with the SRUexplainResponseinstead of a search answer. The client rejects an empty query withConfigurationErrorbefore sending. sortKeyaccepts onlyholdingscount. Any other value either errors or falls back silently, so the client rejects unknown sort keys before sending.- An empty result or an unknown index answers HTTP 200 with
numberOfRecords0, not an error. Malformed CQL falls back toserverChoicesilently; no SRU diagnostics element ever appears. - A quoted CQL phrase fails differently from a bare term: the search index
matches
"tolkien"as expected, but the client lets you send whatever CQL you build.
AutoSuggest
- AutoSuggest returns JSON only with
Accept: application/json; otherwise it answers the HTML site. - When no hit matches, the JSON
resultfield isnullrather than an empty array; the client maps that to an empty list. - The matching is a prefix match on the leading words of a display form:
austenmatchesAusten, Jane, 1775-1817, whileAusten, Janeand"Austen Jane"answer zero hits. The client sends the query unchanged and does not quote it. - The answer carries no total and no paging; the list holds at most 10 hits.
Every unknown key in a hit is an authority-source id
(
lc,dnb,bnf, ...), which the model collects intosource_ids.
Cluster documents
- A full cluster document embeds
linkselements with crosswalk triples; a popular cluster carries thousands of them plusDocumentmetadata. The parser drops both; models carry the substantive fields only. - Source ids repeat per linked source record with
nsidvariants such asLC|n 79032879(with embedded double spaces). Models keep the raw text plus the split code and id. - Dates arrive as separate
birthDateanddeathDatestrings, not ranges.
Dump access
VIAF publishes full-corpus dumps, but only behind a gated OCLC download agreement; there is no open bulk endpoint. Nothing in this client reads dumps.