# PubMed NCBI Scraper - Biomedical Articles & MeSH (No Key) (`themineworks/pubmed-ncbi-scraper`) Actor

Scrape 36M+ PubMed/NCBI biomedical articles: title, abstract, authors, journal, PMID, DOI, MeSH terms. No API key needed. Build literature reviews & AI training corpora. Works in Claude, ChatGPT & any MCP agent.

- **URL**: https://apify.com/themineworks/pubmed-ncbi-scraper.md
- **Developed by:** [The Mine Works](https://apify.com/themineworks) (community)
- **Categories:** Developer tools, MCP servers, Business
- **Stats:** 1 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 records

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 a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

## PubMed / NCBI — Biomedical Literature Search

Search the world's largest biomedical literature database from Apify. Access 36 million+ peer-reviewed articles from PubMed and MEDLINE — titles, abstracts, authors, journals, PMIDs, DOIs, and MeSH controlled vocabulary terms — without any API key. An optional free NCBI API key unlocks higher throughput.

### Why This Actor?

PubMed is the definitive source of record for biomedical and life sciences research, maintained by the National Library of Medicine (NLM) at NIH. With **36 million+ articles** spanning decades of research across medicine, pharmacology, genomics, neuroscience, oncology, and every other life science domain, it is the first stop for:

- **Pharma and biotech researchers** conducting competitive intelligence, target identification, or systematic literature reviews
- **AI and machine learning teams** building training corpora, biomedical NLP models, or question-answering systems that require structured scientific text
- **Systematic review authors** collecting all studies matching a clinical PICO question for meta-analysis
- **Biotech investors and analysts** tracking publication volume, author networks, and research momentum in a therapeutic area
- **Academic departments** monitoring publications from collaborating institutions or specific research groups

This actor wraps the official **NCBI E-utilities API** (esearch + efetch endpoints at `eutils.ncbi.nlm.nih.gov`) and delivers clean structured JSON — one article per dataset row — with full MeSH term arrays for downstream semantic analysis.

### PubMed Query Syntax

The actor supports PubMed's full advanced query language. Use field tags in brackets to target specific fields:

| Tag | Field | Example |
|---|---|---|
| `[ti]` | Article title | `CRISPR[ti]` |
| `[au]` | Author name | `Smith J[au]` |
| `[ta]` | Journal abbreviation | `Nature[ta]` |
| `[mh]` | MeSH heading | `Neoplasms[mh]` |
| `[dp]` | Publication date | `2023:2024[dp]` |
| `[pt]` | Publication type | `Review[pt]` |

Combine with boolean operators: `GLP-1 receptor agonist[ti] AND diabetes[mh] AND 2022:2024[dp]`

### Inputs

| Field | Type | Description | Default |
|---|---|---|---|
| `query` | string | PubMed search query with optional field tags | `GLP-1 receptor agonist diabetes` |
| `dateFrom` | string | Published from date (YYYY/MM/DD) | `2020/01/01` |
| `dateTo` | string | Published to date (YYYY/MM/DD) | — |
| `ncbiApiKey` | string | Optional free NCBI key (lifts rate limit 3x to 10 req/sec) | — |
| `maxResults` | integer | Maximum articles to return (1–10,000) | `100` |

### Output Format

Each article is stored as one item in the Apify dataset:

```json
{
  "pmid": "38234567",
  "title": "Efficacy of GLP-1 receptor agonists in type 2 diabetes: a systematic review",
  "abstract": "Background: GLP-1 receptor agonists have emerged as...",
  "authors": ["Smith Jane A", "Chen Robert B", "Patel Anita K"],
  "journal": "The Lancet Diabetes & Endocrinology",
  "issn": "2213-8587",
  "year": "2024",
  "doi": "10.1016/S2213-8587(24)00123-4",
  "mesh_terms": ["Glucagon-Like Peptide-1 Receptor", "Diabetes Mellitus, Type 2", "Hypoglycemic Agents"],
  "url": "https://pubmed.ncbi.nlm.nih.gov/38234567/",
  "scraped_at": "2024-11-15T09:22:11.000Z"
}
````

A summary record is appended at the end with total article count and run timestamp.

### MeSH Terms

Medical Subject Headings (MeSH) are NLM's controlled vocabulary for indexing biomedical literature. Every PubMed article is manually tagged with MeSH descriptors by NLM indexers. The `mesh_terms` array in each output record contains these structured tags, which are ideal for:

- Semantic clustering of articles by disease area
- Building ontology-aligned training data for biomedical NLP models
- Identifying related concepts the author did not use in the title or abstract

### Pricing

**First 25 results are free** on every Apify account — no charge until you exceed the free tier.

After the free tier: **$4 per 1,000 articles** (Pay-Per-Event billing). A 1,000-article run costs $4.00. A 10,000-article run costs $40.00. You are charged only for articles actually delivered.

### Frequently Asked Questions

**Q: Do I need an NCBI API key?**
No. The E-utilities API is freely accessible without authentication. However, without a key you are limited to 3 requests per second. A free NCBI API key (available at ncbi.nlm.nih.gov/account/settings/) increases this to 10 requests per second, making large runs significantly faster. Enter your key in the `ncbiApiKey` input field.

**Q: How current is the data?**
PubMed is updated daily with new articles, corrections, and MeSH annotations. Articles typically appear in PubMed within days to weeks of publication, depending on the journal's submission practices.

**Q: Can I retrieve full text?**
The actor retrieves titles, abstracts, and metadata. Full text is not available via the E-utilities API for most articles — full text access depends on publisher agreements. For open-access articles, the DOI in the output can be used to retrieve full text via PubMed Central (PMC) or the publisher.

**Q: What is the maximum number of articles I can retrieve?**
The actor supports up to 10,000 articles per run. For larger literature sets, use date range filters (`dateFrom`/`dateTo`) or narrower query terms to partition your retrieval across multiple runs.

**Q: Can I search by specific author or institution?**
Yes. Use the `[au]` tag for author names (e.g. `Smith JA[au]`) and the `[ad]` affiliation tag for institutions (e.g. `Harvard[ad]`). Multiple authors or institutions can be combined with OR: `(Smith JA[au] OR Chen RB[au])`.

**Q: How does the actor handle rate limits?**
The actor automatically respects NCBI's rate limits by inserting delays between requests — 340ms without an API key (staying safely under 3 req/sec) and 110ms with an API key. Automatic retry with exponential backoff handles transient 429 and 5xx errors.

**Q: Are preprints included in PubMed results?**
PubMed indexes peer-reviewed articles from MEDLINE-indexed journals. Preprints on bioRxiv/medRxiv are generally not indexed in PubMed. Use the arXiv or bioRxiv scrapers for preprint coverage.

### Use in Claude, ChatGPT & any MCP agent

This actor is also a **Model Context Protocol (MCP) server tool** — call it directly from Claude, ChatGPT, Cursor, Windsurf, or any MCP-compatible AI agent. The agent only pays for results delivered (same pay-per-result model).

- Per-actor MCP endpoint: `https://mcp.apify.com/?tools=themineworks/pubmed-ncbi-scraper`
- Full Mine Works MCP server (all tools): `https://the-mine-works-mcp.hatchable.site/api/mcp`

```js
// Call this actor as a tool via apify-client (Node)
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });
const run = await client.actor('themineworks/pubmed-ncbi-scraper').call({ /* input from the table above */ });
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

# Actor input Schema

## `query` (type: `string`):

PubMed search query. Supports field tags: \[ti] title, \[au] author, \[ta] journal, \[mh] MeSH. E.g. GLP-1 receptor agonist\[ti] AND diabetes\[mh]

## `dateFrom` (type: `string`):

Filter articles published from this date.

## `dateTo` (type: `string`):

Filter articles published up to this date.

## `ncbiApiKey` (type: `string`):

Free key from ncbi.nlm.nih.gov/account/settings/ lifts rate limit from 3 to 10 requests/sec.

## `maxResults` (type: `integer`):

Maximum articles to return.

## Actor input object example

```json
{
  "query": "GLP-1 receptor agonist diabetes",
  "dateFrom": "2020/01/01",
  "maxResults": 25
}
```

# 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 = {
    "query": "GLP-1 receptor agonist diabetes",
    "dateFrom": "2020/01/01",
    "maxResults": 25
};

// Run the Actor and wait for it to finish
const run = await client.actor("themineworks/pubmed-ncbi-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 = {
    "query": "GLP-1 receptor agonist diabetes",
    "dateFrom": "2020/01/01",
    "maxResults": 25,
}

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

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

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

```

## CLI example

```bash
echo '{
  "query": "GLP-1 receptor agonist diabetes",
  "dateFrom": "2020/01/01",
  "maxResults": 25
}' |
apify call themineworks/pubmed-ncbi-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=themineworks/pubmed-ncbi-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "PubMed NCBI Scraper - Biomedical Articles & MeSH (No Key)",
        "description": "Scrape 36M+ PubMed/NCBI biomedical articles: title, abstract, authors, journal, PMID, DOI, MeSH terms. No API key needed. Build literature reviews & AI training corpora. Works in Claude, ChatGPT & any MCP agent.",
        "version": "0.1",
        "x-build-id": "4UkQBhjuqFRzmY9I7"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/themineworks~pubmed-ncbi-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-themineworks-pubmed-ncbi-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/themineworks~pubmed-ncbi-scraper/runs": {
            "post": {
                "operationId": "runs-sync-themineworks-pubmed-ncbi-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/themineworks~pubmed-ncbi-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-themineworks-pubmed-ncbi-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "query": {
                        "title": "Search query",
                        "type": "string",
                        "description": "PubMed search query. Supports field tags: [ti] title, [au] author, [ta] journal, [mh] MeSH. E.g. GLP-1 receptor agonist[ti] AND diabetes[mh]"
                    },
                    "dateFrom": {
                        "title": "Published from (YYYY/MM/DD)",
                        "type": "string",
                        "description": "Filter articles published from this date."
                    },
                    "dateTo": {
                        "title": "Published to (YYYY/MM/DD)",
                        "type": "string",
                        "description": "Filter articles published up to this date."
                    },
                    "ncbiApiKey": {
                        "title": "NCBI API key (optional)",
                        "type": "string",
                        "description": "Free key from ncbi.nlm.nih.gov/account/settings/ lifts rate limit from 3 to 10 requests/sec."
                    },
                    "maxResults": {
                        "title": "Max articles",
                        "minimum": 1,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Maximum articles to return.",
                        "default": 100
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
