# PubMed Scraper | Abstracts + MeSH, 11 Fields, No API 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:** Education, AI, MCP servers
- **Features:** Limited permissions
- **Stats:** 14 total users, 5 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.60 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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: Abstracts + MeSH, 11 Fields, No API Key

Pay only for results delivered. [Browse all Actors](https://apify.com/themineworks?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral).

💰 From $0.60 / 1,000 results.

Guide and FAQs: [PubMed Scraper on themineworks.com](https://themineworks.com/actors/pubmed-ncbi-scraper/). Tutorial: [PubMed Scraper: Search 36M Articles and MeSH Terms](https://themineworks.com/blog/pubmed-scraper-biomedical-literature-api-python/).

Search PubMed and get **11 fields per article**: PMID, title, full abstract, author list, journal, ISSN, publication year, DOI, **MeSH terms**, the PubMed link and a capture timestamp. Filter by any PubMed query syntax plus a date range, and pull up to **10,000 articles per run**.

Pure HTTP against NCBI's official E-utilities. **No API key required, no login, no browser**, and if you do have an NCBI key, supply it to run roughly three times faster.

### Why use this PubMed scraper

- **MeSH terms parsed out.** `mesh_terms` is the controlled-vocabulary index that makes biomedical literature searchable by concept rather than keyword. It is the field most PubMed exports lose.
- **Full abstracts, assembled correctly.** Structured abstracts arrive from NCBI as multiple labelled sections; this Actor joins them into one clean text field.
- **Native PubMed query syntax.** `query` is passed straight through, so field tags and boolean operators work exactly as they do on pubmed.ncbi.nlm.nih.gov.
- **Optional NCBI key for speed.** Without a key the Actor paces at roughly three requests per second; with one it paces at nine, which is NCBI's documented allowance.
- **An upstream outage is reported as an outage.** When NCBI's own backend fails it returns HTTP 200 with an error inside the body. This Actor surfaces that as an upstream problem instead of reporting "no results", those are not the same thing and only one is worth retrying.

### Search a topic with a date floor

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

Dates use PubMed's own `YYYY/MM/DD` format and are compiled into a `[dp]` date-of-publication filter.

### Use PubMed field tags for a precise search

```json
{
  "query": "semaglutide[Title/Abstract] AND cardiovascular[MeSH Terms]",
  "maxResults": 300
}
```

Anything that works in the PubMed search box works here: `[Title/Abstract]`, `[MeSH Terms]`, `[Author]`, `[Journal]` and boolean operators.

### Build a literature corpus for RAG

```json
{
  "query": "alzheimer disease biomarkers",
  "dateFrom": "2018/01/01",
  "maxResults": 5000
}
```

Title, full abstract, MeSH terms and DOI on every row is a complete chunk-and-embed input set, with a stable PMID as the citation key.

### Run a large pull with an NCBI key

```json
{
  "query": "CRISPR therapeutic",
  "dateFrom": "2015/01/01",
  "maxResults": 10000,
  "ncbiApiKey": "YOUR_NCBI_KEY"
}
```

An NCBI key is free from an NCBI account and raises the request rate from three to nine per second, which materially shortens a 10,000-article run.

### What data does the PubMed scraper return

```json
{
  "pmid": "37890123",
  "title": "Cardiovascular outcomes with GLP-1 receptor agonists: a meta-analysis",
  "abstract": "BACKGROUND: Glucagon-like peptide-1 receptor agonists... METHODS: We searched...",
  "authors": ["Jane A Doe", "John B Smith"],
  "journal": "The Lancet Diabetes & Endocrinology",
  "issn": "2213-8587",
  "year": "2023",
  "doi": "10.1016/S2213-8587(23)00123-4",
  "mesh_terms": ["Diabetes Mellitus, Type 2", "Glucagon-Like Peptide-1 Receptor", "Cardiovascular Diseases"],
  "url": "https://pubmed.ncbi.nlm.nih.gov/37890123/",
  "scraped_at": "2026-08-01T20:00:00.000Z"
}
```

| Field | Description |
| --- | --- |
| `pmid` | PubMed identifier |
| `title`, `abstract` | Article title and full abstract text |
| `authors[]` | Author names, forename plus surname |
| `journal`, `issn`, `year` | Publication venue and year |
| `doi` | DOI where the record carries one |
| `mesh_terms[]` | MeSH descriptor terms assigned by NLM indexers |
| `url`, `scraped_at` | PubMed link and capture timestamp |

Very recent articles are often not yet MeSH-indexed, so `mesh_terms` can be empty on new records. Some records carry no abstract or DOI at all; those fields come back empty rather than filled in.

### How the scraper works without an API key

NCBI's E-utilities are public. This Actor runs `esearch` to collect PMIDs for your query, then `efetch` in batches of 50 to pull the full XML records, and parses title, abstract sections, authors, journal, DOI and MeSH headings out of each. Requests are paced at roughly three per second without a key and nine per second with one, matching NCBI's published limits.

### What can you build with PubMed data

**Systematic reviews and meta-analyses.** A reproducible, dated corpus with abstracts and MeSH terms ready to screen.

**Biomedical RAG and AI training corpora.** Clean abstracts with a stable citation key and concept-level MeSH tags.

**Competitive and scientific monitoring.** A scheduled query on a molecule, mechanism or competitor's research output.

**Bibliometrics.** Publication volume by journal, year or topic, joinable to Crossref citation counts via DOI.

### How much does it cost to scrape PubMed

Pay per article delivered: **$0.001 on the Apify Free plan, $0.0006 on Gold and above**, plus a $0.005 start fee per run. Articles are the only rows charged: a query that matches nothing, and a run that stops because NCBI's backend is down, cost the start fee and nothing more.

### How do I use PubMed in Claude or ChatGPT

```
https://mcp.apify.com/?tools=themineworks/pubmed-ncbi-scraper
```

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

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });

const run = await client.actor('themineworks/pubmed-ncbi-scraper').call({
  query: 'GLP-1 receptor agonist diabetes',
  dateFrom: '2020/01/01',
  maxResults: 500,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

### PubMed scraper FAQ

**Do I need an NCBI API key?** No. It is optional and only raises the request rate from three to nine per second.

**What query syntax is supported?** All of PubMed's. Field tags and boolean operators are passed straight through to `esearch`.

**Why does an article have no MeSH terms?** NLM indexing lags publication, so recent articles are often not yet indexed.

**What date format do I use?** PubMed's own `YYYY/MM/DD`.

**Can I get full text?** No. PubMed publishes abstracts; the DOI on each row is your route to the publisher's full text.

### Complete your biomedical research pipeline

- **[Crossref Scraper](https://apify.com/themineworks/crossref-scholarly-metadata?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)**, citation counts for the same DOIs.
- **[OpenCitations Scraper](https://apify.com/themineworks/opencitations-citation-graph?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)**, the citation graph around any DOI.
- **[NIH RePORTER Grants Scraper](https://apify.com/themineworks/nih-reporter-grants?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)**, the funding behind the research.

Found a bug or want a field added? Open an issue on the Actor's Apify Console page.

### Related guides

- [PubMed Scraper: Search 36M Biomedical Articles, Abstracts, and MeSH Terms via API](https://themineworks.com/blog/pubmed-scraper-biomedical-literature-api-python)

*Last verified: 2026-08*

# 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, e.g. 2020/01/01.

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

Filter articles published up to this date, e.g. 2023/12/31.

## `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 number of articles to return, up to 10000. Higher values take longer and use more of your run's compute quota.

## Actor input object example

```json
{
  "query": "GLP-1 receptor agonist diabetes",
  "dateFrom": "2020/01/01",
  "dateTo": "2023/12/31",
  "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",
    "dateTo": "2023/12/31",
    "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",
    "dateTo": "2023/12/31",
    "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(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": "GLP-1 receptor agonist diabetes",
  "dateFrom": "2020/01/01",
  "dateTo": "2023/12/31",
  "maxResults": 25
}' |
apify call themineworks/pubmed-ncbi-scraper --silent --output-dataset

```

## MCP server setup

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