Crossref quirks
Behavior of the live API that shapes how the client works.
Filters
filter=doi:a|breturns zero results. The supported OR form is repeated keys:filter=doi:a,doi:b. Batch lookups use that form.- Crossref has no publisher filter. Scope by
prefix,member, orror-idinstead. - The
locationfilter on/fundersreturns zero results for every value, includingNetherlands, while plain queries match. Funder search with a query works. - The
/licensesroute ignoresqueryand reports a total of 0 for every query; the plain list serves about 30,000 entries. - Unknown query parameters are rejected with 400, not ignored. The client sends only
rows,offset,query,filter,sort,order,select,cursor, andmailto, and rejects per-route unsupported ones client-side.
Paging
- There is no
pageparameter. Paging isoffsetplusrows, withoffset + rows <= 10000androws <= 1000.search()raisesConfigurationErrorbefore sending a request past the cap. - Deep paging uses
cursoron/worksand scoped*/worksroutes; non-works list routes (/journals,/funders,/members,/licenses) rejectcursorwith 400 and use offset paging instead. Cursor exhaustion is implicit: the last non-empty page still returns anext-cursor; only the following request returns emptyitems. - Cursor requests reject the
issuedandpublished*sorts with asort-criteria-incompatible-with-cursor400 (since 2026-08-24). Cursor result sets are no longer stable under index-date windows, so incremental sync should preferfrom-created-date/until-created-datewindows overfrom-index-date. samplecaps at 100 and cannot combine withrowsoroffset;sample()handles both.- The API serves both
https://api.crossref.organdhttps://api.crossref.org/v1with identical payloads; bibliofabric.crossref pins/v1.
Routes
/prefixeshas no list route (404); only/prefixes/{prefix}and/prefixes/{prefix}/worksexist./licenseshas no single-item route (404); only the list exists.- The generic
batch_getsends afilter=request. It works on/worksand on the scoped works routes; on/journals,/funders,/members,/types, and/licensesCrossref answers 400, and on/prefixes404, because those routes reject filters or have no list route. The client therefore disablesbatch_geton those six resources withbatch_size = 0, and the call raisesConfigurationErrorbefore any request. /typesignoresrowsandoffsetand always returns the complete list (about 30 types)./journals/{issn}returnstitleas a bare string while/journalsreturns a list; theJournalmodel accepts both./prefixes/{prefix}returnsmemberandprefixas fullhttps://id.crossref.org/member/297-style URIs; thePrefixmodel normalizes them to bare values.
Response shapes
- Every response wraps in one
messagelevel: single items live inmessage, lists inmessage.itemswith totals inmessage.total-results.Page.metacarries the envelope minus the results, so facets and totals stay reachable. - The published spec is incomplete: several returned fields are absent from it. All models use
extra="allow", so unknown fields survive parsing. - Reference entries, license entries, and funder entries vary in shape between publishers; every field is optional and tolerant types (
SafeList,SafeStr,SafeInt) absorb nulls and scalar-vs-list differences. event.sponsoris a string for one sponsor and a list for several (ACM GECCO proceedings print two sponsors). TheEventmodel accepts both and always yields a list.
Exceptions
All errors subclass bibliofabric.BibliofabricError; import them from bibliofabric.exceptions:
| Exception | When |
|---|---|
NotFoundError |
404 response |
RateLimitError |
429 response after retries |
AuthError |
401 or 403 response |
APIError |
any other error status; .body holds the parsed error payload |
NetworkError |
connection failed |
TimeoutError |
request exceeded timeout |
ValidationError |
a response record failed model validation; .raw holds the payload |
ConfigurationError |
a request the API would reject with 400, raised before sending |
Records that fail validation raise ValidationError during iterate(). Pass on_error="skip" with a failures list to drop them instead:
import asyncio
from bibliofabric.crossref import CrossrefClient, WorksFilters
client = CrossrefClient()
async def main() -> None:
async with client:
failures = []
async for work in client.works.iterate(
WorksFilters(prefix="10.5194"), on_error="skip", failures=failures, limit=50
):
print(work.doi)
print("failures:", len(failures))
asyncio.run(main())
10.1007/s005850050006
10.1007/s005850050009
10.1007/s005850050011
... 47 more DOIs ...
failures: 0
For the full exception list, retry rules, and the Retry-After handling shared by every client, see Error handling.
Retries
The client retries 429, 500, 502, 503, and 504 responses, plus network failures and timeouts. A Retry-After header is honored; other failures back off with jittered exponential waits capped at max_retry_wait (60 seconds by default). 403 and 404 are never retried. max_retries defaults to 3 and is configurable through CROSSREF_MAX_RETRIES.
A 403 from Crossref means that the account was blocked, not throttled; stop and inspect the request rather than retrying.
Rate limits
When rate_limits, max_concurrency, and max_requests_per_second are not explicitly set on CrossrefSettings, CrossrefClient picks pool-aware defaults based on your credentials:
| Pool | Credentials | rate_limits (req/s) |
max_concurrency |
|---|---|---|---|
| Public | neither mailto nor plus_token |
{"single": 5.0, "list": 1.0, "datacitations": 3.0} |
1 |
| Polite | mailto set (no plus_token) |
{"single": 10.0, "list": 3.0, "datacitations": 3.0} |
3 |
| Metadata Plus | plus_token set |
{"single": 50.0, "list": 50.0, "datacitations": 3.0} |
10 |
Pacing follows the 2026-07 Crossref split per request class: top-level /works searches run in the list class, the beta data citations route runs in the datacitations class, and single records, scoped /.../works routes, and all other routes run in the single class. The concurrency bound is shared across classes. Override each class through CROSSREF_RATE_LIMITS (a JSON object such as {"single": 10.0, "list": 3.0, "datacitations": 3.0}) and the shared bound through CROSSREF_MAX_CONCURRENCY.
Every response updates the read-only client.last_rate_limit_headers property, which holds Crossref's x-api-pool, x-rate-limit-limit, x-rate-limit-interval, and x-concurrency-limit headers.
On 429 the client backs off and retries automatically.