NLM logo


This documentation reflects EDirect version 10.9, released on 2/1/2019.

We strive to keep this documentation up-to-date with the latest release. If you are looking for documentation on a more recent version of EDirect, or to find out more about new EDirect releases, please see the Release Notes of NCBI's EDirect documentation.

The efetch command uses the EFetch utility to download records from an NCBI database in a specified format.


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.


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.


The efetch command allows the following arguments:

  • -db: The database from which you wish to retrieve records.
    • Example: -db pubmed
  • -id: One or more UIDs (PMIDs, if your -db argument is pubmed), separated by commas.
    • Example: -id 24102982,21171099,17150207
    • Example: -id 26287646
  • -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


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