Skip Navigation Bar
NLM logo


Please note: following the release of the new version of PubMed, the results returned by E-utilities queries of PubMed may differ slightly from those returned in the web version of PubMed. A new PubMed API is currently under development: more information will be announced when available.

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.


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

Last Reviewed: August 9, 2021