The search term field names are documented in the EInfo API endpoint:
see einfo().
Usage
esearch(
term,
db,
...,
retstart = 0L,
retmax = NA,
retmode = "xml",
rettype = "uilist",
usehistory = is.null(retmax) || is.na(retmax),
WebEnv = NULL,
query_key = NULL,
.cookies = NA,
.paginate = 10000L,
.progress = "ESearch",
.path = NULL,
.verbose = getOption("jentre.verbose", default = TRUE),
.call = current_env()
)Arguments
- term
search query.
- db
Entrez database name.
- ...
additional API parameters (refer to Entrez documentation). Any set to
NULLare removed.- retstart
integer: index of first result (starts from 0). Ignored when
usehistoryisTRUE.- retmax
integer: maximum number of results to return. When
NAthis returns all results. WhenNULL, uses the Entrez default (typically 20). Note that it is possible that slightly more thanretmaxresults will be returned when paginating. Ignored whenusehistoryisTRUE.- retmode
character: currently only
"xml"is supported.- rettype
character: currently only
"uilist"is supported.- usehistory
logical: when
TRUEuse the history server to return the result.- WebEnv, query_key
either characters to pass on as-is, or
web_historyobjects.path to persist cookies. If
NULL, cookies are not added to the request. For helper functions: whenNA, a temporary file is created (in this case only, the temporary file will be cleaned up once all requests are performed).- .paginate
controls how multiple API requests are used to complete the call. Pagination is performed using the
retstartandretmaxAPI parameters. When set to an integer, no more than.pagniateitems will be requested per API call. WhenFALSEor0, only one API request is sent. Ignored whenusehistoryisTRUE.- .progress
controls progress bar; see the
progressargument ofhttr2::req_perform_iterative().- .path
path specification for saving raw responses. See
pathargument ofhttr2::req_perform_iterative().- .verbose
logical: when TRUE logs all API requests as messages in a compact format. This uses a summarised format that does not include the request body for POST. Use normal httr verbosity controls (e.g.
httr2::local_verbosity()) to override this behaviour and see more details.- .call
call environment to use in error messages/traces. See rlang::topic-error-call and the
callargument ofcli::cli_abort(). You only need to specify this in internal helper functions that don't need to be mentioned in error messages.
Value
id set object (either a web_history or an id_list).
See also
https://www.ncbi.nlm.nih.gov/books/NBK25499/#chapter4.ESearch
Other API methods:
efetch(),
einfo(),
elink(),
entrez_validate(),
epost(),
esummary()