Entrez Full Records
eutils_efetchDownload full NCBI Entrez records by UID or history handle in formats like abstracts or FASTA for literature and sequence retrieval.
Instructions
Download full records in a chosen format.
Defaults are chosen for readability: PubMed returns plain-text abstracts, and sequence databases return FASTA. Returned record text is external data and is fenced with an explicit marker.
Args:
db (string, optional): database, for example "pubmed". Required unless history is given.
uids (string[] | string, optional): UIDs or accession.version identifiers.
history (object, optional): handle from eutils_esearch, eutils_epost, or eutils_elink.
rettype (string, optional): "abstract" (pubmed default), "fasta" (sequence default), "gb", "docsum", "medline", ...
retmode ('text' | 'xml', optional): default "text".
retstart (number, optional): first record index, for history sets.
retmax (number, optional): records to return for a history set. Default 20, max 500.
response_format ('markdown' | 'json'): output format. Default 'markdown'.
Supply either uids or history, never both.
Returns: { database, rettype, retmode, record_count?, batches?, text }
Examples:
Use when: "give me the abstract for PMID 31452104" -> db="pubmed", uids=["31452104"]
Use when: "fetch the protein sequence" -> db="protein", uids=["NP_005537.3"], rettype="fasta"
Use when: downloading a large set -> pass history and page with retstart/retmax
Don't use when: you only need titles and dates (use eutils_esummary, which is far cheaper)
Error Handling:
Asks for an explicit rettype when the database has no default
Detects an error message returned as record text and reports it as a tool error
Refuses retmax above 500; larger sets are batched internally
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| db | No | Entrez database, for example "pubmed". May be omitted when history is given. | |
| uids | No | UIDs or accession.version identifiers, as an array or a comma-separated string. Example: ["31452104", "31452105"]. | |
| retmax | No | Maximum records to return when using history (default 20, max 500). | |
| history | No | Pointer to a UID set stored on the NCBI History server. Pass back the object returned by a previous call, unchanged. | |
| retmode | No | Response encoding. Default "text", which is what you want for abstracts and FASTA. | |
| rettype | No | Record format. Defaults to "abstract" for pubmed and "fasta" for sequence databases. Other databases need an explicit value, for example "gb" or "docsum". | |
| retstart | No | Index of the first record to return. Use with history. | |
| response_format | No | Output format: 'markdown' for human-readable text, or 'json' for machine-readable data. Default: 'markdown'. | markdown |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Raw record text. The markdown rendering fences it as external data. | |
| batches | No | ||
| retmode | Yes | ||
| rettype | Yes | ||
| database | Yes | ||
| record_count | No |