Using NCBI E-utilities

Using Entrez from Biopython

Step 1: import Entrez

from Bio import Entrez 

Step 2: enter your e-mail

The NCBI server might block anonymous requests, especially big ones! = "[email protected]"

Step 3: Call esearch to find IDs

handle = Entrez.esearch(db="value", term="keywords", retmax=100)

Parameters include:

parameter examples
db nucleotide
term human[Organism]
hemoglobin AND alpha
retmax 10 (identifiers returned)

Step 4: get a list of IDs out of esearch

records =
identifiers = records['IdList']

Step 5: use efetch to retrieve entries

We use the list of identifiers from step 4:

handle = Entrez.efetch(db="value", id=identifiers, retmax="200", 
         rettype="fasta", retmode="text")

To read data from text entries as a string:

text =

To read records from XML entries:

records =

In addition to the above, parameters include:

parameter examples
id single id
rettype fasta
retmode text


You find a full list of available options on

Example URLs

1. Searching for papers in PubMed,packing&rettype=uilist

2. Retrieving publication records in Medline format,11700088&retmode=text&rettype=medline

3. Searching for protein database entries by keywords

4. Retrieving protein database entries in FASTA format

5. Retrieving protein database entries in Genbank format

6. Retrieving nucleotide database entries

results matching ""

    No results matching ""