# NCBI E-utilities Scraper (PubMed, Gene, Protein) (`ninhothedev/ncbi-eutils-scraper`) Actor

$0.5/1K 🔥 NCBI E-utilities! Search PubMed, genes & NCBI databases with full metadata. No key. JSON, CSV, Excel or API in seconds. Automate literature and genomics data mining ⚡

- **URL**: https://apify.com/ninhothedev/ncbi-eutils-scraper.md
- **Developed by:** [ninhothedev](https://apify.com/ninhothedev) (community)
- **Categories:** AI, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## NCBI E-utilities Scraper (PubMed, Gene, Protein, Nucleotide)

Search NCBI's **E-utilities** (Entrez) across **PubMed**, **Gene**, **Protein** and
**Nucleotide** and get clean, structured JSON in one run. The actor runs the standard
Entrez workflow for you — **esearch** (find matching UIDs) → **esummary** (fetch records) —
and maps every database's quirky per-record shape into flat, predictable fields.

No API key required. NCBI allows **3 requests/second** without a key and **10/second** with
a free key, which you can supply via the optional `apiKey` input.

> Cost: roughly **~$0.5 per 1,000 records** on typical runs (a search + summary pair per
> batch of 50 records). Public NCBI data, no proxies needed.

### Use cases

- **Literature mining** — pull thousands of PubMed articles (title, authors, journal, DOI) for a topic.
- **Biomedical NLP** — build corpora of titles and article metadata for training and entity extraction.
- **Gene research** — resolve gene symbols to organism, chromosome, map location and aliases.
- **Systematic reviews** — reproducible, query-driven exports of the exact article set behind a search.

### Modes (databases)

Pick one `mode` (the `db` driver). Each mode has its own db-specific output mapping:

| mode | What it searches | Key output fields |
|------|------------------|-------------------|
| `pubmed` | Biomedical articles | `pmid`, `title`, `authors`, `journal`, `doi`, `pub_date` |
| `gene` | NCBI Gene | `gene_id`, `symbol`, `organism`, `chromosome`, `map_location`, `aliases`, `summary` |
| `protein` | Protein sequences | `uid`, `accession`, `title`, `length`, `organism` |
| `nucleotide` | Nucleotide sequences | `uid`, `accession`, `title`, `length`, `organism` |

### Input

```json
{
    "mode": "pubmed",
    "queries": ["CRISPR gene editing", "BRCA1"],
    "apiKey": "",
    "maxItemsPerQuery": 50,
    "maxItems": 200
}
```

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `mode` | select | `pubmed` | Database / code path: `pubmed`, `gene`, `protein`, `nucleotide`. |
| `queries` | array | `["CRISPR gene editing","BRCA1"]` | Entrez search terms. Full Entrez syntax works, e.g. `BRCA1[gene] AND human[orgn]`. |
| `apiKey` | string | — | Optional NCBI key. Raises the rate limit from 3 → 10 requests/second. |
| `maxItemsPerQuery` | integer | 50 | Max records per query. |
| `maxItems` | integer | 200 (max 5000) | Total record cap across all queries. |

### Output examples

PubMed article:

```json
{
    "type": "pubmed_article",
    "pmid": "42574251",
    "title": "Mucolipidosis II: novel variants, clinical variation...",
    "authors": ["Eissa NR", "Wilson MP"],
    "author_count": 7,
    "journal": "Human molecular genetics",
    "pub_date": "2026-08-10",
    "pub_date_raw": "2026 Aug 10",
    "doi": "10.1093/hmg/ddag068",
    "pmc_ref_count": null,
    "url": "https://pubmed.ncbi.nlm.nih.gov/42574251/",
    "source_api": "ncbi-eutils"
}
```

Gene:

```json
{
    "type": "gene",
    "gene_id": "672",
    "symbol": "BRCA1",
    "organism": "Homo sapiens",
    "tax_id": 9606,
    "chromosome": "17",
    "map_location": "17q21.31",
    "aliases": ["BRCAI", "BRCC1", "BROVCA1", "PNCA4"],
    "url": "https://www.ncbi.nlm.nih.gov/gene/672",
    "source_api": "ncbi-eutils"
}
```

### Rate limits & the free API key

NCBI E-utilities usage policy:

- **Without a key:** up to **3 requests per second** per IP.
- **With a free key:** up to **10 requests per second**.

The actor paces itself automatically to stay under whichever limit applies, and on an
HTTP `429` it stops with a distinct error message telling you to slow down or add a key.
Get a free key from your NCBI account: **Settings → API Key Management**
(https://www.ncbi.nlm.nih.gov/account/). E-utilities also asks callers to identify
themselves with `tool` and `email` parameters — the actor sends these automatically.

### How this differs from our other research scrapers

This is our only **NCBI E-utilities / Entrez** actor. It is not a substitute for these:

- **[Semantic Scholar Scraper](https://apify.com/ninhothedev/semantic-scholar-scraper)** —
  cross-publisher academic graph (citations, references, influential-citation counts, TLDRs)
  across *all* fields of science. **NCBI E-utilities is PubMed/NIH-centric** (biomedicine +
  the linked Gene/Protein/Nucleotide sequence databases) and additionally returns *biological
  entities*, not just papers.
- **[Unpaywall Scraper](https://apify.com/ninhothedev/unpaywall-scraper)** — finds legal **open-access
  full-text PDFs** for a DOI. Use E-utilities to discover PubMed articles + their DOIs, then Unpaywall
  to fetch the OA copy. NCBI does not host third-party PDFs.
- **[UniProt Scraper](https://apify.com/ninhothedev/uniprot-scraper)** — curated **protein function /
  annotation** knowledgebase. NCBI's Protein db here is sequence-record centric (accession, length,
  organism), complementary to UniProt's functional annotation.
- **[Clinical Trials Scraper](https://apify.com/ninhothedev/clinical-trials-scraper)** — ClinicalTrials.gov
  study registry, a different corpus entirely.

Related actors: **[Semantic Scholar](https://apify.com/ninhothedev/semantic-scholar-scraper)** ·
**[Unpaywall](https://apify.com/ninhothedev/unpaywall-scraper)** ·
**[UniProt](https://apify.com/ninhothedev/uniprot-scraper)** ·
**[Clinical Trials](https://apify.com/ninhothedev/clinical-trials-scraper)**.

### Data source

All data comes from the public NCBI Entrez Programming Utilities
(https://eutils.ncbi.nlm.nih.gov/entrez/eutils). Please respect
[NCBI's usage policies](https://www.ncbi.nlm.nih.gov/books/NBK25497/).

# Actor input Schema

## `mode` (type: `string`):

Which NCBI database to search. This selects the code path and the db-specific output mapping: 'pubmed' (articles), 'gene', 'protein' or 'nucleotide'.

## `queries` (type: `array`):

One or more Entrez search terms. Each term runs esearch then esummary. Supports full Entrez syntax, e.g. 'BRCA1\[gene] AND human\[orgn]'.

## `apiKey` (type: `string`):

Optional NCBI E-utilities API key. Without a key NCBI allows 3 requests/second; with a key the limit rises to 10/second. Get a free key at https://www.ncbi.nlm.nih.gov/account/ (Settings -> API Key Management).

## `maxItemsPerQuery` (type: `integer`):

Maximum number of records fetched per individual query (esearch retmax).

## `maxItems` (type: `integer`):

Hard cap on the total number of records pushed to the dataset across all queries.

## Actor input object example

```json
{
  "mode": "pubmed",
  "queries": [
    "CRISPR gene editing",
    "BRCA1"
  ],
  "maxItemsPerQuery": 50,
  "maxItems": 200
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "queries": [
        "CRISPR gene editing",
        "BRCA1"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ninhothedev/ncbi-eutils-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "queries": [
        "CRISPR gene editing",
        "BRCA1",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("ninhothedev/ncbi-eutils-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "queries": [
    "CRISPR gene editing",
    "BRCA1"
  ]
}' |
apify call ninhothedev/ncbi-eutils-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ninhothedev/ncbi-eutils-scraper"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/ecocJUQQgoRzr9lv2/builds/hq05m5VoUgONMosMn/openapi.json
