Skip to contents

Provides an interface to the CrossRef API, searching for citations given a string query. Results are written to a bib file, read back into R using WriteBib, and returned as a BibEntry object.


  query = "",
  filter = list(),
  limit = 5,
  offset = 0,
  sort = "relevance",
  year = NULL,
  min.relevance = 2,
  temp.file = tempfile(fileext = ".bib"),
  delete.file = TRUE,
  verbose = FALSE,
  use.old.api = FALSE



string; search term


named list of possible filters; see Details and References; ignored if use.old.api = TRUE


numeric; maximum number of entries to return


numeric; CrossRef will not return the first offset results (default 0); ignored if use.old.api = TRUE


string; how specifying how the results from CrossRef should be sorted. Possible values when use.old.api = FALSE are "score" (default; same as "relevance"), "updated", "deposited", "indexed", or "published"; see the references


numeric; if specified, only results from this year will be returned.


numeric; only results with a CrossRef-assigned relevance score at least this high will be returned.


string; file name to use for storing Bibtex information returned by CrossRef.


boolean; should the bib file be deleted on exit?


boolean; if TRUE, additional messages are output regarding the results of the query.


boolean; should the older CrossRef API be used for the search? NO LONGER SUPPORTED, all queries need to use the new API.


An object of class BibEntry.


When use.old.api = TRUE, the query HTTP request only returns DOIs, which are then used to make HTTP requests for the corresponding BibTeX entries from CrossRef; when use.old.api = FALSE, the query HTTP request is parsed to create the BibEntry object (i.e. there are less HTTP requests when using the new API).

CrossRef assigns a score between 0 and 100 based on how relevant a reference seems to be to your query. The old API documentation warns that while false negatives are unlikely, the search can be prone to false positives. Hence, setting min.revelance to a high value may be necessary if use.old.api = TRUE. In some instances with the old API, no score is returned, if this happens, the entries are added with a message indicating that no score was available.

Possible values for the names in filter are "has-funder", "funder", "prefix", "member", "from-index-date", "until-index-date", "from-deposit-date", "until-deposit-date", "from-update-date", "until-update-date", "from-created-date", "until-created-date", "from-pub-date", "until-pub-date", "has-license", "license.url", "license.version", "license.delay", "has-full-text", "full-text.version", "full-text.type", "public-references", "has-references", "has-archive", "archive", "has-orcid", "orcid", "issn", "type", "directory", "doi", "updates", "is-update", "has-update-policy", "container-title", "publisher-name", "category-name", "type-name", "award.number", "award.funder", "assertion-group", "assertion", "affiliation", "has-affiliation", "alternative-id", and "article-number". See the first reference for a description of their meanings.


The entries returned by Crossref are frequently missing fields required by BibTeX, if you want the entries to be returned anyway, set BibOptions()$check.entries to FALSE or "warn"

Fields "score" (the relevancy score) and "license" will be returned when use.old.api = FALSE.

See also

ReadZotero, BibEntry, package rcrossref for larger queries and deep paging

Other pubmed: GetPubMedByID(), GetPubMedRelated(), LookupPubMedID(), ReadPubMed()


if (interactive() && !httr::http_error("")){
  BibOptions(check.entries = FALSE)
  ## 3 results from the American Statistical Association involving "regression"
  ReadCrossRef("regression", filter = list(prefix="10.1198"), limit = 3)

  ## Some JRSS-B papers published in 2010 or later, note the quotes for filter
  ##   names with hypens
  ReadCrossRef(filter = list(issn = "1467-9868", "from-pub-date" = 2010),
               limit = 2, min.relevance = 0)

  ## Articles published by Institute of Mathematical Statistics
  ReadCrossRef(filter = list(prefix = "10.1214"), limit = 5, min.relevance = 0)

  ## old API
  ReadCrossRef(query = 'rj carroll measurement error', limit = 2, sort = "relevance",
    min.relevance = 80, use.old.api = TRUE)

  ReadCrossRef(query = 'carroll journal of the american statistical association',
    year = 2012, limit = 2, use.old.api = TRUE)