# PubMed Research Scraper (`leorochasantos/pubmed-research`) Actor

Search 37M+ PubMed biomedical articles through the NCBI E-utilities API. Supports boolean operators, field tags, and date filters; returns title, authors, journal, publication date, and DOI as clean typed JSON.

- **URL**: https://apify.com/leorochasantos/pubmed-research.md
- **Developed by:** [Leonardo Santos](https://apify.com/leorochasantos) (community)
- **Categories:** Developer tools, Automation, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.30 / 1,000 pubmed article results

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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 Research Scraper

Search 37M+ PubMed biomedical articles via the NCBI E-utilities API and get clean, typed JSON output. One chargeable row per article — pay only for what you receive.

### Why this actor?

- **Real PubMed data** — queries live against the NCBI E-utilities API, not a stale mirror.
- **Structured output** — flat typed JSON with title, authors, journal, pubdate, DOI, and article URL.
- **Full query syntax** — supports boolean operators, field tags (`[ti]`, `[au]`, `[mh]`), date range filters, and pagination.
- **Fair per-article pricing** — $0.002 per delivered article. Empty results and errors are free.
- **Agent-ready** — one row per article, no pagination nesting. Drop the JSON into any LLM or MCP pipeline.

### Input

```json
{
  "query": "cancer immunotherapy",
  "maxResults": 20,
  "start": 0,
  "dateFrom": "2024/01/01",
  "dateTo": "2026/12/31"
}
```

| Field | Type | Required | Default | Description |
|-------|------|----------|---------|-------------|
| `query` | string | yes | — | PubMed search query (supports boolean, field tags, phrases) |
| `maxResults` | integer | no | 20 | Maximum articles (1–200) |
| `start` | integer | no | 0 | Pagination offset |
| `dateFrom` | string | no | — | Filter from date (YYYY/MM/DD) |
| `dateTo` | string | no | — | Filter to date (YYYY/MM/DD) |

### Output

One item per article:

```json
{
  "input": "cancer immunotherapy",
  "pmid": "39999999",
  "title": "Advances in Cancer Immunotherapy",
  "authors": ["Smith J", "Doe K"],
  "journal": "Nat Med",
  "pubdate": "2025 Jan 15",
  "doi": "https://doi.org/10.1038/s41591-025-99999-9",
  "abstract": null,
  "articleUrl": "https://pubmed.ncbi.nlm.nih.gov/39999999/",
  "error": null,
  "scraped_at": "2026-08-03T12:00:00.000Z"
}
```

### Pricing

Pay per event, and **the platform usage is on us** — the price you see is the price you pay, with no compute bill on top.

| Event | Price | What one charge buys |
|---|---|---|
| PubMed article result | **$0.002** | Charged for each PubMed article returned by the search. Empty results are never charged. Errors and parse failures are free. |
| Actor Start | **$0.002** | One run, whatever it returns. |

Higher Apify subscription tiers pay less on every event (Silver −20%, Gold −35%).

### Use cases

- **Systematic reviews** — search PubMed with structured queries and export clean JSON for meta-analysis.
- **Competitive intelligence** — track publications by author, institution, or MeSH term across date ranges.
- **LLM RAG pipelines** — feed PubMed abstracts and metadata into retrieval-augmented generation workflows.
- **Bibliometric dashboards** — collect publication counts and metadata for research analytics.

### FAQ

**What query syntax does PubMed support?** The full NCBI PubMed query syntax: boolean operators (`AND`, `OR`, `NOT`), field tags (`cancer[ti]` for title search, `smith j[au]` for author), MeSH terms (`diabetes mellitus[mh]`), date ranges (`2024[dp]`), and phrase search with double-quotes.

**How many articles can I get per run?** Up to 200, in increments of 1. Use `start` for pagination across multiple runs.

**Is there a rate limit?** NCBI allows 3 requests/second without an API key. We pace at ~2.86 req/s (350ms between calls) to stay within limits.

**Are abstracts included?** Not by default (to keep the response fast and lightweight). Abstracts require an extra NCBI efetch call per article and will be added in a future version.

***

*This Actor is an independent tool built on the public NCBI E-utilities API. It is not affiliated with, endorsed by, or sponsored by the National Center for Biotechnology Information (NCBI), the U.S. National Library of Medicine (NLM), or the National Institutes of Health (NIH).*

# Actor input Schema

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

PubMed search query. Supports full PubMed query syntax including boolean operators (AND, OR, NOT), field tags (\[ti], \[au], \[dp], \[mh]), phrase search, and wildcards.

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

Maximum number of articles to return (1–200). This is a billing boundary — you are only charged for the articles actually delivered.

## `start` (type: `integer`):

Pagination offset — skip the first N results.

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

Filter articles published on or after this date (format: YYYY/MM/DD). Leave empty for no lower bound.

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

Filter articles published on or before this date (format: YYYY/MM/DD). Leave empty for no upper bound.

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

Proxy to use for outgoing requests. NCBI E-utilities is an open service; the default Apify datacenter proxy works.

## Actor input object example

```json
{
  "query": "cancer immunotherapy",
  "maxResults": 20,
  "start": 0,
  "dateFrom": "2023/01/01",
  "dateTo": "2026/12/31"
}
```

# 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": "cancer immunotherapy",
    "dateFrom": "2023/01/01",
    "dateTo": "2026/12/31"
};

// Run the Actor and wait for it to finish
const run = await client.actor("leorochasantos/pubmed-research").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": "cancer immunotherapy",
    "dateFrom": "2023/01/01",
    "dateTo": "2026/12/31",
}

# Run the Actor and wait for it to finish
run = client.actor("leorochasantos/pubmed-research").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": "cancer immunotherapy",
  "dateFrom": "2023/01/01",
  "dateTo": "2026/12/31"
}' |
apify call leorochasantos/pubmed-research --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,leorochasantos/pubmed-research"
        }
    }
}

```

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/eai5oTBbH45tC9VbP/builds/XSCktE7Tyov93mWZm/openapi.json
