Upstream quirks
Findings from about 80 requests against the live OpenCitations APIs on 2026-11-27 (about 45 by an earlier probe, 23 in this study, and the live test runs), and from further requests on 2026-11-28 that checked the count routes for unknown ids, the encoding of ids in the path, and the two SPARQL endpoints. The reference is the Index API v2 documentation (version 2.2.0, 2025-04-15) and the Meta API v1 documentation (version 1.1.1, 2022-12-22). Where a quirk affects opcitato, the behavior of the client is noted.
Limits and access
- Both APIs document a rate limit of 180 requests per minute per IP address (3 per second). No rate-limit headers are sent, so the limit cannot be read from responses; the client paces at 3 requests per second by default.
- Both API documentations ask applications to send an OpenCitations Access Token in the
authorizationheader. The token is free, optional, and lets OpenCitations count unique users. Neither documentation ties it to a higher limit. The client sends no token and manages none; a caller can pass a preparedhttpx.AsyncClientthat carries the header (verified offline). https://opencitations.net/index/v2/...(without theapi.host) answers 403. The canonical host ishttps://api.opencitations.net, which is the client default. The Retrieval API routes (https://opencitations.net/index/api/v2/citations/...) answer 200 on the www host but are a different, undocumented service; the client does not use them.
The result is the whole list
- No operation pages. Every request returns the complete result of the query; one response can reach hundreds of kilobytes (a 658 KB response was cut off once by the network and httpx raised
RemoteProtocolError; the framework retries network errors). require,filter,sort,format, andjsonare server-side row operations that every operation accepts. The verified behavior:require=creationdropped one of 57 rows (the one with an empty creation date),filter=creation:>2019-12kept 15 of 57, andsort=desc(creation)ordered by the string date, so partial dates (2020,2020-03) sort before full dates within the same year.format=csvworks as a query parameter. AnAccept: text/csvheader alone does not change the representation; theformatparameter has priority over the header. The CSV header repeats the JSON field names, soformat="csv"parses into the same models.- The
json=array(...)/json=dict(...)row transformations are documented but not exposed by the client.
Identifier handling
- Index path ids must carry a scheme prefix. The documented shape is
(omid|doi|pmid|issn|isbn):(.+). A bare DOI and anopenalex:id answer 400 with a plain-text body such asHTTP status code 400: the value '10.1108/jd-12-2013-0166' is not valid for parameter 'id' in operation '/index/v2/citations/{id}'. Example: /index/v2/citations/doi:10.1108/jd-12-2013-0166. The client rejects both shapes before a request is sent; a 400 that slips through raisesAPIError. - Meta metadata accepts more schemes than the Index API: the documented shape also allows
openalex,pmid, andpmcid, andopenalex:W2159974629answered 200 with the Nature 12373 metadata (verified 2026-11-27). - Several identifiers in one request are only a Meta feature.
/meta/v1/metadata/{a}__{b}answered with one row per id (verified 2026-11-27). The Index operations document no multi-id form;citations/doi:A__doi:Banswered[]even though both ids have citations, so the Index client sends one id per request. - The
/citation/{oci}operation wants the barefirst-secondnumbers without theoci:prefix. The client strips an optional prefix. - Citing and cited rows pack several schemes into one space-separated string. The live data carries
omid:,doi:,openalex:, andpmid:(verified 2026-11-27). - The server percent-decodes the path before it looks up the identifier. The SICI DOI
10.1002/(SICI)1097-4636(199823)43:3<338::AID-JBM16>3.0.CO;2-Banswered the same count when its parentheses, angle brackets, and semicolon arrived percent-encoded and when some of them arrived raw (verified 2026-11-28). httpx cuts a path at the first#or?, so the client percent-encodes every character of an identifier other than/and:. - The Meta
/author/{id}and/editor/{id}operations also accept an ORCID without theorcid:prefix, according to their documented shape. The client requires the prefix, as it does for every identifier.
Values that differ from the documentation
- The count operations answer
[{"count": "57"}]: the count travels as a string although the documentation types the field as int. TheCountmodel coerces it. journal_scandauthor_scare"yes"/"no"strings.creationdates can be partial (2013,2013-07);timespancan be negative (-P1Y1M16D).- The documentation claims that values are prefixed with
[index name] =>when data comes from several indexes; no such prefix appeared in any live payload on 2026-11-27. The models store the values as they arrive.
Unknown identifiers and errors
- An unknown id is not an error. Row operations answer 200 with
[]. The count operations answered[]on 2026-11-27 and a zero row ([{"count": "0"}]) on 2026-11-28; the client returnsNonefor the first answer and0for the second. - Rejected parameters answer 400 with a
text/plainbody, not JSON. The framework raisesAPIErrorfor any status of 400 or above, before parsing the body.
Routes that do not exist
The Index operations /metadata/{id}, /citation-count-and-year/{id}, /citations-with-context/{id}, and source-scoped /index/v2/{source}/citations/{id} answered 404 on api.opencitations.net on 2026-11-27 and appear in neither API's documentation; the six documented Index operations and the three documented Meta operations are the complete surface. The Meta routes related, citation, journal, publisher, identifier, amount, and concept also answered 404 and are not documented.
SPARQL endpoints
- Each dataset has a SPARQL endpoint:
https://sparql.opencitations.net/indexandhttps://sparql.opencitations.net/meta. The landing page athttps://sparql.opencitations.net/lists both; the REST API documentations do not mention them. - The endpoints answer SPARQL 1.1 Query Results XML unless the
Acceptheader asks for another representation.application/sparql-results+jsonreturns the JSON form with one addition: ametamember that carriesquery-time-msandresult-size-total. TheSparqlResultmodel keeps it. application/sparql-results+xml,text/csv,text/tab-separated-values,text/turtle, andapplication/n-triplesselect the other representations. AnAccepttype the endpoint does not serve answers 406. A CONSTRUCT query that asks forapplication/sparql-results+jsonanswers Turtle.- A query travels in the
queryparameter of a GET request, in the form body of a POST request, or in anapplication/sparql-querybody of a POST request. The client sends thequeryparameter by default and a form body formethod="POST". - A malformed query answers 400 with a JSON body that carries an
exceptionmember. The framework raisesAPIErrorfor the status. - An ASK query answers
{"head": {}, "boolean": true}with noresultsmember.
Index API v1
https://api.opencitations.net/index/v1/citations/{doi} still answers 200 (verified 2026-11-28). It takes a bare DOI and returns a subset of the v2 fields, with bare DOIs in citing and cited instead of the prefixed identifiers of v2. The client targets v2 only; the deferred list has the entry.