# PubMed Scraper — Articles, Abstracts, Authors, MeSH & DOI (`fabrikit/pubmed-scraper`) Actor

PubMed scraper: search PubMed by keyword (full query syntax, date range, best match or newest) or by PMID and get title, abstract, authors, affiliations, journal, publication date, DOI, PMCID, publication types, MeSH terms and keywords as JSON via NCBI E-utilities. From US$0.55 per 1,000 articles.

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

## Pricing

from $0.55 / 1,000 article scrapeds

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

PubMed Scraper extracts biomedical articles from pubmed.ncbi.nlm.nih.gov through NCBI's public E-utilities API: search by keyword (the full PubMed query syntax works) or look up PMIDs, and get the title, abstract, authors with affiliations, journal, dates, DOI, PMCID, publication types, MeSH terms and keywords as one flat JSON record per article. No browser, no login, no API key required.

### What you get

| Field | Example |
|---|---|
| `pmid`, `title`, `url` | 36319653, "Resting-state BOLD signal variability…", https://pubmed.ncbi.nlm.nih.gov/36319653/ |
| `abstract`, `hasAbstract` | Full abstract; structured abstracts keep their labels (`BACKGROUND: … METHODS: …`) |
| `authors[]`, `authorNames[]`, `firstAuthor`, `lastAuthor`, `authorCount` | Names as printed in the article, initials, ORCID when PubMed has it, per-author affiliations |
| `affiliations[]` | Distinct affiliation strings (e-mail addresses removed) |
| `journal`, `journalAbbrev`, `issn`, `eissn`, `journalCountry`, `nlmJournalId` | "Scientific reports", "Sci Rep", 2045-2322, England |
| `volume`, `issue`, `pages`, `citation` | 12, 1, 18425, "Sci Rep. 2022 Nov 01;12(1):18425. doi: 10.1038/…" |
| `publicationDate`, `publicationYear`, `epubDate`, `pubmedDate` | ISO dates, as precise as PubMed has them (`2022-11-01`, `2017-06`, `2019`) |
| `doi`, `doiUrl`, `pmcid`, `pmcUrl`, `pii` | 10.1038/s41598-022-21703-5, PMC9626555 (free full text) |
| `publicationTypes[]`, `isReview`, `language`, `publicationStatus`, `medlineStatus` | \["Journal Article", "Review"], true, eng, epublish, MEDLINE |
| `meshTerms[]`, `meshMajorTopics[]`, `keywords[]`, `chemicals[]`, `fundingAgencies[]`, `referenceCount` | MeSH indexing, author keywords, substances, grant agencies |
| `source`, `searchTerm`, `position` | Which search produced the record and its rank (Best Match or newest first) |

NCBI Bookshelf chapters indexed in PubMed (GeneReviews, StatPearls…) come back with the same keys plus `bookTitle`, `bookAccession` and `publisher` (`recordType: "book"`).

### Use cases

- **Literature monitoring**: run a saved query weekly with `dateFrom` and `sort: pub_date` to catch new papers on a drug, gene or disease.
- **Systematic reviews and meta-analyses**: pull thousands of records with abstracts and MeSH terms into a spreadsheet or a screening tool.
- **RAG and AI agents**: feed abstracts, keywords and DOIs to an LLM pipeline; every record carries a stable PMID and DOI for citations.
- **Bibliometrics**: journals, countries, publication types, funding agencies and author counts per topic and year.
- **Enrichment**: give it a list of PMIDs from a reference manager and get back clean metadata, PMCIDs and DOIs.

### Input

```json
{
    "searchTerms": ["crispr gene editing", "\"Diabetes Mellitus, Type 2\"[mesh] AND review[pt]"],
    "pmids": ["36319653", "https://pubmed.ncbi.nlm.nih.gov/31452104/"],
    "maxItems": 200,
    "sort": "pub_date",
    "dateFrom": "2024-01-01",
    "dateTo": "2024-12-31",
    "includeAbstract": true
}
```

- `searchTerms` accept anything the PubMed search box accepts: boolean operators, field tags (`[ti]`, `[au]`, `[mesh]`, `[pt]`, `[sb]`), phrases in quotes. PubMed pages at most 10,000 results per query; split big queries by date.
- `pmids` are fetched first, 200 per request, in the order given.
- `maxItems` is exact and global; an article found by several terms is saved and charged once.
- `sort`: `relevance` (PubMed Best Match, default) or `pub_date` (newest first).
- `dateFrom` / `dateTo` filter by publication date (`YYYY-MM-DD`, `YYYY-MM` or `YYYY`); either side may be left empty.
- `apiKey` (optional): your free NCBI key raises NCBI's limit from 3 to 10 requests per second. The key is only sent to eutils.ncbi.nlm.nih.gov.

### Output example

```json
{
    "pmid": 31452104,
    "title": "Molegro Virtual Docker for Docking.",
    "abstract": "Molegro Virtual Docker is a protein-ligand docking simulation program that allows us to carry out docking simulations in a fully integrated computational package. …",
    "hasAbstract": true,
    "authors": [
        { "fullName": "Gabriela Bitencourt-Ferreira", "lastName": "Bitencourt-Ferreira", "foreName": "Gabriela", "initials": "G", "collectiveName": null, "orcid": null, "affiliations": ["Escola de Ciências da Saúde, Pontifícia Universidade Católica do Rio Grande do Sul-PUCRS, Porto Alegre, RS, Brazil."] },
        { "fullName": "Walter Filgueira de Azevedo", "lastName": "de Azevedo", "foreName": "Walter Filgueira", "initials": "WF", "collectiveName": null, "orcid": null, "affiliations": ["Escola de Ciências da Saúde, Pontifícia Universidade Católica do Rio Grande do Sul-PUCRS, Porto Alegre, RS, Brazil."] }
    ],
    "authorNames": ["Gabriela Bitencourt-Ferreira", "Walter Filgueira de Azevedo"],
    "firstAuthor": "Gabriela Bitencourt-Ferreira",
    "lastAuthor": "Walter Filgueira de Azevedo",
    "authorCount": 2,
    "affiliations": ["Escola de Ciências da Saúde, Pontifícia Universidade Católica do Rio Grande do Sul-PUCRS, Porto Alegre, RS, Brazil."],
    "journal": "Methods in molecular biology (Clifton, N.J.)",
    "journalAbbrev": "Methods Mol Biol",
    "journalCountry": "United States",
    "nlmJournalId": "9214969",
    "issn": null,
    "eissn": "1940-6029",
    "volume": "2053",
    "issue": null,
    "pages": "149-167",
    "citation": "Methods Mol Biol. 2019;2053:149-167. doi: 10.1007/978-1-4939-9752-7_10.",
    "publicationDate": "2019",
    "publicationYear": 2019,
    "epubDate": null,
    "pubmedDate": "2019-08-28",
    "publicationStatus": "ppublish",
    "language": "eng",
    "publicationTypes": ["Journal Article", "Research Support, Non-U.S. Gov't"],
    "isReview": false,
    "meshTerms": ["Binding Sites", "Cyclin-Dependent Kinase 2", "Drug Design", "Humans", "Ligands", "Molecular Docking Simulation", "Molecular Dynamics Simulation", "Protein Binding", "Proteins", "Software", "User-Computer Interface"],
    "meshMajorTopics": ["Molecular Docking Simulation", "Molecular Dynamics Simulation", "Software"],
    "keywords": ["Cyclin-dependent kinase 2", "Drug design", "MolDock", "Molecular docking", "Molegro Virtual Docker", "Protein-ligand interactions"],
    "chemicals": ["Ligands", "Proteins", "Cyclin-Dependent Kinase 2"],
    "fundingAgencies": [],
    "referenceCount": 0,
    "doi": "10.1007/978-1-4939-9752-7_10",
    "pmcid": null,
    "pii": null,
    "medlineStatus": "MEDLINE",
    "recordType": "article",
    "bookTitle": null,
    "bookAccession": null,
    "publisher": null,
    "url": "https://pubmed.ncbi.nlm.nih.gov/31452104/",
    "doiUrl": "https://doi.org/10.1007/978-1-4939-9752-7_10",
    "pmcUrl": null,
    "source": "search",
    "searchTerm": "molecular docking software",
    "position": 1,
    "scrapedAt": "2026-10-20T07:30:12.345Z"
}
```

A `SUMMARY` record in the key-value store lists, per search term, how many results PubMed reported, how many were fetched and saved, PMIDs that were not found, request count and any query errors.

### Pricing

Pay per event: **US$0.55 per 1,000 articles** (`article-result`, US$0.00055 each), plus Apify platform usage, which is small because the Actor is plain HTTP without a browser or proxy.

| Run | Articles | Price |
|---|---|---|
| Default input (one term, 20 articles) | 20 | US$0.011 |
| One query, 1,000 articles | 1,000 | US$0.55 |
| Weekly alert on 5 queries, 200 new papers each | 1,000 | US$0.55 |
| Systematic review export | 10,000 | US$5.50 |

There is no start fee and nothing is charged for duplicates or for PMIDs that do not exist.

### How it compares

- **NCBI E-utilities directly**: free, but you have to handle paging, batching, the 3 requests/second limit, retries on NCBI's transient 500s and the PubMed XML (structured abstracts, MedlineDate, book records). This Actor does that and gives you flat JSON, a dataset you can export as CSV/Excel and an API endpoint.
- **PubMed website export**: capped and manual; no abstracts in CSV, no automation.
- **Other PubMed Actors**: most charge US$1–3 per 1,000 records or a per-run start fee, and several scrape the HTML instead of using the official API. This one is API-only, exact `maxItems`, no start fee.

It does not download full-text PDFs; use `pmcUrl` (PubMed Central) or `doiUrl` for that.

### Integrations

Run it on a schedule and send the dataset anywhere: Apify API (`/v2/datasets/{id}/items?format=csv`), webhooks, Google Sheets, Zapier, Make, n8n, Airbyte, or call it from LangChain / LlamaIndex / an MCP client as a tool for AI agents.

### FAQ

**Is this legal?** Yes. PubMed is a public database of the US National Library of Medicine and E-utilities is its documented API. The Actor identifies itself with the `tool` parameter, keeps under NCBI's rate limit and only carries bibliographic data (author names and affiliations as published; e-mail addresses are stripped).

**Do I need a proxy?** No. NCBI accepts direct connections; `proxyConfiguration` is off by default. Turn on Apify Proxy only if you see HTTP 429 in the log.

**Do I need an NCBI API key?** No. Without a key the Actor runs at 3 requests per second (about 500 articles per minute). A free key from My NCBI raises that to 10 per second.

**What are the limits?** PubMed returns at most 10,000 results per query; split by date range for more. One article found by several terms is saved once.

**How fresh is the data?** Live from NCBI at run time, including records "ahead of print".

### Changelog

- **0.1** (October 2026): first release. Search terms with full PubMed syntax, PMIDs / URLs, date range, Best Match or newest first, abstracts, authors with affiliations and ORCID, MeSH, keywords, grants, Bookshelf records, optional NCBI API key.

***

### En español

PubMed Scraper extrae artículos de PubMed a través de la API oficial E-utilities de NCBI: busca por palabras clave (con la sintaxis completa de PubMed) o por PMID y entrega título, resumen, autores con afiliaciones, revista, fechas ISO, DOI, PMCID, tipos de publicación, términos MeSH y palabras clave como JSON plano. Sin navegador, sin proxy y sin clave de API (opcional para ir a 10 peticiones por segundo). Precio: US$0,55 por cada 1.000 artículos, sin cargo por inicio.

# Actor input Schema

## `searchTerms` (type: `array`):

One PubMed search per entry. Plain keywords work (crispr gene editing) and so does the full PubMed query syntax: AND / OR / NOT, field tags such as diabetes\[ti], smith j\[au], "Neoplasms"\[mesh], review\[pt], humans\[mh], free full text\[sb]. The rank of each article in its search is saved as `position`. PubMed pages at most 10,000 results per query; use dateFrom / dateTo to split larger queries.

## `pmids` (type: `array`):

Specific articles to fetch: PubMed IDs (36319653, PMID: 36319653) or article URLs (https://pubmed.ncbi.nlm.nih.gov/36319653/). Fetched before the search terms, 200 per request.

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

Stop after this many articles in total (exact; an article found by several search terms is saved and charged once).

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

Order of the search results: PubMed's Best Match (relevance) or most recent publication date first.

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

Only articles published on or after this date: YYYY-MM-DD, YYYY-MM or YYYY (for example 2024-01-01). Applies to the search terms, not to PMIDs.

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

Only articles published on or before this date: YYYY-MM-DD, YYYY-MM or YYYY. Leave empty for no upper limit.

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

Save the full abstract text (structured abstracts keep their section labels: BACKGROUND, METHODS, RESULTS...). Turn off to keep records small; the same requests are made either way.

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

Your free NCBI API key (My NCBI > Account settings). Without it NCBI allows 3 requests per second per IP and the Actor spaces calls 0.4 s apart; with it the limit is 10 per second. Only sent to eutils.ncbi.nlm.nih.gov.

## `proxyConfiguration` (type: `object`):

Optional. NCBI E-utilities accept direct connections, so no proxy is used by default. Enable Apify Proxy (datacenter) only if a shared IP hits NCBI's rate limit (HTTP 429).

## Actor input object example

```json
{
  "searchTerms": [
    "crispr gene editing"
  ],
  "maxItems": 20,
  "sort": "relevance",
  "includeAbstract": true,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `articles` (type: `string`):

All PubMed articles collected during the run (one record per PMID)

# 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 = {
    "searchTerms": [
        "crispr gene editing"
    ],
    "maxItems": 20,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("fabrikit/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 = {
    "searchTerms": ["crispr gene editing"],
    "maxItems": 20,
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("fabrikit/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 '{
  "searchTerms": [
    "crispr gene editing"
  ],
  "maxItems": 20,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call fabrikit/pubmed-scraper --silent --output-dataset

```

## MCP server setup

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