Wave 1 Client Specs & Core Enablers
This guide provides the starter specifications that the 11 Wave 1 client
libraries were built from, the 6 targeted bibliofabric core additions,
and the 2 extensions to existing clients that were planned with them.
For the step-by-step recipe to scaffold, type-check, generate sync twins, and
test any client package in this workspace, see
Building a client on bibliofabric.
Status on 2026-11-28: all eleven libraries are built under their final names (see Wave 1 libraries). These specs were the starting point. Where the live API differs from a spec, the client follows the live API, and the upstream-quirks page of the package records the difference. Corrections carry the date on which they were verified.
bibliofabric Core Enablers
bibliofabric 0.8 already provides retry=bool, _fetch_batch_chunk(),
page_size_param: str | None, max_offset, per-instance dialect=,
BasicAuth, ClientCredentialsAuth(token_auth_method="post"),
RefreshTokenAuth, automatic 401 token refresh, on_response(), stream(),
follow_redirects, connect_timeout, and cached TypeAdapter(list[E])
validation.
Six lightweight, backwards-compatible core additions unlock Wave 2 without
per-client workarounds. Two of them are in bibliofabric 0.8: the
default_headers property of BaseApiClient (addition 1) and
JsonApiUnwrapper (the JSON:API part of addition 2), together with five of
the identifier normalizers (ISBN, ISNI, Wikidata, GND, and VIAF from
addition 6). The deferred list has the rest with
the reason for each:
- Default per-client
Accept/ static headers: Add an optionaldefault_headers: Mapping[str, str] | Noneparameter (orAcceptdefault onBaseApiSettings/BaseApiClient) merged into owned and caller-supplied requests unless overridden per call. - Unlocks: ORCID (
Accept: application/vnd.orcid+json), UKRI GtR (Accept: application/vnd.rcuk.gtr.json-v7), GLEIF (Accept: application/vnd.api+json), DOI Content Negotiation (Accept: application/vnd.citationstyles.csl+json). - Header-aware
ResponseUnwrapper& RFC 5988Linkparser: AllowResponseUnwrapper.next_cursor()(or an optional companion method) to readhttpx.Headers, and ship a smallparse_link_header()helper plus a reusable JSON:API unwrapper mixin (data[].attributes+links.next). - Unlocks: Software Heritage (
Link: <...>; rel="next"), DataCite REST, OSF v2, Zenodolinks.next, GLEIF LEI, and ARC NCGP. - POST-body search & pagination dialect: Allow
ResourceClientsubclasses to declaresearch_method = "POST"with abuild_search_body()hook that places filters, page size, and offset/cursor in the JSON request body instead of query parameters (withretry=Truefor read-only search POSTs). - Unlocks: NIH RePORTER v2, Figshare
/articles/search, ETER v4, CORE v3 POST search, Lens.org, and SPARQL endpoints. - Fixed / sliding-window rate limiter & daily quota hooks: Extend
Limiteralongsidereq/sspacing to enforce explicit(max_requests, window_seconds)caps and optional daily budget/quota callbacks. - Unlocks: LoC (
20 req/minto prevent 1h–72h IP bans), GLEIF (60 req/min), ROR (2,000 / 5 min), DataCite (500–3,000 / 5 min), ORCID (25k–100k / day), NASA ADS (5,000 / day). - Pluggable non-JSON decoder hook: Generalize
BaseApiClient.parse_json()with a pluggable decoder hook (parse_response(response)defaulting to JSON) for XML, Atom 1.0, OAI-PMH, SRU, ANVL, and BibTeX/plain text. - Unlocks: arXiv Atom XML, PubMed
efetch, re3data, VIAF/LoC SRU, DOI BibTeX ConNeg, ARK/N2T, and generic OAI-PMH harvesting. - Expanded
bibliofabric.idsnormalizers: Add canonical normalizers and check-digit validators alongside existingnormalize_doi,normalize_orcid,normalize_ror, andnormalize_issn: normalize_isbn(ISBN-10 ↔ ISBN-13 + check digits)normalize_isni,normalize_lei,normalize_wikidata_qidnormalize_gnd,normalize_viaf,normalize_arknormalize_raid,normalize_swhid,normalize_spdx
Immediate Extensions to Existing Clients
Before starting new packages, two high-value additions belong in existing packages:
stavrophora(Crossref):- Add a resource client for the Crossref Data Citation API
(
/beta/datacitations/→ GA late 2026), replacing the sunset Event Data API. - Add typed helpers for Retraction Watch records embedded in Crossref
/works(updated-by/update-type:retractionwithsource: retraction-watch). aletheca(OpenAlex):- Document and optionally surface OpenAlex credit/budget headers
(
X-RateLimit-Credits-Used,cost_usd) viaBaseApiClient.on_response()alongside existingdaily_budget429 retry vetoing.
Status on 2026-11-28: all three are done. The Data Citation API is still
beta upstream (/beta/datacitations, its own pool at 3 requests per
second), so stavrophora labels client.data_citations as beta.
Wave 1 Candidate Client Starter Specs
1. ROR v2 (Organizations & Funders)
- Base URL:
https://api.ror.org/v2(primary path:organizations) - Auth:
NoAuth()by default; optionalHeaderAuth("Client-Id", ...)for the registered 2,000 req / 5 min tier. QueryDialect:page_param="page",page_start=1,page_size_param=None(fixed 20/page),max_page_size=20,default_page_size=20,max_offset=9980,query_param="query",sort_param=None,select_param=None.ResponseUnwrapper:results -> body["items"],total -> body["number_of_results"],item -> body,next_cursor -> None,meta -> body["meta"].- Batching & Rate Limits: No native multi-ID batch endpoint; use bounded
concurrent
get()or the Zenodo dump. Verified 2026-11-27: ROR publishes no limit for anonymous callers and has paused registration, so the client sends no client identification. - License: CC0 1.0 (API and Zenodo data dumps).
- Upstream Quirks:
- API/schema v1 was sunset in late 2025; target v2.1 fields (
names,locations,domains,external_idsincl.fundref). - Expose a dedicated
match_affiliation(affiliation: str)method using?affiliation=...(mid-2026 defaultsingle_search), trusting entries withchosen: true. - Provide an optional Zenodo JSON dump loader (~115k records) for offline
<1 mslookups and legacy Crossref Funder ID (10.13039/...) → ROR crosswalks. - Verified 2026-11-27: the dump holds about 152,000 records. A rejected
request (unknown filter key, page above 500, malformed
query.advanced) answers HTTP 200 with anerrorsbody.queryandquery.advancedcannot be combined. The keyword search does not find an ISNI, so the external-id lookup goes throughexternal_ids.allinquery.advanced.
2. ORCID API v3.0 (Researchers)
- Base URL:
https://pub.orcid.org/v3.0(Public) orhttps://api.orcid.org/v3.0(Member) - Auth:
NoAuth()for anonymous public reads, orClientCredentialsAuth(client_id, client_secret, "https://orcid.org/oauth/token", scope="/read-public", token_auth_method="post")for Public/Member clients. QueryDialect: Search (/expanded-searchor/search):offset_param="start",page_size_param="rows",max_page_size=200,default_page_size=25,max_offset=10_000,query_param="q",page_param=None,sort_param=None.ResponseUnwrapper: Search returnsbody["expanded-result"](orbody["result"]) andtotal -> body["num-found"]; single profile sub-routes (/{orcid}/record,/works,/employments,/educations,/external-identifiers) returnitem -> body.- Batching & Rate Limits: No multi-ID batch GET. 12 req/s public
(24 req/s member), burst 40/s returns
503; daily caps 25k/day anon, 100k/day Public Client, unlimited Member. - License: ORCID Public API Terms (non-commercial restriction on Public API); annual public data file is CC0. Tag accordingly in fusion policies.
- Upstream Quirks:
- Requires
Accept: application/vnd.orcid+json(default is XML; relies on core Enabler #1 or explicit per-request headers until landed). - JSON preserves XML-derived
{"value": "..."}wrapper dicts throughout; normalize cleanly inside Pydantic field validators. - Normalize IDs with
bibliofabric.ids.normalize_orcid. - Verified 2026-11-27:
Accept: application/jsonandapplication/vnd.orcid+jsonboth answer JSON, andapplication/ld+jsonanswers 406. The client sendsapplication/jsonon every request. - Verified 2026-11-27:
/expanded-search/answers{"expanded-result": [...], "num-found": N}and/search/answers{"result": [...], "num-found": N}.rows=1000answers HTTP 500, as does an unknown field name inq, so the client capsrowsat 100. - Verified 2026-11-27:
/{orcid}/biographyand/{orcid}/emailsanswer 404 with error code 9041 when the record has none, and an unused activities section answered 404 in one run and 200 with an empty group in another. Every section reader maps 404 toNone. - Verified 2026-11-27: the member API token on hand was rejected with 403 on
api.orcid.org, so the client is not built for the member API and does not mint tokens. It sends an optionalORCHIS_ACCESS_TOKENas a bearer header. The member read routes have the same paths as the public ones.
3. DataCite REST API (Datasets, Software, Preprints & PID Graph)
- Base URL:
https://api.datacite.org(paths:dois,clients,providers,prefixes,events; optional GraphQL at/graphql) - Auth:
NoAuth()for public read (send descriptiveUser-Agent/mailtofor identified tier);BasicAuth(repository_id, password)for Member writes/drafts. QueryDialect:page_size_param="page[size]",max_page_size=1000,default_page_size=25,page_param="page[number]",max_offset=10_000,cursor_param="page[cursor]",cursor_start="1",query_param="query",sort_param="sort",select_param=None.ResponseUnwrapper: JSON:API envelope:results -> body["data"],item -> body["data"],total -> body["meta"]["total"],next_cursor ->extractpage[cursor]query param frombody.get("links", {}).get("next"),meta -> body.get("meta", {}).- Batching & Rate Limits: Verified 2026-11-27: filters take one parameter per criterion, and a comma list inside one filter means OR. Rate: 500 unid / 1,000 identified / 3,000 member per 5 min per IP; the API sends no rate-limit headers. The client defaults to 1.5 requests per second.
- License: CC0 1.0.
- Upstream Quirks:
- Deep pagination past 10,000 records requires
page[cursor]=1on the first request (not*) and followinglinks.next. - Normalize DOIs with
normalize_doi; preserverelatedIdentifiersandversionfields for dataset/software lineage. - Verified 2026-11-27:
page[size]accepts 1 to 1000 (1001 is cut to 1000); numbered paging stops at 10,000 records with a 400; a cursor walk always orders bycreatedascending, whateversortsays;sortacceptsrelevance,name,created,updated,published,view-count,download-count,citation-count, andtitle(a-prefix reverses it); date filters take years;fields[dois]silently dropsresourceTypeGeneral./dois/{id}/media,/views,/downloads, and/urlanswer 404 without a login, and/prefixes/totalsanswers 204.
4. Semantic Scholar (Graph, Bulk Search & Batch)
- Base URL:
https://api.semanticscholar.org/graph/v1(plus optional/recommendations/v1,/datasets/v1) - Auth:
HeaderAuth("x-api-key", api_key)strongly recommended (anonymous pool suffers frequent429throttling). QueryDialect:- Standard search (
/paper/search):offset_param="offset",page_size_param="limit",max_page_size=100,default_page_size=25,max_offset=1_000,query_param="query",select_param="fields",page_param=None,sort_param=None. - Bulk search (
/paper/search/bulk, via per-instancedialect=):cursor_param="token",cursor_start=None,page_size_param=None(fixed 1,000/page),query_param="query",select_param="fields",sort_param="sort". ResponseUnwrapper:results -> body["data"],item -> body,total -> body.get("total"),next_cursor -> body.get("token"),meta ->remaining keys.- Batching & Rate Limits: Override
_fetch_batch_chunk()to callPOST /paper/batch(up to 500 IDs per chunk,json={"ids": chunk},params={"fields": ...},retry=True) andPOST /author/batch. Intro API key: 1 req/s (max_requests_per_second=1.0). - License: ODC-By 1.0 (datasets/corpus); AI2 API License (attribution required; SPECTER2 embeddings Apache 2.0).
- Upstream Quirks:
- Accepts prefixed IDs (
DOI:...,ARXIV:...,PMID:...,CorpusId:..., or bare 40-char S2 paper ID); preserve prefix duringnormalize_id()and match back inrecord_keys(). POST /paper/batchreturnsnullentries in the JSON array for missing IDs; filterNoneitems inside_fetch_batch_chunk().- Always specify
select=(fields=) explicitly; default response is minimal (paperId,title). - Verified 2026-11-27: the API key on hand answers HTTP 403, so the client
was built and tested without a key. Without a key,
/paper/search,/paper/search/match,/snippet/search, theURL:andPubMedCentral:id forms, and the patent search routes answered 429 during the whole study. The client wraps them from the published specification, and the docs page lists them as unverified. - Verified 2026-11-27:
POST /paper/batchandPOST /author/batchtake a bare JSON array of ids and answer a bare array withnullin the place of an unknown id.fieldsis a query parameter on both. The client sends at most 500 ids per paper call and 1000 ids per author call. - Verified 2026-11-27:
fields=openAccessDoiandfields=embeddinganswer 400 without a key, and a dataset file listing answers 401 without a key./paper/autocompleteanswers{"matches": [...]}, andGET /dataset/releasesanswers a plain array of release ids. - Verified 2026-11-27: the published limits are 1000 requests per second for the shared anonymous pool and 1 request per second for an introductory key. The pool is contended, so the client defaults to 1 request per second and concurrency 1.
5. DOAJ API v4 (Gold & Diamond OA Journals)
- Base URL:
https://doaj.org/api/v4(paths:search/journals/{query},search/articles/{query},journals/{id},articles/{id}; verified 2026-11-27 thatjournalsandarticleshave no list route) - Auth:
NoAuth()for public read/search. QueryDialect:page_param="page",page_start=1,page_size_param="pageSize",max_page_size=50,default_page_size=10,sort_param="sort",query_param=None(search query is embedded in the path).ResponseUnwrapper:results -> body["results"],item -> body,total -> body.get("total"),next_cursor -> None,meta ->envelope minusresults.- Batching & Rate Limits: Batch ISSN lookups via Lucene
ORquery (issn:1234-5678 OR issn:8765-4321) in/search/journals/{query}. Rate: ~2 req/s (max_requests_per_second=1.5conservative default). Verified 2026-11-27:pageSizeabove 50 is cut to 50 and the default is 10. - License: CC0 1.0.
- Upstream Quirks:
- API v1–v3 are deprecated; always target
/api/v4/. - Search encodes the Lucene query as a URL-encoded path segment
(
/search/journals/{query}); handle via a resource method or path-building override. - Capture
bibjson.apc,bibjson.license,bibjson.preservation,bibjson.editorial.review_process, andbibjson.sealfor canonical Venue records. - Verified 2026-11-27:
/api/search/...and/api/v4/search/...answer the same envelope. The client wraps v4. - Verified 2026-11-27: the API answers 400 beyond the first 1000 records of
a query, because
(page - 1) * pageSize + pageSizemust be at most 1000.page=0is treated as page 1. - Verified 2026-11-27: wildcards answer 400.
AND,OR,ANDNOT, quoted phrases, and ranges work. A license filter needs the stored spelling, such aslicense:"CC BY". - Verified 2026-11-27: an unknown DOI answers 200 with
totalof 0. The client raisesNotFoundErroron an empty envelope. - Verified 2026-11-27: the documentation states a limit of 2 requests per second with bursts of five. The client defaults to 1 request per second.
- Verified 2026-11-27:
GET /api/journals/{id}andGET /api/articles/{id}answer 200 without a key for a DOAJ record id, with more fields than a search result (es_type,last_manual_update, and a fulleradminsection).
6. OpenCitations (Index v2 + Meta v1)
- Base URL:
https://api.opencitations.net/index/v2andhttps://api.opencitations.net/meta/v1 - Auth:
NoAuth(). The optional OpenCitations Access Token is not in the client yet (see the deferred list). QueryDialect: Unpaged dialect:page_size_param=None,page_param=None,offset_param=None,cursor_param=None,sort_param=None,query_param=None,select_param=None.ResponseUnwrapper: Endpoints return a top-level JSONlist[dict]:results -> body,item -> body[0](raisingNotFoundErrorwhen empty),total -> len(body),next_cursor -> None,meta -> {}.- Batching & Rate Limits: Verified 2026-11-27: the Meta API accepts
__-delimited ids (/metadata/doi:a__doi:b, one row per id); the Index API answers[]for a multi-id path, so it takes one id per request. Rate: 180 req/min/IP documented; the client defaults to 3 requests per second. - License: CC0 1.0.
- Upstream Quirks:
- Legacy
COCI,POCI, and/index/v1are deprecated/archived; target only/index/v2and/meta/v1. - Missing IDs return HTTP
200with an empty JSON list[]rather than404; map empty responses cleanly inget()/unwrapper.item(). - Index v2 exposes
oci,citing,cited,creation,timespan,journal_sc, andauthor_sc(self-citation flags). - Verified 2026-11-27: Index v2 has six operations (
/citation/{oci},/citations/{id},/references/{id},/citation-count/{id},/reference-count/{id},/venue-citation-count/{issn}), and Meta v1 has three (/metadata/{ids},/author/{id},/editor/{id}). The rows acceptrequire,filter,sort, andformat=csv(theAcceptheader alone does not switch the format). Counts arrive as strings.
7. Europe PMC (Articles, Preprints, Citations & Annotations)
- Base URL:
https://www.ebi.ac.uk/europepmc/webservices/rest(plushttps://www.ebi.ac.uk/europepmc/annotations_api) - Auth:
NoAuth(). QueryDialect: Search (/search):cursor_param="cursorMark",cursor_start="*",page_size_param="pageSize",max_page_size=1000,default_page_size=25,iterate_page_size=1000,query_param="query",sort_param="sort",page_param=None,select_param=None(useresultType="core"or"lite").ResponseUnwrapper:results -> body["resultList"]["result"],total -> body["hitCount"],next_cursor -> body.get("nextCursorMark"),meta ->request,version.- Batching & Rate Limits: Batch PMIDs/DOIs via Lucene
ORquery (EXT_ID:12345 OR EXT_ID:67890) in/search; annotations API batches 1–8 article IDs per request. No hard key cap; polite ~5–10 req/s. - License: Open metadata; full-text reuse governed by explicit per-article CC license field.
- Upstream Quirks:
- Always pass
format=json(XML is the default otherwise!). cursorMarkechoes the current cursor when exhausted — already handled automatically byResourceClient._iterate_cursor().- Pass
resultType="core"to retrieve full abstracts, grants, MeSH headings, and full-text URLs (liteomits them). - Verified 2026-11-27:
pageSizeaccepts at most 1000, and a larger value answers 404.nextCursorMarkrepeats unchanged when the list is exhausted. A search can take about ten seconds and answers transient 503 errors, which the client retries. - Verified 2026-11-27: the data links route is
/{source}/{id}/datalinksin lower case, anddataLinksanswers 404. The routescomments,correctionsAndErratum, andtextMinedTermsanswer 404 and are absent from the OpenAPI document. Comments and corrections are part of the core record, and text-mined terms moved to the annotations API. - Verified 2026-11-27:
fullTextXMLandsupplementaryFilestake a bare id such asPMC13810549. They answer 406 toAccept: application/jsonand needapplication/xml.bookXMLanswers 200 with a message element for a book without open access XML. - Verified 2026-11-27: the grants API is the Grist API at
https://www.ebi.ac.uk/europepmc/GristAPI/rest/get/query=<q>&format=json&page=N. The parameters must follow&and not?, because?makes the route answer 406 to a JSONAcceptheader.HitCountis a JSON string. - Verified 2026-11-27: the annotations API has five routes. Four of them
page with a float
cursorMarkand signal exhaustion with anextCursorMarkof-1.0.annotationsBySectionAndOrTypewithout a filter returns about 24 MB.
8. Zenodo / InvenioRDM (Datasets & Software Releases)
- Base URL:
https://zenodo.org/api(generalizable to any InvenioRDM instance by swappingbase_url) - Auth:
NoAuth()for public read (mandatoryUser-Agent, otherwise403); optionalStaticTokenAuth(token)for higher page size (100vs25) and private/deposit access. QueryDialect: Use per-instancedialect=based on auth presence:page_param="page",page_start=1,page_size_param="size",max_page_size=25(unauth) or100(auth),default_page_size=25, andpage * sizeat most 10,000 (Elasticsearchmax_result_window, verified 2026-11-27),query_param="q",sort_param="sort".ResponseUnwrapper:results -> body["hits"]["hits"],item -> body,total -> body["hits"]["total"],next_cursor -> None(orlinks.next),meta -> {"aggregations": body.get("aggregations", {})}.- Batching & Rate Limits: Batch concept/version DOIs with an
ORclause inq, which uses the Elasticsearch query-string syntax. Rate: verified 2026-11-27, about 78 requests at 2 per second met no limit and the API sent no rate-limit headers. The client defaults to 2 requests per second. - License: Metadata CC0; record files per declared SPDX license (default CC-BY 4.0).
- Upstream Quirks:
- Always distinguish
conceptdoi(all versions) vs.doi(specific version) and preservefiles[].checksum(md5:...). - Use
BaseApiClient.stream()for downloading dataset/software archives so auth, throttling, and typed errors apply automatically. - Verified 2026-11-27: the API serves the legacy record schema
(
recid,conceptrecid,metadata), not the InvenioRDM schema that the documentation describes. A concept id answers 302 to the newest version,mostrecentorders by last update, andall_versions=truereturns every version instead of one record per concept. - Verified 2026-11-27:
/api/vocabularies/{vocabulary}serves theresourcetypes,licenses,languages,communitytypes,funders, andaffiliationsvocabularies in a hits envelope;/api/communities/{id}/subcommunitiesanswers the RDM-shaped hits envelope; andhttps://zenodo.org/oai2danswers all six OAI-PMH verbs (aListRecordscall without a match answers 422 withnoRecordsMatch).
9. DOI RA / Content Negotiation + ISSN Portal ConNeg
Two small lookup clients: hodoi for the DOI proxy at doi.org and
seriatim for the ISSN Portal.
- Base URLs:
https://doi.org/ra/{doi1},{doi2}— batch DOI Registration Agency lookup (returns JSON list of{"DOI": ..., "RA": "Crossref" | "DataCite" | ...}).https://doi.org/api/handles/{doi}— raw Handle.net JSON record.https://doi.org/{doi}— HTTP Content Negotiation withfollow_redirects=TrueandAccept: application/vnd.citationstyles.csl+json(orapplication/vnd.schemaorg.ld+json,application/x-bibtex).- Verified 2026-11-27: Crossref answers CSL JSON, Unixref XML, BibTeX, and
RIS, and answers 406 for schema.org JSON-LD and DataCite JSON; DataCite
answers all of them; mEDRA answers CSL JSON, BibTeX, and RIS. The
client keeps the catalog in
hodoi.media_types. https://portal.issn.org/resource/ISSN/{issn}withAccept: application/ld+json— JSON-LD lookup. Verified 2026-11-27: without thatAcceptheader?format=jsonanswers with HTML, and the JSON-LD is a single node.- Auth:
NoAuth(). - Batching & Rate Limits:
/ra/{doi1},{doi2}accepted a list of 200 DOIs and answered 414 for 500 (verified 2026-11-27), so the client chunks at 100./doiRA/serves the same route. doi.org publishes no limit; the client defaults to 2 requests per second. ISSN Portal free ConNeg is individual lookup only (polite pacing, aggressive local caching). - License: Open resolution infrastructure; individual DOI metadata license follows its Registration Agency; ISSN Portal free ConNeg is non-bulk.
- Upstream Quirks:
- doi.org redirects content negotiation to the data server of the
registration agency (Crossref
api.crossref.org/v1/works/{doi}/transform, DataCitedata.crosscite.org/{doi}). TheAcceptheader survives the redirect. The client follows redirects on the content request only, so that a caller can still read the 302. - Verified 2026-11-27: without an
Acceptheader the proxy redirects to the landing page;HEADanswers 302 with the sameLocation; the Handle REST API acceptsindex,type,auth, andrecursive; the old Handbook URL for resolution now redirects to a landing page, and the current reference is the DOI resolution documentation that the package cites. - Verified 2026-11-27: the ISSN Portal JSON-LD is one node per resource,
not a
@grapharray as this spec assumed. - Verified 2026-11-27: the ISSN Portal answers JSON-LD for
/resource/ISSN/{issn}and/resource/ISSN-L/{issn}only. The free search (/search) and the Title Word Abbreviation list (/ltwa) are HTML pages, which the client reads with the standard library parser. The portal has no SPARQL endpoint. The SRU Search API, OAI-PMH access, and the ISSN-H families need a paid subscription.
10. Wikidata (Universal PID Crosswalk Hub)
- Base URLs:
- REST API v1:
https://www.wikidata.org/w/rest.php/wikibase/v1 - Action API (batch):
https://www.wikidata.org/w/api.php - Optional SPARQL:
https://query.wikidata.org/sparql - Auth:
NoAuth()(optional OAuth2). DescriptiveUser-Agentwith contact URL/email is strictly mandatory (BaseApiSettings.mailtohandles this cleanly; generic user agents receive immediate429). QueryDialect: Actionwbsearchentities:offset_param="continue",page_size_param="limit",max_page_size=50,default_page_size=25,query_param="search",page_param=None,sort_param=None.ResponseUnwrapper: Actionwbgetentitiesreturns a dict keyed by QID (body["entities"]); convertlist(body["entities"].values())(filtering"missing" in item) inresults().- Batching & Rate Limits: Override
_fetch_batch_chunk()to call Actionwbgetentitieswithids=Q1|Q2|...(up to 50 QIDs per request). HonorRetry-After; keep SPARQL queries under the 60s timeout and ≤5 concurrent. - License: CC0 1.0.
- Upstream Quirks:
- Extract external IDs from well-known properties (
P496ORCID,P6782ROR,P213ISNI,P214VIAF,P227GND,P244LCCN,P269IdRef,P1278LEI,P236ISSN,P356DOI,P6179/P10283OpenAlex). - Cache entity responses aggressively with
ETag/If-None-Matchwhen revalidating crosswalks. - Verified 2026-11-27 and 2026-11-28: the Action API answers every error
with HTTP 200 and an
errorobject, andwbgetentitiestakes at most 50 ids.wbsearchentitiesreports no total.Special:EntityData/{id}.{format}serves one entity asjson,jsonld,rdf,nt,ttl, orn3, andhttps://www.wikidata.org/entity/{id}redirects to it. The REST API adds/search/*,/suggest/*, and/statements/*. The lexeme routes live under/w/rest.php/wikibaselexeme/v0, and the linked-data endpoint of the query service is gone. The client wraps all of these read routes.