# PubMed Paper Scraper (`rainminer/pubmed-paper-scraper`) Actor

Search PubMed and export article records with authors, journal, publication dates, volume, issue, pages, DOI, PMC id and PubMed link. Query by keyword, author or journal, or fetch exact PubMed ids. No API key, no login.

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

## Pricing

from $0.74 / 1,000 articles

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 Paper Scraper

Search PubMed and get structured article records: authors, journal, publication
dates, volume, issue, pages, DOI, PMC id and a direct PubMed link. Query by
keyword, author, journal or publication year, or fetch exact PubMed ids.

PubMed runs on NCBI's E-utilities, which allow a limited request rate and return
two-step results. This Actor handles the search and the record lookup and writes
one dataset row per article.

### What you get

One row per PubMed record:

- `pmid` and `pubmedUrl`
- `title` and the ordered `authors` list
- `journal` and `journalAbbreviation`
- `pubDate` and `epubDate`
- `volume`, `issue`, `pages`
- `doi` and `pmcId` when the article has them
- `publicationTypes`, `languages`, `issn`, `recordStatus`
- `matchedQuery`, so a combined run stays traceable

A `SUMMARY` record reports the queries, record count, request count, and any
query that had a syntax error or returned nothing.

### Use cases

1. Track new publications in a field by date every morning.
2. Follow one author's output with `Smith J[au]`.
3. Collect a journal's recent articles with `Lancet[ta]`.
4. Build a citation table with DOIs for a reference manager.
5. Find PMC-deposited articles for full-text work.
6. Monitor a drug or gene name across the literature.
7. Restrict to a date range with `2025:2026[dp]`.
8. Fetch a known reading list by PubMed id.
9. Build a corpus of titles and abstracts for a literature review.
10. Audit publication types to separate reviews from original research.

### Input

| Field | Default | Meaning |
| --- | --- | --- |
| `searchQueries` | required unless ids given | PubMed query syntax |
| `pmids` | empty | Exact PubMed ids, or full PubMed URLs |
| `sort` | `date` | `date` for newest first, `relevance` for PubMed ranking |
| `maxResultsPerQuery` | `50` | Records kept per query, up to 5000 |

Query syntax worth knowing: `[au]` author, `[ta]` journal, `[dp]` publication
date, `[tiab]` title and abstract. `AND`, `OR`, `NOT` combine terms.

### How much it costs

| Event | Price | Charged when |
| --- | --- | --- |
| Article | $0.00099 per record | A record is written to the dataset |

A default run of 50 records costs about five cents. E-utilities are free to
read, so no proxy or platform usage is billed on top.

### Output example

```json
{
  "pmid": "43055753",
  "title": "Explainable machine learning-assisted exploration of chromatin dynamics ...",
  "authors": ["Redchuk T", "Pennanen AP"],
  "journal": "eLife",
  "journalAbbreviation": "Elife",
  "pubDate": "2026 Nov 19",
  "volume": "14",
  "doi": "10.7554/eLife.108797",
  "pubmedUrl": "https://pubmed.ncbi.nlm.nih.gov/43055753/"
}
```

### Limits worth knowing before you buy

- NCBI allows about three requests per second without an API key, so the Actor
  pauses between batches. Large runs are steady rather than instant.
- PubMed dates are strings as PubMed formats them, not normalised ISO dates.
  `2026 Nov 19` and `2026 Nov` both occur.
- Abstracts are not included. The record summary endpoint does not carry them,
  and the Actor does not pretend to have text it never fetched.
- A query with a syntax error is reported in `SUMMARY.failures` rather than
  being silently treated as zero results.
- Retracted articles are not flagged by the summary endpoint. Check the record
  page when that matters.

### Local development

```bash
yarn install
yarn test
yarn start
```

Tests run against recorded E-utilities responses from 2026-11-19 and need no
network access.

# Actor input Schema

## `searchQueries` (type: `array`):

PubMed query syntax. Examples: CRISPR, diabetes AND metformin, Smith J\[au], Lancet\[ta], 2025:2026\[dp].

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

Optional. Fetch these records by PubMed id, ignoring the queries. Accepts 43055753 or a full PubMed URL.

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

Newest first, or PubMed relevance.

## `maxResultsPerQuery` (type: `integer`):

How many records to keep for each query.

## Actor input object example

```json
{
  "searchQueries": [
    "CRISPR AND 2026[dp]"
  ],
  "sort": "date",
  "maxResultsPerQuery": 50
}
```

# Actor output Schema

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

No description

## `summary` (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 = {
    "searchQueries": [
        "CRISPR AND 2026[dp]"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("rainminer/pubmed-paper-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 = { "searchQueries": ["CRISPR AND 2026[dp]"] }

# Run the Actor and wait for it to finish
run = client.actor("rainminer/pubmed-paper-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 '{
  "searchQueries": [
    "CRISPR AND 2026[dp]"
  ]
}' |
apify call rainminer/pubmed-paper-scraper --silent --output-dataset

```

## MCP server setup

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