paper_firehose.core.apis.crossref_client

Crossref API client for fetching paper abstracts.

Crossref is a major DOI registration agency with comprehensive metadata including abstracts for academic publications.

Functions

get_crossref_abstract(doi, *, mailto[, ...])

Return the plain-text abstract for DOI or None if not available.

search_crossref_abstract_by_title(title, *, ...)

Best-effort abstract lookup by title when DOI is missing or returns no abstract.

paper_firehose.core.apis.crossref_client.get_crossref_abstract(doi, *, mailto, max_retries=3, session=None)[source]

Return the plain-text abstract for DOI or None if not available.

Implements exponential backoff on 429/5xx and honors Retry-After when present. Also sends Crossref the mailto parameter.

Parameters:
  • doi (str) – Digital Object Identifier to look up

  • mailto (str) – Contact email for Crossref User-Agent

  • max_retries (int) – Maximum number of retry attempts (default: 3)

  • session (Optional[Session]) – Optional requests.Session for backward compatibility

Return type:

Optional[str]

Returns:

Plain-text abstract or None if not available

paper_firehose.core.apis.crossref_client.search_crossref_abstract_by_title(title, *, mailto, max_retries=2, session=None)[source]

Best-effort abstract lookup by title when DOI is missing or returns no abstract.

Uses Crossref’s works search endpoint with a bibliographic query. Returns the first item’s abstract if available.

Parameters:
  • title (str) – Paper title to search for

  • mailto (str) – Contact email for Crossref User-Agent

  • max_retries (int) – Maximum number of retry attempts (default: 2)

  • session (Optional[Session]) – Optional requests.Session for backward compatibility

Return type:

Optional[str]

Returns:

Plain-text abstract or None if not available