PubMed
PubMed Nucleotide Protein Genome Structure PopSet Taxonomy OMIM

Linking to PubMed and other Entrez databases
Last Updated: June 4, 2001

The Entrez system provides three distinct ways to create Web URL links that search and retrieve documents from PubMed and the molecular biology databases. They are Entrez utilities, the URL button on the Details screen, and manually constructed URLs. This document describes the manually constructed URLs.

The Entrez search and retrieval system was not designed for downloading large quantities of data.  However, if you represent an US-based organization, it is possible to lease MEDLINE data from NLM.  Please see Leasing Data from the National Library of Medicine for details.

You may generate a query on your web page and submit it to PubMed and the other Entrez databases providing that proper attribution is given to the US National Library of Medicine (NLM) and PubMed.  It must be clear to users that the search is actually being conducted at NLM.  When you link to PubMed, present PubMed in a separate browser window that partially overlays your page.  Users can then easily return to your page as well as go directly to PubMed.

NCBI's Disclaimer and Copyright notice must be evident to users of your service.  NLM does not hold the copyright on the abstracts found in PubMed, the journal publishers do. NLM provides no legal advice concerning distribution of copyrighted materials.  This advice should be sought from your legal counsel.

Begin a URL with the NCBI address, a search command, and database specification:

http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Command&db=Database&...

where Command is one of the following:

Search - searches using search terms or phrases with or without Boolean operators
Retrieve - retrieve results using unique identifiers (UIDs)
Link - search using UIDs, then links to and displays the related results of the retrieved items
Text - retrieve results in text format using unique identifiers (UIDs)

and Database is one of the following:

Genome
Nucleotide
OMIM
PopSet
Protein
PubMed
Structure

Search
Syntax: cmd=Search&db=Database&term=Term&doptcmdl=Format

Examples:
To search PubMed for citations about hay fever published in 1999:
cmd=Search&db=PubMed&term=hay+fever+AND+1999[Publication+Date]

See the PubMed Help to qualify search terms by PubMed field tags.

To search the Protein database for "AAC72193"[PACC] and display the results in GenPept format:
cmd=Search&db=Protein&term="AAC72193"[PACC]&doptcmdl=GenPept

To search Nucleotides for COMT sequences and display the brief format:
cmd=Search&db=Nucleotide&term=COMT&doptcmdl=Brief

See the Entrez Help to qualify search terms by Entrez field tags.

To search OMIM for the FBN1 gene and display the Text format:
cmd=Search&db=OMIM&term=fbn1[gene]&doptcmdl=Detailed

See the OMIM Help to qualify search terms by Entrez field tags.

Formats available by databases are listed below:
 
Database  Report Format
PubMed DocSum, Brief, Abstract, Citation, MEDLINE, SGML, ASN.1, ExternalLink
Nucleotide DocSum, Brief, GenBank, ASN.1, FASTA, ExternalLink
OMIM DocSum, Detailed, Synopsis, Variants,  MiniMIM, ASN.1, ExternalLink 
Protein DocSum, Brief, GenPept, ASN.1, FASTA, ExternalLink
Genome DocSum, Brief, ASN.1, ExternalLink
Structure DocSum, Brief
PopSet DocSum, Brief, ASN.1, FASTA, ExternalLink

See Help for PubMed format, Entrez format, and OMIM format descriptions.

To retrieve results from Boolean queries as text requires two steps.  You must first run your Boolean search to retrieve the UI numbers, then search by these UI numbers in the Entrez Utility PmFetch.  PmFetch provides direct access to the data and is the most efficient way to retrieve results for a many users .

Tool is a string with no internal spaces that identifies the resource which is using Entrez links (e.g. tool=IGM or tool=FlyBase). This argument is used to help NCBI provide better service to third parties generating Entrez queries from programs. As with any query system, it is sometimes possible to ask the same question different ways, with different effects on performance. NCBI requests that developers sending batch requests include the 'Tool' argument.

For example:
&tool=FlyBase
 

Examples using Boolean Queries:
To search for PubMed citations on (hay fever OR asthma) AND (diet therapy OR drug therapy):
cmd=search&db=PubMed&term=(hay+fever+OR+asthma)+AND+(diet+therapy+OR+drug+therapy)

To search for PubMed citations indexed with the MeSH terms Drosophila and Circadian Rhythm, and then display the first 50 citations in citation format:
cmd=search&term=Drosophila[mh]+AND+Circadian+Rhythm[mh]&db=PubMed&dispmax=50
&doptcmdl=citation

To search for Provider Links for citations in PubMed containing the text word p21:
cmd=search&db=PubMed&term=p21[tw]+AND+human[mh]&doptcmdl=externallink

Date Ranging

Not all dates are supported in all databases.  Date ranging can be specified in one of two ways:

Fixed Dates

Use these pmfilters to limit a search between two specific dates:

Example:
To search PubMed for citations on hay fever from 1995/02/05 to 1999/10/12 enter:
cmd=search&term=hay+fever&db=PubMed&orig_db=PubMed&filters=on&pmfilter_DateRange_Field=Publication+Date
&pmfilter_DateRange_MinYear=1995&pmfilter_DateRange_MinMonth=02&pmfilter_DateRange_MinDay=05
&pmfilter_DateRange_MaxYear=1999&pmfilter_DateRange_MaxMonth=10&pmfilter_DateRange_MaxDay=12

Relative Dates

Use these relative date filters to limit a search for citations whose dates fall between a number of days ago and today's date.

Example:
To search for PubMed citations on hay fever published within the last 90 days
cmd=search&term=hay+fever&db=PubMed&orig_db=PubMed&filters=on&pmfilter_EDatLimit=90+Days

Retrieve

Use Retrieve to search using unique identifiers (UIDs). UIDs include the PubMed identifier (PMID), MEDLINE identifier (UI), and the molecular biology database identifier (GI).  Accession numbers are not UIDs and cannot be retrieved via cmd=Retrieve. Use cmd=Search to search by accession number.

Syntax: cmd=Retrieve&db=Database&list_uids=ID&dopt=Format

Example:
To retrieve abstract format for PubMed UI 10480954:
cmd=Retrieve&db=PubMed&list_uids=10480954&dopt=Abstract

To display results as text, search by unique identifier using the Entrez utility PmFetch.

Link

Use Link to search using UIDs, UIDs include the PubMed identifier (PMID) and the molecular biology database identifier (GI), and then link to and display the related results of the retrieved items.

Syntax: cmd=Link&db=DatabaseTo&dbFrom=DatabaseFrom&from_uid=ID
DatabaseTo is the database to retrieve links.
DatabaseFrom is the database searched.

Examples:
To retrieve Related Article links from PubMed UI 10495220:
cmd=Link&db=PubMed&dbFrom=PubMed&from_uid=10495220

To retrieve Nucleotide links from PubMed UI 10492167:
cmd=Link&db=Nucleotide&dbFrom=PubMed&from_uid=10492167

To retrieve PubMed links from Nucleotide GI 4759059 and display the abstract:
cmd=Link&db=PubMed&dbFrom=Nucleotide&from_uid=4759059&dopt=Abstract

Text

Use Text to retrieve results in text format using unique identifiers (UIDs). UIDs include the PubMed identifier (PMID) and the molecular biology database identifier (GI).  Accession numbers are not UIDs and cannot be retrieved via cmd=Text.

Syntax: cmd=Text&db=Database&uid=ID&uid=ID&dopt=Format

Example:
To retrieve PubMed UIs 10480954, 10903209 in Text/Abstract format:
cmd=Text&db=PubMed&uid=10903209&uid=10480954&dopt=Abstract

To retrieve Protein sequence records in flat file format for GIs 9367031, 729567, 586553
cmd=Text&db=Protein&dopt=GenPept&dispmax=20&uid=9367031&uid=729567&uid=586553

Note:

  1. Many Web browsers cannot process spaces within a URL. Therefore, they must be "escaped" by converting them to '+' signs, e.g., Biochem Soc Trans should be entered as Biochem+Soc+Trans.
  2. In the molecular biology databases (i.e., Nucleotide, Protein, Genome, Structure, and PopSet) accession numbers are not unique identifiers. To search by accession number, use cmd=Search and &term=accession number[pacc].
  3. To change the default number of items (20) displayed use &dispmax=N
  4. When using cmd=Search, use &doptcmdl=Format rather than &dopt=Format which may be used with cmd=Retrieve, cmd=Link and cmd=Text.
  5. The search syntax is not case sensitive (except for Boolean operators) or order sensitive.
  6. When creating Boolean search queries using cmd=search&term=terms, you may use parentheses to nest search statements.
  7. For additional programs to construct Entrez URLs, see Entrez Utilities.
 
 Write to the Help Desk
NCBI | NLM | NIH
Department of Health & Human Services
Freedom of Information Act | Disclaimer