Skip to contents

Queries the OpenAlex API for peer-reviewed works matching a keyword in a specified field. No API key is required; providing an email via pc_configure() or the email argument places requests in the polite pool for better rate limits and higher quotas.

Usage

pc_search_openalex(
  query,
  field = c("abstract", "affiliation", "funder"),
  max_results = 500L,
  email = NULL,
  funder_id = NULL,
  ...
)

Arguments

query

Character. Keyword or phrase to search.

field

Character. One of "abstract", "affiliation", "funder".

max_results

Integer. Maximum number of records to return. OpenAlex uses cursor-based pagination in batches of up to 200; this is handled automatically. Default 500.

email

Character. Email for the OpenAlex polite pool. Falls back to the value set with pc_configure(), then the PUBCLASSIFY_EMAIL environment variable. NA if none is found (still works through the slower pool).

funder_id

Character. One or more OpenAlex funder entity IDs (e.g. "https://openalex.org/F4320308027"). When provided with field = "funder", skips the name-based lookup entirely and filters works directly by these IDs. Use pc_find_funder() to discover IDs. Ignored when field is not "funder".

...

Reserved for future use.

Value

A tibble::tibble() with the standard pubclassify schema. See pc_search() for column details.

Examples

if (FALSE) { # \dontrun{
pc_search_openalex("University of California", field = "affiliation")

# Disambiguate first, then pin the exact funder
pc_find_funder("Department of Water Resources")
pc_search_openalex(
  query     = "Department of Water Resources",
  field     = "funder",
  funder_id = "https://openalex.org/F4320308027"
)
} # }