# PubMed Scraper - Medical Research Articles, Abstracts & MeSH (`deanko/pubmed-scraper`) Actor

PubMed scraper and API: export articles by any PubMed query with abstracts, DOI, PMCID, authors, affiliations, MeSH terms and keywords to CSV, Excel or JSON. $1.50 per 1,000 articles.

- **URL**: https://apify.com/deanko/pubmed-scraper.md
- **Developed by:** [dean ko](https://apify.com/deanko) (community)
- **Categories:** Lead generation, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.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/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## PubMed Scraper: medical research articles, abstracts and MeSH terms

Export articles from **PubMed**, the US National Library of Medicine database of 38 million+ biomedical citations. Enter any PubMed search and get clean, flat rows ready for Excel, Google Sheets, BI tools, your database or an LLM/RAG pipeline. Each row has the **abstract, DOI, PMCID, journal, publication date, authors, affiliations, MeSH terms, keywords and publication types**.

Use it as a no-code **PubMed API**. It runs on the official NCBI E-utilities API, so you need no proxies and no browser, and it costs **$1.50 per 1,000 articles**.

### What does the PubMed Scraper do?

It turns a PubMed search into a dataset with **one row per article**. Each row includes:

- PMID, DOI, PMCID (when the article is in PubMed Central) and the PubMed link
- title, and the full abstract with its section labels (BACKGROUND, METHODS, RESULTS...)
- journal name, ISO journal abbreviation, publication date and year
- all authors, author count, the first author's affiliation and every unique affiliation
- MeSH terms, author keywords and publication types (Review, Randomized Controlled Trial, Meta-Analysis...)

#### Who is it for?

- **Pharma, biotech and medical affairs.** Monitor new publications on a drug, target or competitor. Find key opinion leaders (KOLs) and their institutions from author affiliations.
- **Researchers and librarians.** Build datasets for systematic reviews, bibliometrics and meta-research. Filter by publication type or MeSH term in your spreadsheet.
- **AI and data teams.** Feed abstracts into RAG pipelines, embeddings, classifiers or LLM summarizers. The rows are flat and already clean text.
- **Medtech sales and recruiters.** Find which hospitals and labs publish on a topic and who leads the work.
- **Monitoring and alerts.** Schedule a daily run with the date type set to Entrez date to get only the articles newly added to PubMed.

### Why use this PubMed scraper?

- **Low price.** $1.50 per 1,000 articles. You pay only for rows saved, and you can set a maximum charge per run.
- **Richer rows.** DOI, PMCID, labeled abstract sections, affiliations, MeSH terms, keywords and publication types in every row, not just title and authors.
- **Official API, not HTML scraping.** It runs on NCBI E-utilities, fetching 200 articles per request. It doesn't break when the website changes.
- **Full PubMed syntax.** Field tags (`[Title]`, `[MeSH Terms]`, `[Author]`, `[Journal]`, `[dp]`), Boolean operators and phrases all work exactly like on pubmed.ncbi.nlm.nih.gov.
- **Polite and reliable.** It stays within NCBI rate limits (3 requests per second, or 10 with your free API key) and retries on errors.
- **Fast and light.** The default 50-article run finishes in a few seconds on 256 MB of memory.

### How to scrape PubMed

1. Click **Try for free** (or **Start**) on this page.
2. Type a PubMed query, such as `semaglutide AND obesity`.
3. Optionally set a date range, a sort order and **Max articles** (this also caps your cost).
4. Click **Start** and wait a few seconds.
5. Download the results as **CSV, Excel, JSON, XML or HTML**, or read them via the API.

#### Input examples

Most recent randomized controlled trials on semaglutide published in 2025:

```json
{
  "query": "semaglutide AND randomized controlled trial[pt]",
  "minDate": "2025-01-01",
  "maxDate": "2025-12-31",
  "dateType": "pdat",
  "sort": "pub_date",
  "maxResults": 1000
}
```

Daily monitoring: everything added to PubMed yesterday that mentions CRISPR in the title, without abstracts:

```json
{
  "query": "CRISPR[Title]",
  "minDate": "2026-10-22",
  "maxDate": "2026-10-22",
  "dateType": "edat",
  "includeAbstract": false,
  "maxResults": 500
}
```

| Field | What it does | Example |
|---|---|---|
| `query` | PubMed search, with full PubMed syntax | `CRISPR gene therapy`, `Smith J[Author] AND cancer` |
| `minDate` / `maxDate` | Date range. Format `YYYY`, `YYYY-MM` or `YYYY-MM-DD` | `2024`, `2025-06-30` |
| `dateType` | `pdat` = publication date, `edat` = date added to PubMed | `edat` |
| `sort` | `relevance` (best match) or `pub_date` (most recent first) | `pub_date` |
| `maxResults` | Maximum articles to save (default 50, max 10,000) | `1000` |
| `includeAbstract` | Include the abstract text (default `true`) | `false` |
| `apiKey` | Optional free NCBI API key for faster large exports (stored as a secret) | |

### Output sample

```json
{
  "pmid": "40211735",
  "doi": "10.1097/CM9.0000000000003567",
  "pmcid": "PMC13186126",
  "title": "Epigenetically elevated RAD51AP1 regulates the RAD51-UAF1 complex contributing to temozolomide resistance in EGFRvIII glioblastoma.",
  "abstract": "BACKGROUND: Epidermal growth factor receptor variant III ( EGFRvIII ) mutation is the most prevalent genetic change in glioblastoma...\nMETHODS: We constructed a Clustered regularly interspaced shortpalindromic repeats (CRISPR)/CRISPR-associated (Cas) system 9 library...\nRESULTS: ...\nCONCLUSION: ...",
  "journal": "Chinese medical journal",
  "journalIsoAbbreviation": "Chin Med J (Engl)",
  "pubDate": "2026-05-20",
  "year": 2026,
  "authors": "Chang Y, Yang J, Li Z, Zhu X, Jiang T, Wang Q, Yu M, Han B, Liu X",
  "authorCount": 9,
  "firstAuthorAffiliation": "Beijing Neurosurgical Institute, Capital Medical University, Beijing 100070, China.",
  "affiliations": "Beijing Neurosurgical Institute, Capital Medical University, Beijing 100070, China.; Department of Neurosurgery, Beijing Tiantan Hospital, Capital Medical University, Beijing 100070, China.; Department of Neurosurgery, Tianjin Medical University General Hospital, Tianjin 300052, China.",
  "meshTerms": "Glioblastoma; Temozolomide; Humans; Rad51 Recombinase; ErbB Receptors; Cell Line, Tumor; Drug Resistance, Neoplasm; ...",
  "keywords": "Epidermal growth factor receptor variant III; Glioblastoma; Temozolomide resistance",
  "publicationTypes": "Journal Article",
  "url": "https://pubmed.ncbi.nlm.nih.gov/40211735/",
  "scrapedAt": "2026-10-23T08:12:41.120Z"
}
```

| Field | Type | Description |
|---|---|---|
| `pmid` | string | PubMed identifier |
| `doi` | string | Digital Object Identifier, when available |
| `pmcid` | string | PubMed Central ID, when the full text is in PMC (often open access) |
| `title` | string | Article title (inline formatting removed) |
| `abstract` | string | Abstract; structured sections are labeled and separated by line breaks |
| `journal`, `journalIsoAbbreviation` | string | Journal name and its ISO abbreviation |
| `pubDate`, `year` | string, number | Publication date (`YYYY`, `YYYY-MM` or `YYYY-MM-DD`; sometimes a range like `2019 Nov-Dec`) and year |
| `authors`, `authorCount` | string, number | Authors as `LastName Initials`, comma-separated, and their number |
| `firstAuthorAffiliation` | string | First author's first affiliation |
| `affiliations` | string | All unique affiliations, separated by `; ` |
| `meshTerms` | string | MeSH descriptors, separated by `; ` |
| `keywords` | string | Author keywords, separated by `; ` |
| `publicationTypes` | string | Publication types, separated by `; ` |
| `url` | string | Link to the PubMed page |
| `scrapedAt` | string | When the row was collected (ISO 8601) |

### How much does it cost to scrape PubMed?

This Actor uses **pay-per-event** pricing:

- **$0.0015 per article saved** ($1.50 per 1,000 articles)
- **$0.00005 per run start** (per GB of memory, a fraction of a cent)

**Worked example:** exporting 5,000 articles on a topic costs 5,000 × $0.0015 = **$7.50**, plus $0.00005 × 0.25 GB ≈ $0.00001 for the run start. The default 50-article run costs about **$0.08**, so the $5 of monthly free credit on the Apify Free plan covers over 3,000 articles.

Set **Max articles** or a maximum charge per run, and the Actor stops as soon as it reaches the limit.

### Integrations and API

Call the Actor from your own code with the official `apify-client`, or connect it to Make, Zapier, n8n, Google Sheets, Slack, webhooks and more from the **Integrations** tab.

**Python**

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("deanko/pubmed-scraper").call(run_input={
    "query": "long covid AND fatigue",
    "minDate": "2025",
    "sort": "pub_date",
    "maxResults": 500,
})
for article in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(article["pmid"], article["doi"], article["title"])
```

**JavaScript / Node.js**

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

const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client.actor('deanko/pubmed-scraper').call({
    query: 'Alzheimer disease[MeSH Terms] AND lecanemab',
    maxResults: 200,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.length, 'articles');
```

You can also run it with one HTTP request through the `run-sync-get-dataset-items` endpoint and get the rows back in the response.

### FAQ

**Where does the data come from?**
It comes from the official, public [NCBI E-utilities API](https://www.ncbi.nlm.nih.gov/books/NBK25501/) run by the US National Library of Medicine (NIH). The data is the same as on pubmed.ncbi.nlm.nih.gov.

**Do I need an NCBI API key?**
No. Without a key the Actor makes at most 3 requests per second, which is about 600 articles per second of fetching anyway. A free key (from your NCBI account settings) raises the limit to 10 requests per second and helps with very large exports. It is stored as a secret input.

**How many articles can I get from one search?**
Up to 10,000, which is a PubMed limit for any single search. For more, split your query into date ranges (for example one run per year) and run them one after another.

**Can I use the same search syntax as on the PubMed website?**
Yes. Copy the query from the PubMed search box, including field tags such as `[Title/Abstract]`, `[MeSH Terms]`, `[Author]`, `[Journal]` and `[pt]`. The run log shows how PubMed translated it.

**Why do some results fall outside my publication date range?**
PubMed's publication date covers both the print and the electronic date. An article published online in 2025 can carry a 2026 print issue date, and `pubDate` shows the journal issue date. Use `edat` to filter by the date the article was added to PubMed.

**Why is the abstract empty for some articles?**
Some records, such as letters, editorials, comments and older citations, have no abstract in PubMed.

**Do I get the full text?**
No, PubMed holds citations and abstracts. When `pmcid` is filled, the full text is available in PubMed Central.

### Limitations

- Only PubMed citations are returned. Book chapters (NCBI Bookshelf records) are skipped.
- Full text, references, grant numbers and author ORCIDs are not included.
- One search returns at most 10,000 articles (a PubMed limit).
- The data is only as fresh as PubMed. New citations usually appear within a day of publication.

### Legal and privacy

The data comes from the public PubMed database through the official NCBI E-utilities API. This Actor is not affiliated with or endorsed by the US National Library of Medicine, NCBI or NIH. Abstracts may be protected by publishers' copyright. You are responsible for using the data in line with the [NLM terms](https://www.ncbi.nlm.nih.gov/home/about/policies/) and the laws that apply to you.

### Support and feedback

Missing a field or filter you need, or found a bug? Open an issue in the **Issues** tab on this page. If the Actor saves you time, a short review helps other people find it.

# Actor input Schema

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

Anything you would type in the PubMed search box, including full PubMed syntax: field tags, Boolean operators and quotes. Examples: CRISPR gene therapy, semaglutide\[Title] AND obesity\[MeSH Terms], "Nature"\[Journal] AND 2025\[dp], Smith J\[Author].

## `minDate` (type: `string`):

Only articles on or after this date. Format YYYY, YYYY-MM or YYYY-MM-DD. Leave empty for no lower limit.

## `maxDate` (type: `string`):

Only articles on or before this date. Format YYYY, YYYY-MM or YYYY-MM-DD. Leave empty for up to today.

## `dateType` (type: `string`):

Which date the range applies to. Use Entrez date to monitor articles newly added to PubMed.

## `sort` (type: `string`):

Order of the results, same as on the PubMed website.

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

Maximum number of articles to save (PubMed allows up to 10,000 per search). You are charged per article saved, so this caps your cost (50 articles is about $0.08; 1,000 articles is about $1.50).

## `includeAbstract` (type: `boolean`):

Add the full abstract text, with section labels such as BACKGROUND and METHODS. Turn off for lighter rows.

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

Optional free NCBI API key. Raises the rate limit from 3 to 10 requests per second, which speeds up large exports. Get one in your NCBI account settings.

## Actor input object example

```json
{
  "query": "CRISPR gene therapy",
  "minDate": "",
  "maxDate": "",
  "dateType": "pdat",
  "sort": "relevance",
  "maxResults": 50,
  "includeAbstract": true
}
```

# 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": "CRISPR gene therapy",
    "minDate": "",
    "maxDate": "",
    "maxResults": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("deanko/pubmed-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": "CRISPR gene therapy",
    "minDate": "",
    "maxDate": "",
    "maxResults": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("deanko/pubmed-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 '{
  "query": "CRISPR gene therapy",
  "minDate": "",
  "maxDate": "",
  "maxResults": 50
}' |
apify call deanko/pubmed-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,deanko/pubmed-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/wgRSRFG5O73yvAhGP/builds/xvKhl9Il3Q3UdgmS6/openapi.json
