Skip to content

API reference

Generated from the source with mkdocstrings.

Client

bibliofabric.rxiv.RxivClient

Bases: BaseApiClient

Client for the bioRxiv and medRxiv API (https://api.biorxiv.org).

One client serves both preprint servers; most methods take server (biorxiv or medrxiv). The API needs no credentials.

details cached property

Preprint metadata: by DOI, by date range, and the newest posts.

published cached property

Links from preprints to the journal articles they became.

funders cached property

Preprints filtered by a funder ROR id.

statistics cached property

Content and usage statistics.

The sync client RxivSyncClient mirrors the async class method for method.

Route clients

bibliofabric.rxiv.DetailsClient

Bases: _RoutesClient

Preprint metadata from the details routes (30 records per page).

collect(server, start, end, *, category=None, limit=None) async

Collect iterate() output into a list, optionally bounded.

get(doi, *, server='biorxiv') async

Return every version of one preprint, oldest first.

An unknown DOI raises :class:NotFoundError.

iterate(server, start, end, *, category=None)

Yield every preprint version posted between two dates.

recent(server, *, posts=None, days=None, category=None) async

Return the most recent posts, by count or by days, in one page.

Pass posts (the N newest versions) or days (everything of the last N days). These upstream forms take no cursor, so the page carries no next_cursor.

search(server, start, end, *, cursor=0, category=None) async

Return one page of the preprint versions posted between two dates.

category filters by subject category (cell biology or cell_biology). page.next_cursor is the next offset.

bibliofabric.rxiv.PublishedClient

Bases: _RoutesClient

Preprints and the journal articles they became (100 records per page).

biorxiv(start, end, *, cursor=0) async

Return one page of the pub route (bioRxiv only, fewer fields).

by_publisher(prefix, start, end, *, cursor=0) async

Return one page of bioRxiv preprints published under a DOI prefix.

prefix is the publisher DOI prefix, such as 10.15252.

collect(server, start, end, *, limit=None) async

Collect iterate() output into a list, optionally bounded.

get(doi, *, server='biorxiv') async

Return the publication links of one preprint or journal DOI.

Both the preprint DOI and the published DOI work. A DOI without a link raises :class:NotFoundError.

iterate(server, start, end)

Yield every preprint published as an article between two dates.

iterate_biorxiv(start, end)

Yield every bioRxiv preprint published as an article between two dates.

iterate_by_publisher(prefix, start, end)

Yield every bioRxiv preprint published under a DOI prefix.

recent(*, posts=None, days=None) async

Return the most recently published bioRxiv articles, in one page.

Pass posts (the N newest articles) or days (the articles of the last N days). These upstream forms of the pub route take no cursor, so the page carries no next_cursor.

search(server, start, end, *, cursor=0) async

Return one page of preprints published as articles between two dates.

bibliofabric.rxiv.FundersClient

Bases: _RoutesClient

Preprints with a funding declaration of one funder (100 per page).

The funder is a ROR id; the route covers posts from 2025-04-10 on, when the submission system began to record funders.

collect(server, ror_id, start, end, *, category=None, limit=None) async

Collect iterate() output into a list, optionally bounded.

iterate(server, ror_id, start, end, *, category=None)

Yield every preprint version that declares the funder.

search(server, ror_id, start, end, *, cursor=0, category=None) async

Return one page of preprint versions that declare the funder.

bibliofabric.rxiv.StatisticsClient

Bases: _RoutesClient

Content and usage statistics per month (m) or year (y).

content(interval='m') async

Return new and revised bioRxiv papers per month or year.

usage(server, interval='m') async

Return abstract views, full text views, and PDF downloads.

Unwrapper and status check

bibliofabric.rxiv.RxivUnwrapper

Extracts records, totals, and metadata from bioRxiv envelopes.

item(body)

Return the first record, or an empty dict.

meta(body)

Return the messages object.

next_cursor(body)

Return cursor + count while records remain, else None.

The API sends cursor as a number on the first page and as a string on later pages, so both forms count. Without a usable cursor or count, or when the page does not advance, there is no next page. Without a total, iteration continues; the routes stop on the first empty page.

results(body)

Return the records of collection or of the statistics key.

total(body)

Return messages[0].total (sent as a string or a number).

bibliofabric.rxiv.check_status(body, *, response=None)

Raise :class:APIError for an error status in messages.

ok in any capitalization passes, and so does the no ... found family the API sends for empty answers. Every other status names a request the API rejected; the raised error carries request and response when they are known.

bibliofabric.rxiv.message(body)

Return the first messages object, or an empty dict.

Settings

bibliofabric.rxiv.RxivSettings

Bases: BaseApiSettings

bioRxiv-specific client settings.

Inherits timeout, max_retries, max_retry_wait, max_requests_per_second, max_concurrency, user_agent and mailto from :class:bibliofabric.config.BaseApiSettings. The API needs no credentials.

bibliofabric.rxiv.get_settings() cached

Return the process-wide settings, loaded once from the environment.

Models

bibliofabric.rxiv.Preprint

Bases: BaseModel

One version of a bioRxiv or medRxiv preprint.

authors is one string with ; between the names, as the API sends it; :attr:author_list splits it. published is the DOI of the journal article, or "NA"; :attr:published_doi reads it.

author_list property

The author names in order.

published_doi property

The DOI of the journal article, or None.

version_number property

The version as an integer.

bibliofabric.rxiv.PublishedArticle

Bases: BaseModel

A preprint and the journal article it became.

The pubs route names the preprint DOI preprint_doi; the pub and publisher routes name it biorxiv_doi. :attr:preprint reads whichever is set.

author_list property

The preprint author names in order.

preprint property

The preprint DOI, from preprint_doi or biorxiv_doi.

bibliofabric.rxiv.FunderDeclaration

Bases: BaseModel

One funding declaration of a preprint (funder route only).

bibliofabric.rxiv.ContentStatistic

Bases: BaseModel

New and revised papers per month or year (sum route).

The API sends the counts as strings or numbers and "" for a missing value; the missing markers become None before validation and the string counts coerce to int.

bibliofabric.rxiv.UsageStatistic

Bases: BaseModel

Views and downloads per month or year (usage route).

The API sends the counts as strings or numbers and "" for a missing value; the missing markers become None before validation and the string counts coerce to int.

Path helpers

bibliofabric.rxiv.date_range(start, end)

Return the YYYY-MM-DD/YYYY-MM-DD interval segment.

Accepts date and datetime objects (a datetime counts as its own date) and strings in YYYY-MM-DD form. A date that does not exist, such as 2026-02-31, and unparsed strings raise :class:ConfigurationError.

bibliofabric.rxiv.server_segment(server)

Return the lower-case server name or raise for an unknown one.

Constants

Name Value Meaning
BIORXIV_API_BASE_URL https://api.biorxiv.org Base URL; it serves bioRxiv and medRxiv
SERVERS biorxiv, medrxiv The two preprint servers
DETAILS_PAGE_SIZE 30 Records per page of the details routes
PUBLISHED_PAGE_SIZE 100 Records per page of the other list routes
STATISTICS_INTERVALS m, y Intervals of the statistics routes