efetch
As new Insider's Guide classes are no longer being offered, this site is not currently being updated. Please refer to NCBI's E-utilities documentation for more up-to-date information.
The efetch
command uses the EFetch utility to download records from an NCBI database in a specified format.
Input
One or more unique identifiers (UIDs; when fetching from PubMed, PMIDs). These UIDs can be specified in the -id
argument (see below), or can be retrieved from the History server.
Output
One or more records displayed in a chosen format:
- A list of UIDs (i.e. PMIDs).
- Abstract view, formatted in plain text.
- MEDLINE view, including the field indicators.
- The full XML of the record.
Arguments
The efetch
command allows the following arguments:
-db
: The database from which you wish to retrieve records.- Example:
-db pubmed
- Example:
-id
: One or more UIDs (PMIDs, if your-db
argument ispubmed
), separated by commas.- Example:
-id 24102982,21171099,17150207
- Example:
-id 26287646
- Example:
-format
: Specifies the format in which you wish to display the records.- For PubMed, the valid formats include:
uid
: displays a list of UIDs (i.e. PMIDs).abstract
: displays the Abstract view, formatted in plain text.medline
: displays the MEDLINE view, including the field indicators.xml
: displays the full PubMed XML.
- Example:
-format uid
- Example:
-format xml
- For PubMed, the valid formats include:
Examples:
Retrieve the record for PMID 25359968 in MEDLINE format:
efetch -db pubmed -id 25359968 -format medline
Retrieve the record for PMID 26287646 in XML format:
efetch -db pubmed -id 26287646 -format xml
Retrieve the records for PMIDs 24102982, 21171099, and 17150207 in abstract view:
efetch -db pubmed -id 24102982,21171099,17150207 -format abstract