ncbi_search: Search NCBI databases for articles or data

View source: R/pubmed_search.R

ncbi_searchR Documentation

Description

This function searches various NCBI databases using the E-utilities API via the rentrez package.

Usage

ncbi_search(
  query,
  database = "pubmed",
  max_results = 1000,
  use_mesh = FALSE,
  date_range = NULL,
  api_key = NULL,
  retry_count = 3,
  retry_delay = 2
)

Arguments

query

Character string containing the search query.

database

Character string. The NCBI database to search (e.g., "pubmed", "pmc", "gene", "protein").

max_results

Maximum number of results to return.

use_mesh

Logical. If TRUE, will attempt to map query terms to MeSH terms (for PubMed only).

date_range

Character vector of length 2 with start and end dates in format "YYYY/MM/DD".

api_key

Character string. NCBI API key for higher rate limits (optional).

retry_count

Integer. Number of times to retry failed requests.

retry_delay

Integer. Delay between retries in seconds.

Value

A data frame containing the search results with IDs, titles, and other metadata.


LBDiscover documentation built on June 16, 2025, 5:09 p.m.