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
NULL
are removed.- retstart
integer: index of first result (starts from 0). Ignored when
usehistory
isTRUE
.- retmax
integer: maximum number of results to return. When
NA
this returns all results. WhenNULL
, uses the Entrez default (typically 20). Note that it is possible that slightly more thanretmax
results will be returned when paginating. Ignored whenusehistory
isTRUE
.- retmode
character: currently only
"xml"
is supported.- rettype
character: currently only
"uilist"
is supported.- usehistory
logical: when
TRUE
use the history server to return the result.- WebEnv, query_key
either characters to pass on as-is, or
web_history
objects.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
retstart
andretmax
API parameters. When set to an integer, no more than.pagniate
items will be requested per API call. WhenFALSE
or0
, only one API request is sent. Ignored whenusehistory
isTRUE
.- .progress
controls progress bar; see the
progress
argument ofhttr2::req_perform_iterative()
.- .path
path specification for saving raw responses. See
path
argument 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
call
argument 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()