> ## Documentation Index
> Fetch the complete documentation index at: https://proto.evodesign.org/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# NCBI Entrez

> [NCBI Entrez](https://www.ncbi.nlm.nih.gov/search/) is the [National Center for Biotechnology Information](https://www.ncbi.nlm.nih.gov/)'s search and retrieval system over its biological sequence databases, accessed through the Entrez Programming Utilities (E-utilities). This toolkit wraps three E-utilities endpoints: `ncbi-esearch` (query term to matching record UIDs), `ncbi-esummary` (document-summary metadata for a UID or accession), and `ncbi-efetch` (full sequence records as parsed FASTA for the protein and nucleotide databases).

<div class="page-hero"><img class="page-hero-banner" src="https://proto-bio.github.io/proto-assets/images/tool/ncbi/hero.png" alt="NCBI Entrez" /><div class="tool-org-badges page-hero-badges"><a href="/docs/tools/organizations/ncbi" class="tool-org-badge tool-org-badge-light" style={{background: "#c0c0c0"}} title="NCBI"><img src="https://mintcdn.com/bio-pro/_UGa2jUMKeVPCbLk/assets/images/cached/6c0bd51170aa.png?fit=max&auto=format&n=_UGa2jUMKeVPCbLk&q=85&s=aece837308f5961d47623da652f395a2" alt="" class="tool-org-badge-logo" width="200" height="200" data-path="assets/images/cached/6c0bd51170aa.png" /> NCBI</a></div></div>

<Note>
  **License:** NCBI Entrez retrieves data from NCBI's Entrez databases, in the public domain (U.S. Government public domain). The client wrapper code is MIT-licensed. Please refer to [the data terms](https://www.ncbi.nlm.nih.gov/home/about/policies/) for full terms.
</Note>

<p class="entity-disclaimer">Proto is not affiliated with NCBI. This toolkit is open source and builds on the implementation produced by this organization. Product names, logos, and trademarks are the property of their respective owners.</p>

<hr class="entity-rule" />

<input type="radio" name="tab-ncbi" id="none-ncbi" class="tab-radio-input" />

<input type="radio" name="tab-ncbi" id="website-ncbi" class="tab-radio-input" defaultChecked />

<input type="radio" name="tab-ncbi" id="paper-ncbi" class="tab-radio-input" />

<input type="radio" name="tab-ncbi" id="cite-ncbi" class="tab-radio-input" />

<input type="radio" name="tab-ncbi" id="source-ncbi" class="tab-radio-input" />

<input type="radio" name="tab-ncbi" id="notebook-ncbi" class="tab-radio-input" />

<input type="radio" name="tab-ncbi" id="proto-ncbi" class="tab-radio-input" />

<div class="tool-tab-bar">
  <span class="tool-tab-wrap"><label for="website-ncbi" class="tool-tab tab-open badge-website"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10" /><path d="M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" /></svg> Website</label><label for="none-ncbi" class="tool-tab tab-close badge-website"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10" /><path d="M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" /></svg> Website</label></span> <span class="tool-tab-wrap"><label for="paper-ncbi" class="tool-tab tab-open badge-paper"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" /><polyline points="14 2 14 8 20 8" /><line x1="16" y1="13" x2="8" y2="13" /><line x1="16" y1="17" x2="8" y2="17" /><polyline points="10 9 9 9 8 9" /></svg> Publication</label><label for="none-ncbi" class="tool-tab tab-close badge-paper"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" /><polyline points="14 2 14 8 20 8" /><line x1="16" y1="13" x2="8" y2="13" /><line x1="16" y1="17" x2="8" y2="17" /><polyline points="10 9 9 9 8 9" /></svg> Publication</label></span> <span class="tool-tab-wrap"><label for="cite-ncbi" class="tool-tab tab-open badge-cite"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V20c0 1 0 1 1 1z" /><path d="M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3c0 1 0 1 1 1z" /></svg> Cite</label><label for="none-ncbi" class="tool-tab tab-close badge-cite"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V20c0 1 0 1 1 1z" /><path d="M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3c0 1 0 1 1 1z" /></svg> Cite</label></span> <span class="tool-tab-wrap"><label for="source-ncbi" class="tool-tab tab-open badge-source"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6" /><polyline points="8 6 2 12 8 18" /></svg> Tool Source</label><label for="none-ncbi" class="tool-tab tab-close badge-source"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6" /><polyline points="8 6 2 12 8 18" /></svg> Tool Source</label></span> <span class="tool-tab-wrap"><label for="notebook-ncbi" class="tool-tab tab-open badge-notebook"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z" /><path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z" /></svg> Open as Notebook</label><label for="none-ncbi" class="tool-tab tab-close badge-notebook"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z" /><path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z" /></svg> Open as Notebook</label></span> <span class="tool-tab-wrap"><label for="proto-ncbi" class="tool-tab tab-open badge-proto"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M13 2L3 14h9l-1 8 10-12h-9l1-8z" /></svg> Open on Proto</label><label for="none-ncbi" class="tool-tab tab-close badge-proto"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M13 2L3 14h9l-1 8 10-12h-9l1-8z" /></svg> Open on Proto</label></span>
</div>

<a href="https://www.ncbi.nlm.nih.gov/" target="_blank" class="tab-panel website-panel" data-tab="website-ncbi">
  <div class="website-info">
    <img src="https://www.google.com/s2/favicons?domain=ncbi.nlm.nih.gov&sz=32" class="website-favicon" width="24" height="24" />

    <span class="website-url">ncbi.nlm.nih.gov</span>
  </div>

  <span class="panel-goto-btn website-goto-btn"><span><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10" /><path d="M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" /></svg> Visit website</span></span>
</a>

<a href="https://doi.org/10.1093/nar/gkab1135" target="_blank" class="tab-panel paper-panel" data-tab="paper-ncbi">
  <div class="paper-info">
    <div class="paper-title">GenBank</div>
    <div class="paper-meta">Eric W Sayers, Mark Cavanaugh, ... Ilene Karsch-Mizrachi</div>
    <div class="paper-meta paper-venue">Nucleic Acids Research (2022)</div>
  </div>

  <span class="panel-goto-btn pub-goto-btn"><span><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" /><polyline points="14 2 14 8 20 8" /><line x1="16" y1="13" x2="8" y2="13" /><line x1="16" y1="17" x2="8" y2="17" /><polyline points="10 9 9 9 8 9" /></svg> Read paper</span></span>
</a>

<div class="tab-panel cite-panel" data-tab="cite-ncbi">
  <div class="cite-code-wrap">
    ```bibtex theme={null}
    @article{sayers2022genbank,
      title={GenBank},
      author={Sayers, Eric W and Cavanaugh, Mark and Clark, Karen and Pruitt, Kim D and Schoch, Conrad L and Sherry, Stephen T and Karsch-Mizrachi, Ilene},
      journal={Nucleic Acids Research},
      volume={50},
      number={D1},
      pages={D161--D164},
      year={2022},
      publisher={Oxford University Press},
      doi={10.1093/nar/gkab1135}
    }
    ```
  </div>

  <span class="panel-goto-btn cite-copy-btn"><span><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V20c0 1 0 1 1 1z" /><path d="M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3c0 1 0 1 1 1z" /></svg> Copy citation</span></span>
</div>

<a href="https://github.com/evo-design/proto-tools/tree/47e34afa5ea240a3b406e323dc38aa5dc85f223e/proto_tools/tools/database_retrieval/ncbi" target="_blank" class="tab-panel source-panel" data-tab="source-ncbi">
  <div class="source-info">
    <img src="https://github.com/evo-design.png?size=40" class="source-avatar" width="36" height="36" />

    <span class="source-path">evo-design/proto-tools<span class="source-subpath">/proto\_tools/tools/database\_retrieval/ncbi</span></span>
  </div>

  <span class="panel-goto-btn source-goto-btn"><span><svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor"><path d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z" /></svg> View source</span></span>
</a>

<a href="https://github.com/evo-design/proto-tools/blob/47e34afa5ea240a3b406e323dc38aa5dc85f223e/proto_tools/tools/database_retrieval/ncbi/examples/example.ipynb" target="_blank" class="tab-panel notebook-panel" data-tab="notebook-ncbi">
  <div class="notebook-info">
    <span class="notebook-icon">
      <svg width="40" height="40" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
        <path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z" />

        <path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z" />
      </svg>
    </span>

    <span class="notebook-label">Open Notebook</span>
  </div>

  <span class="panel-goto-btn notebook-goto-btn"><span><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z" /><path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z" /></svg> Open notebook</span></span>
</a>

<div class="tab-panel proto-panel" data-tab="proto-ncbi">
  <div class="proto-info">
    <div class="proto-cloud">
      <svg class="proto-cloud-bg" viewBox="0 0 640 512" xmlns="http://www.w3.org/2000/svg">
        <path d="M0 336c0 79.5 64.5 144 144 144H512c70.7 0 128-57.3 128-128c0-61.9-44-113.6-102.4-125.4c4.1-10.7 6.4-22.4 6.4-34.6c0-53-43-96-96-96c-19.7 0-38.1 6-53.3 16.2C367 64.2 315.3 32 256 32C167.6 32 96 103.6 96 192c0 2.7 .1 5.4 .2 8.1C40.2 219.8 0 273.2 0 336z" />
      </svg>

      <img noZoom src="https://mintcdn.com/bio-pro/KVh0EKV-IKblvXR8/assets/logo/evo-logo-light.svg?fit=max&auto=format&n=KVh0EKV-IKblvXR8&q=85&s=0cb66034ba45618505501aee6ea5f5c1" class="proto-panel-logo block dark:hidden" alt="Proto" width="198" height="151" data-path="assets/logo/evo-logo-light.svg" />

      <img noZoom src="https://mintcdn.com/bio-pro/KVh0EKV-IKblvXR8/assets/logo/evo-logo-dark.svg?fit=max&auto=format&n=KVh0EKV-IKblvXR8&q=85&s=2c9e23a14635e60384a434e220788f54" class="proto-panel-logo hidden dark:block" alt="Proto" width="198" height="151" data-path="assets/logo/evo-logo-dark.svg" />
    </div>
  </div>

  <div class="proto-actions">
    <a href="https://proto.evodesign.org/tools/ncbi-efetch" target="_blank" class="proto-action-btn"><span>NCBI Entrez EFetch</span><svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="7" y1="17" x2="17" y2="7" /><polyline points="7 7 17 7 17 17" /></svg></a>
    <a href="https://proto.evodesign.org/tools/ncbi-esearch" target="_blank" class="proto-action-btn"><span>NCBI Entrez ESearch</span><svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="7" y1="17" x2="17" y2="7" /><polyline points="7 7 17 7 17 17" /></svg></a>
    <a href="https://proto.evodesign.org/tools/ncbi-esummary" target="_blank" class="proto-action-btn"><span>NCBI Entrez ESummary</span><svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="7" y1="17" x2="17" y2="7" /><polyline points="7 7 17 7 17 17" /></svg></a>
  </div>
</div>

<div class="entity-contributors"><span class="entity-contributors-label">Toolkit contributors</span><span class="entity-contributors-people"><a class="entity-contributor" href="https://github.com/bviggiano" target="_blank" rel="noopener" title="bviggiano: 16 commits"><img noZoom class="entity-contributor-avatar" src="https://avatars.githubusercontent.com/u/21143637?v=4&s=64" alt="" loading="lazy" /><span class="entity-contributor-login">bviggiano</span></a><a class="entity-contributor" href="https://github.com/dguo8412" target="_blank" rel="noopener" title="dguo8412: 14 commits"><img noZoom class="entity-contributor-avatar" src="https://avatars.githubusercontent.com/u/46211285?v=4&s=64" alt="" loading="lazy" /><span class="entity-contributor-login">dguo8412</span></a><a class="entity-contributor" href="https://github.com/leba01" target="_blank" rel="noopener" title="leba01: 2 commits"><img noZoom class="entity-contributor-avatar" src="https://avatars.githubusercontent.com/u/124846286?v=4&s=64" alt="" loading="lazy" /><span class="entity-contributor-login">leba01</span></a></span></div>

| Function              | Description                                                                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| --------------------- | ------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `run_ncbi_efetch()`   | Fetch FASTA records from NCBI sequence dbs (protein/nuccore) by accession or ID | <a href="#api-run-ncbi-efetch" class="func-table-btn func-api-btn"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20" /></svg> Docs</a> <a href="https://github.com/evo-design/proto-tools/blob/47e34afa5ea240a3b406e323dc38aa5dc85f223e/proto_tools/tools/database_retrieval/ncbi/efetch.py#L172" target="_blank" class="func-table-btn func-source-btn"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6" /><polyline points="8 6 2 12 8 18" /></svg> Source</a>     |
| `run_ncbi_esearch()`  | Search NCBI Entrez databases by query term to find matching IDs                 | <a href="#api-run-ncbi-esearch" class="func-table-btn func-api-btn"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20" /></svg> Docs</a> <a href="https://github.com/evo-design/proto-tools/blob/47e34afa5ea240a3b406e323dc38aa5dc85f223e/proto_tools/tools/database_retrieval/ncbi/esearch.py#L189" target="_blank" class="func-table-btn func-source-btn"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6" /><polyline points="8 6 2 12 8 18" /></svg> Source</a>   |
| `run_ncbi_esummary()` | Retrieve record summary metadata from NCBI Entrez by ID                         | <a href="#api-run-ncbi-esummary" class="func-table-btn func-api-btn"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20" /></svg> Docs</a> <a href="https://github.com/evo-design/proto-tools/blob/47e34afa5ea240a3b406e323dc38aa5dc85f223e/proto_tools/tools/database_retrieval/ncbi/esummary.py#L152" target="_blank" class="func-table-btn func-source-btn"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6" /><polyline points="8 6 2 12 8 18" /></svg> Source</a> |

## Background

[NCBI Entrez](https://www.ncbi.nlm.nih.gov/search/) and its underlying sequence archive are described in the GenBank report ([Sayers et al., 2022](https://doi.org/10.1093/nar/gkab1135)), published in *Nucleic Acids Research*. The Entrez system and the [E-utilities](https://www.ncbi.nlm.nih.gov/books/NBK25501/) are operated by the [National Center for Biotechnology Information](https://www.ncbi.nlm.nih.gov/) (NCBI), part of the [U.S. National Library of Medicine](https://www.nlm.nih.gov/) (NLM). Entrez unifies search and retrieval across more than forty interconnected databases, including the protein, nucleotide, and gene databases used here, with records drawn from sources such as [RefSeq](https://www.ncbi.nlm.nih.gov/refseq/) and [GenBank](https://www.ncbi.nlm.nih.gov/genbank/).

Internally, each tool issues an HTTP GET to the E-utilities base endpoint `https://eutils.ncbi.nlm.nih.gov/entrez/eutils`. `ncbi-esearch` calls `esearch.fcgi` and returns the JSON `idlist`. `ncbi-esummary` calls `esummary.fcgi` and returns the JSON result map. `ncbi-efetch` calls `efetch.fcgi` with a FASTA `rettype` and parses the response into records. Every request carries a fixed `tool=` identifier. The `email=` and `api_key=` parameters are sent only when `ncbi_email` and `ncbi_api_key` are configured. The request URL surfaced on outputs is sanitized so the API key and email are stripped before it is returned. Records and their provenance come directly from NCBI's live E-utilities, so results reflect the database state at query time rather than a fixed release snapshot.

### Learning Resources

* [Entrez Programming Utilities Help](https://www.ncbi.nlm.nih.gov/books/NBK25501/) (NCBI) - the official E-utilities reference covering each endpoint, parameters, and response formats.
* [General usage guidelines and API key information](https://www.ncbi.nlm.nih.gov/books/NBK25497/) (NCBI) - the official guidance on rate limits, the `tool` and `email` parameters, and obtaining an API key.
* [Entrez Help](https://www.ncbi.nlm.nih.gov/books/NBK3837/) (NCBI) - introduction to Entrez databases, search field tags, and query syntax.

## Tools

<a name="api-run-ncbi-esearch" />

<div class="tool-section-card tool-section-card--search">
  ### NCBI Entrez ESearch (`ncbi-esearch`)

  Runs a query term against a chosen Entrez database and returns the list of matching record UIDs, with optional pagination, sort key, single-field restriction, and date filtering on a modification, publication, or Entrez date axis.

  #### API Reference

  <div class="api-model-section api-input-section">
    <a href="https://github.com/evo-design/proto-tools/blob/47e34afa5ea240a3b406e323dc38aa5dc85f223e/proto_tools/tools/database_retrieval/ncbi/esearch.py#L35" target="_blank" class="func-table-btn func-source-btn api-model-source"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6" /><polyline points="8 6 2 12 8 18" /></svg> Source</a>

    <Accordion title="Input: NCBIEsearchInput">
      <ParamField path="db" type="enum" required>
        NCBI database to query (e.g. 'protein', 'nuccore', 'gene', 'pubmed', 'taxonomy', 'structure').

        Available options: `protein`, `nuccore`, `nucleotide`, `gene`, `pubmed`, `pmc`, `taxonomy`, `structure`, `snp`, `clinvar`, `omim`, `biosample`, `bioproject`, `sra`, `assembly`, `ipg`, `mesh`, `genome`, `dbvar`, `gds`, `geoprofiles`, `medgen`, `proteinclusters`, `protfam`, `pccompound`, `pcsubstance`, `pcassay`
      </ParamField>

      <ParamField path="search_term" type="string" required>
        NCBI search query.
      </ParamField>

      <ParamField path="max_results" type="integer" default="20">
        Max IDs returned (NCBI `retmax`).
      </ParamField>

      <ParamField path="retstart" type="integer" default="0">
        0-indexed offset of the first hit (NCBI `retstart`).
      </ParamField>

      <ParamField path="sort" type="string">
        Sort key (db-dependent — e.g. 'relevance' / 'pub\_date' / 'most\_recent' on pubmed).
      </ParamField>

      <ParamField path="field" type="string">
        Restrict the search term to a single index field (db-dependent — e.g. 'title' / 'author' on pubmed).
      </ParamField>

      <ParamField path="datetype" type="string">
        Date axis for mindate/maxdate/reldate (modification / publication / Entrez).
      </ParamField>

      <ParamField path="mindate" type="string">
        Lower date bound, `YYYY/MM/DD` (also `YYYY/MM` and `YYYY`); requires datetype.
      </ParamField>

      <ParamField path="maxdate" type="string">
        Upper date bound; requires datetype.
      </ParamField>

      <ParamField path="reldate" type="integer">
        Restrict to records dated within the last N days; requires datetype.
      </ParamField>
    </Accordion>
  </div>

  <div class="api-model-section api-config-section">
    <a href="https://github.com/evo-design/proto-tools/blob/47e34afa5ea240a3b406e323dc38aa5dc85f223e/proto_tools/tools/database_retrieval/ncbi/esearch.py#L152" target="_blank" class="func-table-btn func-source-btn api-model-source"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6" /><polyline points="8 6 2 12 8 18" /></svg> Source</a>

    <Accordion title="Config: NCBIEsearchConfig">
      <ParamField path="verbose" type="integer" default="0">
        Verbosity level (0=quiet, 1=info, 2=debug, 3=raw subprocess stderr). `True` is coerced to `1` and `False` to `0`.
      </ParamField>

      <ParamField path="device" type="string" default="cpu">
        Device to run the tool on.
      </ParamField>

      <ParamField path="timeout" type="integer" default="3600">
        Maximum execution time in seconds. `None` waits indefinitely.
      </ParamField>

      <ParamField path="seed" type="integer">
        Random seed. When set, tools run reproducibly up to small GPU float noise (see `BaseToolOutput.approx_equal`), and the seed participates in cache keys. When None, cacheable seed-sensitive tools skip cache until seeded.
      </ParamField>

      <ParamField path="ncbi_api_key" type="string">
        Optional NCBI API key (lifts rate limit from 3 to 10 requests/second). Defaults to the `NCBI_API_KEY` environment variable; an explicit value passed to the config overrides the env var.
      </ParamField>

      <ParamField path="ncbi_email" type="string">
        Optional contact email. NCBI usage policy requires both `tool` and `email` for traceability. Defaults to the `NCBI_EMAIL` environment variable; an explicit value passed to the config overrides the env var.
      </ParamField>
    </Accordion>
  </div>

  <div class="api-model-section api-output-section">
    <a href="https://github.com/evo-design/proto-tools/blob/47e34afa5ea240a3b406e323dc38aa5dc85f223e/proto_tools/tools/database_retrieval/ncbi/esearch.py#L118" target="_blank" class="func-table-btn func-source-btn api-model-source"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6" /><polyline points="8 6 2 12 8 18" /></svg> Source</a>

    <Accordion title="Output: NCBIEsearchOutput">
      <ResponseField name="ids" type="List[string]">
        List of NCBI IDs matching the search query.
      </ResponseField>
    </Accordion>
  </div>

  #### Applications

  Use this as the entry point of an Entrez retrieval pipeline: resolve a gene symbol and organism to candidate protein or nucleotide UIDs, page through a large hit set with `retstart` and `max_results`, or restrict a literature query by date before downstream processing. The returned UIDs feed directly into [`ncbi-esummary`](https://bio-pro.mintlify.app/tools/database-retrieval/ncbi) for metadata screening and [`ncbi-efetch`](https://bio-pro.mintlify.app/tools/database-retrieval/ncbi) for sequence retrieval, and a resolved accession pairs naturally with the [UniProt](https://bio-pro.mintlify.app/tools/database-retrieval/uniprot) and [sequence-fetch](https://bio-pro.mintlify.app/tools/database-retrieval/sequence-fetch) tools.

  #### Usage Tips

  * **The returned IDs are Entrez UIDs, not always accessions.** Depending on the database they may be numeric GI numbers (GenInfo Identifiers). Resolve them through `ncbi-esummary` or `ncbi-efetch` to obtain accession-bearing records.
  * **Date bounds need a date axis.** Setting `mindate`, `maxdate`, or `reldate` without `datetype` is rejected, because NCBI silently ignores date filters that lack an axis.
  * **`sort` and `field` are database-specific.** A key valid on `pubmed` may be invalid on `protein`. Consult the Entrez help for the database being queried.

  <a name="api-run-ncbi-esummary" />
</div>

<div class="tool-section-card">
  ### NCBI Entrez ESummary (`ncbi-esummary`)

  Retrieves the document summary for a UID or accession from a chosen Entrez database and returns the summary as a database-specific mapping alongside the sanitized request URL.

  #### API Reference

  <div class="api-model-section api-input-section">
    <a href="https://github.com/evo-design/proto-tools/blob/47e34afa5ea240a3b406e323dc38aa5dc85f223e/proto_tools/tools/database_retrieval/ncbi/esummary.py#L35" target="_blank" class="func-table-btn func-source-btn api-model-source"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6" /><polyline points="8 6 2 12 8 18" /></svg> Source</a>

    <Accordion title="Input: NCBIEsummaryInput">
      <ParamField path="db" type="enum" required>
        NCBI database to query (e.g. 'protein', 'nuccore', 'gene', 'pubmed', 'taxonomy', 'structure'). See `NCBIDatabase` for the full set of supported databases.

        Available options: `protein`, `nuccore`, `nucleotide`, `gene`, `pubmed`, `pmc`, `taxonomy`, `structure`, `snp`, `clinvar`, `omim`, `biosample`, `bioproject`, `sra`, `assembly`, `ipg`, `mesh`, `genome`, `dbvar`, `gds`, `geoprofiles`, `medgen`, `proteinclusters`, `protfam`, `pccompound`, `pcsubstance`, `pcassay`
      </ParamField>

      <ParamField path="identifier" type="string" required>
        Accession or NCBI ID to summarize (e.g. 'NP\_000537.3', '7157').
      </ParamField>
    </Accordion>
  </div>

  <div class="api-model-section api-config-section">
    <a href="https://github.com/evo-design/proto-tools/blob/47e34afa5ea240a3b406e323dc38aa5dc85f223e/proto_tools/tools/database_retrieval/ncbi/esummary.py#L115" target="_blank" class="func-table-btn func-source-btn api-model-source"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6" /><polyline points="8 6 2 12 8 18" /></svg> Source</a>

    <Accordion title="Config: NCBIEsummaryConfig">
      <ParamField path="verbose" type="integer" default="0">
        Verbosity level (0=quiet, 1=info, 2=debug, 3=raw subprocess stderr). `True` is coerced to `1` and `False` to `0`.
      </ParamField>

      <ParamField path="device" type="string" default="cpu">
        Device to run the tool on.
      </ParamField>

      <ParamField path="timeout" type="integer" default="3600">
        Maximum execution time in seconds. `None` waits indefinitely.
      </ParamField>

      <ParamField path="seed" type="integer">
        Random seed. When set, tools run reproducibly up to small GPU float noise (see `BaseToolOutput.approx_equal`), and the seed participates in cache keys. When None, cacheable seed-sensitive tools skip cache until seeded.
      </ParamField>

      <ParamField path="ncbi_api_key" type="string">
        Optional NCBI API key (lifts rate limit from 3 to 10 requests/second). Defaults to the `NCBI_API_KEY` environment variable; an explicit value passed to the config overrides the env var.
      </ParamField>

      <ParamField path="ncbi_email" type="string">
        Optional contact email. NCBI usage policy requires both `tool` and `email` for traceability. Defaults to the `NCBI_EMAIL` environment variable; an explicit value passed to the config overrides the env var.
      </ParamField>
    </Accordion>
  </div>

  <div class="api-model-section api-output-section">
    <a href="https://github.com/evo-design/proto-tools/blob/47e34afa5ea240a3b406e323dc38aa5dc85f223e/proto_tools/tools/database_retrieval/ncbi/esummary.py#L56" target="_blank" class="func-table-btn func-source-btn api-model-source"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6" /><polyline points="8 6 2 12 8 18" /></svg> Source</a>

    <Accordion title="Output: NCBIEsummaryOutput">
      <ResponseField name="summary" type="Dict[string, any]">
        Record summary data returned by esummary.
      </ResponseField>

      <ResponseField name="source_url" type="string" required>
        Sanitized URL used for the request.
      </ResponseField>
    </Accordion>
  </div>

  #### Applications

  Use this to screen candidates cheaply before fetching full records: take the UIDs from [`ncbi-esearch`](https://bio-pro.mintlify.app/tools/database-retrieval/ncbi), inspect titles, lengths, or organism fields in the summary, and select the canonical record before paying the cost of a sequence download with [`ncbi-efetch`](https://bio-pro.mintlify.app/tools/database-retrieval/ncbi). A `gene`-database summary also bridges organism-level data to protein-centric records in the [UniProt](https://bio-pro.mintlify.app/tools/database-retrieval/uniprot) tool by resolving the canonical gene symbol.

  #### Usage Tips

  * **The summary shape depends on the database.** A `gene` summary nests fields under the UID key while `protein` and `nuccore` summaries expose record fields directly. Read the structure for the database queried rather than assuming a fixed schema.
  * **Multiple identifiers can be summarized in one call.** Passing a comma-joined list of UIDs returns one entry per UID, which is the efficient way to screen a full `ncbi-esearch` hit set.
  * **A missing record raises rather than returning empty.** An unresolved database-and-identifier pair raises an error, so guard identifiers that may be obsolete or suppressed.

  <a name="api-run-ncbi-efetch" />
</div>

<div class="tool-section-card tool-section-card--fetch">
  ### NCBI Entrez EFetch (`ncbi-efetch`)

  Fetches full sequence records by UID or accession from the protein, nuccore, or nucleotide databases, returning parsed FASTA records and the sanitized request URL, with optional subsequence and strand selection.

  #### API Reference

  <div class="api-model-section api-input-section">
    <a href="https://github.com/evo-design/proto-tools/blob/47e34afa5ea240a3b406e323dc38aa5dc85f223e/proto_tools/tools/database_retrieval/ncbi/efetch.py#L37" target="_blank" class="func-table-btn func-source-btn api-model-source"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6" /><polyline points="8 6 2 12 8 18" /></svg> Source</a>

    <Accordion title="Input: NCBIEfetchInput">
      <ParamField path="db" type="enum" required>
        Sequence database to query.

        Available options: `protein`, `nuccore`, `nucleotide`
      </ParamField>

      <ParamField path="identifier" type="string" required>
        Accession or NCBI ID to fetch (e.g. 'NP\_000537.3').
      </ParamField>

      <ParamField path="return_format" type="enum" default="fasta">
        NCBI rettype. 'fasta\_cds\_na' is nuccore-only.

        Available options: `fasta`, `fasta_cds_na`
      </ParamField>

      <ParamField path="seq_start" type="integer">
        Subsequence start (1-indexed, inclusive).
      </ParamField>

      <ParamField path="seq_stop" type="integer">
        Subsequence stop (1-indexed, inclusive).
      </ParamField>

      <ParamField path="strand" type="string">
        Strand for nucleotide retrieval.
      </ParamField>
    </Accordion>
  </div>

  <div class="api-model-section api-config-section">
    <a href="https://github.com/evo-design/proto-tools/blob/47e34afa5ea240a3b406e323dc38aa5dc85f223e/proto_tools/tools/database_retrieval/ncbi/efetch.py#L135" target="_blank" class="func-table-btn func-source-btn api-model-source"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6" /><polyline points="8 6 2 12 8 18" /></svg> Source</a>

    <Accordion title="Config: NCBIEfetchConfig">
      <ParamField path="verbose" type="integer" default="0">
        Verbosity level (0=quiet, 1=info, 2=debug, 3=raw subprocess stderr). `True` is coerced to `1` and `False` to `0`.
      </ParamField>

      <ParamField path="device" type="string" default="cpu">
        Device to run the tool on.
      </ParamField>

      <ParamField path="timeout" type="integer" default="3600">
        Maximum execution time in seconds. `None` waits indefinitely.
      </ParamField>

      <ParamField path="seed" type="integer">
        Random seed. When set, tools run reproducibly up to small GPU float noise (see `BaseToolOutput.approx_equal`), and the seed participates in cache keys. When None, cacheable seed-sensitive tools skip cache until seeded.
      </ParamField>

      <ParamField path="ncbi_api_key" type="string">
        Optional NCBI API key (lifts rate limit from 3 to 10 requests/second). Defaults to the `NCBI_API_KEY` environment variable; an explicit value passed to the config overrides the env var.
      </ParamField>

      <ParamField path="ncbi_email" type="string">
        Optional contact email. NCBI usage policy requires both `tool` and `email` for traceability. Defaults to the `NCBI_EMAIL` environment variable; an explicit value passed to the config overrides the env var.
      </ParamField>
    </Accordion>
  </div>

  <div class="api-model-section api-output-section">
    <a href="https://github.com/evo-design/proto-tools/blob/47e34afa5ea240a3b406e323dc38aa5dc85f223e/proto_tools/tools/database_retrieval/ncbi/efetch.py#L89" target="_blank" class="func-table-btn func-source-btn api-model-source"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6" /><polyline points="8 6 2 12 8 18" /></svg> Source</a>

    <Accordion title="Output: NCBIEfetchOutput">
      <ResponseField name="fasta_records" type="List[NCBIFastaRecord]">
        Parsed FASTA records from efetch.

        <Expandable title="NCBIFastaRecord">
          <ResponseField name="header" type="string" required>
            FASTA header line (without >).
          </ResponseField>

          <ResponseField name="sequence" type="string" required>
            Sequence string with whitespace stripped.
          </ResponseField>

          <ResponseField name="accession" type="string">
            Best-effort accession extracted from header.
          </ResponseField>
        </Expandable>
      </ResponseField>

      <ResponseField name="source_url" type="string" required>
        Sanitized URL used for the request.
      </ResponseField>
    </Accordion>
  </div>

  #### Applications

  Use this to pull reference sequences into a design or analysis pipeline: retrieve a wild-type protein before sequence design, fetch a coding DNA sequence with `return_format="fasta_cds_na"` for codon-usage analysis, or extract a defined genomic region for regulatory-element work. It is the final stage of the canonical Entrez chain, consuming UIDs produced by [`ncbi-esearch`](https://bio-pro.mintlify.app/tools/database-retrieval/ncbi) and screened with [`ncbi-esummary`](https://bio-pro.mintlify.app/tools/database-retrieval/ncbi), and complements the [UniProt](https://bio-pro.mintlify.app/tools/database-retrieval/uniprot) and [sequence-fetch](https://bio-pro.mintlify.app/tools/database-retrieval/sequence-fetch) tools for cross-source retrieval.

  #### Usage Tips

  * **Restricted to sequence databases.** Only `protein`, `nuccore`, and `nucleotide` return sequence bodies. Metadata databases require `ncbi-esummary` instead.
  * **`fasta_cds_na` requires a nucleotide database.** This return format extracts coding DNA and is rejected for `db="protein"`, since CDS extraction has no meaning on a protein record.
  * **Subsequence coordinates are 1-indexed and inclusive on both ends, to match biological residue selection conventions.** Position 1 is the first residue, and `seq_stop` is included in the returned span.
  * **Strand `"-"` returns the reverse complement.** Antisense retrieval applies to nucleotide databases. It returns the reverse complement of the requested region.
</div>

## Toolkit Notes

These apply to every NCBI tool in this toolkit (`ncbi-esearch`, `ncbi-esummary`, `ncbi-efetch`).

* **Requires network access.** The tools call the live NCBI E-utilities online.
* **An NCBI API key raises the rate limit.** Without credentials, NCBI E-utilities permits 3 requests per second per IP. Setting credentials raises this to 10 requests per second. A key is obtained at no cost from the Settings page of a free NCBI account ([https://www.ncbi.nlm.nih.gov/account/](https://www.ncbi.nlm.nih.gov/account/)). NCBI also asks that a contact email be set; it uses the email for abuse handling and IP-block recovery. Provide credentials either via the `ncbi_api_key` / `ncbi_email` config attributes or via the `NCBI_API_KEY` / `NCBI_EMAIL` environment variables; an explicit config value overrides the env var.

<Tip>
  **Example notebook:** See the [full working example](https://github.com/evo-design/proto-tools/blob/47e34afa5ea240a3b406e323dc38aa5dc85f223e/proto_tools/tools/database_retrieval/ncbi/examples/example.ipynb) for a copy-paste-ready walkthrough.
</Tip>

## Infrastructure Guides

The following guides cover how to run tools efficiently and at scale.

<CardGroup cols={2}>
  <Card title="Tool Persistence" icon="repeat" href="/docs/tools/guides/tool-persistence">Keep a tool's model warm across calls instead of reloading it every invocation.</Card>
  <Card title="Device Management" icon="cpu" href="/docs/tools/guides/device-management">How GPUs are allocated to tools and how to target specific devices.</Card>
  <Card title="Parallel Execution" icon="layers" href="/docs/tools/guides/parallel-execution">Fan a batch of inputs out across multiple GPUs.</Card>
</CardGroup>
