Skip to contents

Look up DOIs in the corpus via the Unpaywall API and add open-access status and best OA URL to the works table.

This enricher is idempotent: re-running it updates existing OA data rather than duplicating it. Requires a mailto address for API access.

Usage

sm_enrich_unpaywall(
  corpus,
  mailto = Sys.getenv("SCIMAPR_MAILTO"),
  verbose = TRUE,
  call = rlang::caller_env()
)

Arguments

corpus

An sm_corpus object.

mailto

Email address for the Unpaywall API. Read from SCIMAPR_MAILTO env var by default.

verbose

Print progress messages?

call

Caller environment for error reporting.

Value

An sm_corpus object with updated oa_status and oa_url columns in the works table, plus new provenance rows.

Examples

if (FALSE) { # \dontrun{
corpus <- sm_example_corpus()
corpus <- sm_enrich_unpaywall(corpus)
} # }