Learn how esearch, efetch and esummary fit together, then experiment with a fully simulated API, generate Biopython / EDirect / cURL code, and walk through a query-to-FASTA case study. By Fiaraz Iqbal, Former Headteacher & Examiner.
Hover, focus or tap each stage to see what happens. Press “Animate flow” to watch a request travel.
The five core utilities, the rules of polite access, and three ways to call them.
Always send tool and email. NCBI uses them to contact you about a misbehaving script rather than blocking your IP. In Biopython: Entrez.email = "you@uni.ac.uk".
Without a key: 3 requests/second. With a free key from your NCBI account: 10 requests/second. Pass api_key= or set NCBI_API_KEY for EDirect.
Use usehistory=y in esearch to get WebEnv + query_key, then efetch in batches with retstart/retmax instead of posting thousands of IDs.
Bio.EntrezIdiomatic Python wrapper; parses XML into dicts and feeds SeqIO.
Unix pipes: esearch | efetch | xtract. Handles history and batching for you.
Plain HTTP GET with cURL or fetch() against eutils.ncbi.nlm.nih.gov.
Change any control: the URL and payload update instantly. All responses are self-contained mock data (accessions are illustrative), so nothing leaves your browser.
Mirrors the simulator settings above. Change them and the code regenerates.
Retrieve human BRCA1 RefSeq mRNAs. Run each step in order; the WebEnv token from step 2 is reused in step 3.
Press “Run step”.
Tick items off as you apply them in your own scripts.
Wait base × 2^attempt seconds (plus random jitter), capped. Adjust the sliders, or run a live demo of 15 simultaneous requests against a 3 req/s limit.
retmode="text" / rettype="fasta"For sequences, ask for plain FASTA and parse with SeqIO: no XML tree walking. Use XML only when you need structured fields such as features or citations.
rettype="fasta", retmode="text" for sequencesEntrez.read() only for XML responses; handle.read() for textefetch has no JSON for most databases; use esummary retmode=jsonretstart/retmaxWebEnv and query_key; they expire after roughly 8 hours of inactivity