# PubMed Scraper – Articles, Abstracts, Authors & Emails (`gazidev/pubmed-search`) Actor

Search PubMed with full query syntax or look up PMIDs: title, abstract, authors with affiliations, ORCID and emails, journal, DOI, PMC link, MeSH terms, keywords, grants. Only-new monitoring mode, beats the 9,999-result cap. Official NCBI API. $1 per 1,000 articles.

- **URL**: https://apify.com/gazidev/pubmed-search.md
- **Developed by:** [Cemal Atakli](https://apify.com/gazidev) (community)
- **Categories:** AI, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 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.

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 – Articles, Abstracts, Authors, Affiliations & Emails

Search **PubMed** (36+ million biomedical citations) and export clean rows: **title, abstract, authors with affiliations, ORCID and email addresses, journal, publication date, DOI, PMC free-full-text link, MeSH terms, keywords, publication type and grants**. Use full PubMed search syntax, or look up PMIDs in bulk. A **monitoring mode** returns only articles you have not received before, so a scheduled run becomes a literature alert.

- **Official NCBI E-utilities API.** No scraping of web pages, no browser, no login. An NCBI API key is optional (it only raises the speed limit).
- **Gets past the 9,999-result limit.** E-utilities stop at 9,999 records per search; this Actor continues year by year.
- **$1 per 1,000 articles.** Not-found PMIDs, duplicates and skipped rows are free. Start fee $0.00005.

### What can I use it for?

- **Literature reviews and meta-analyses:** export every article for a query with abstracts and MeSH terms to Excel, CSV or JSON.
- **Research lead lists / KOL mapping:** find the authors publishing on a topic, with affiliations and the emails they put in their papers.
- **Literature alerts:** schedule `onlyNew` daily or weekly per drug, disease, competitor or author.
- **AI/RAG datasets:** abstracts plus structured metadata, ready for embeddings.
- **Citation lists:** a ready-made `citation` string for each article.

### Input

```json
{
  "queries": ["semaglutide obesity", "Smith J[Author] AND 2025[dp]"],
  "maxResultsPerQuery": 100,
  "sort": "newest",
  "dateFrom": "2024",
  "onlyWithAbstract": true
}
```

| Field | What it does |
|---|---|
| `queries` | PubMed searches; field tags work: `[Author]`, `[Journal]`, `[MeSH]`, `[Affiliation]`, `[pt]`, `[dp]`, boolean AND/OR/NOT |
| `maxResultsPerQuery` | Articles per query (0 = all) |
| `sort` | Best match, newest, oldest, first author, journal |
| `dateFrom`, `dateTo` | Publication date range (YYYY, YYYY/MM or YYYY/MM/DD) |
| `onlyFreeFullText`, `onlyWithAbstract` | Filters |
| `pmids`, `bulkPmids` | Fetch specific PMIDs |
| `onlyNew` + `stateKey` | Monitoring: output only PMIDs not returned in earlier runs |
| `ncbiApiKey` | Optional free NCBI key (10 instead of 3 requests per second) |

### Output

```json
{
  "pmid": "42850698",
  "title": "Weight-Loss Outcomes After Sleeve Gastrectomy Versus Tirzepatide in a Minority Cohort With Severe Obesity...",
  "abstract": "While GLP-1 and GIP receptor agonists like semaglutide and tirzepatide have revolutionized ...",
  "authors": [{"name": "Emiliano G Manueli Laos", "orcid": null, "affiliations": ["..."], "emails": []}],
  "firstAuthor": "Emiliano G Manueli Laos",
  "lastAuthor": "...",
  "affiliations": ["..."],
  "emails": ["..."],
  "journal": "Clinical obesity",
  "journalAbbrev": "Clin Obes",
  "pubDate": "2026-12",
  "year": 2026,
  "doi": "10.1111/cob.70116",
  "pmcid": null,
  "isFreeFullText": false,
  "publicationTypes": ["Journal Article"],
  "meshTerms": ["Humans", "Tirzepatide", "Weight Loss", "..."],
  "keywords": ["..."],
  "grants": [],
  "citation": "Emiliano G Manueli Laos, ... Clin Obes. 2026;16(6):e70116. doi:10.1111/cob.70116. PMID: 42850698.",
  "pubmedUrl": "https://pubmed.ncbi.nlm.nih.gov/42850698/"
}
```

The **Articles** and **Authors & emails** tables in the Output tab show the main columns. In a test search about 4 in 10 recent articles carried at least one author email.

### Pricing

Pay per event: **$0.001 per article** ($1 per 1,000) + $0.00005 per run.

| Actor (Apify Store, Oct 2026) | Price per 1,000 articles |
|---|---|
| **PubMed Scraper (this Actor)** | **$1** |
| ryanclinton/pubmed-research-search | $2 |
| easyapi/pubmed-search-scraper | $3 + $0.09 per run |
| scrapestorm/pubmed-articles-scraper | $10 |

### FAQ

**Is this allowed?** The Actor uses NCBI's public E-utilities API and follows NCBI's usage policy (tool and email identification, at most 3 requests per second without a key). PubMed citations are public, but some abstracts are copyrighted by their publishers. You are responsible for how you reuse the text.

**Why are some emails missing?** PubMed only has the emails authors put in their affiliation line, usually the corresponding author.

**How does `onlyNew` work?** The PMIDs returned are stored in the named key-value store `pubmed-search-state` under your `stateKey`. Later runs skip them (free), so you only pay for articles you have not seen.

**Can I get full text?** Free full text is on PubMed Central; use `pmcUrl` or filter with `onlyFreeFullText`.

### Use with AI agents / Apify MCP

Add the Actor to the Apify MCP server (`mcp.apify.com`) and ask: *"find 2025 randomized trials on GLP-1 and alcohol use, with abstracts"*. Rows are flat JSON that an LLM can summarize directly.

### Related Actors

- [PDF Text Extractor](https://apify.com/gazidev/pdf-text-extractor) – text from PDF papers.
- [Website to Markdown](https://apify.com/gazidev/website-to-markdown) – clean Markdown for RAG.

# Actor input Schema

## `queries` (type: `array`):

One PubMed search per line. Full PubMed syntax works: "semaglutide obesity", "Smith J\[Author]", "Nature\[Journal] AND 2025\[dp]", "cancer\[MeSH] AND review\[pt]", "Harvard\[Affiliation]".

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

0 = all results (PubMed allows 9,999 per search; with year-splitting on, more).

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

Order of results (same options as pubmed.ncbi.nlm.nih.gov).

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

Optional publication date filter: YYYY, YYYY/MM or YYYY/MM/DD.

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

Optional: YYYY, YYYY/MM or YYYY/MM/DD.

## `onlyFreeFullText` (type: `boolean`):

Adds the PubMed 'free full text' filter.

## `onlyWithAbstract` (type: `boolean`):

Articles without an abstract are skipped and not charged.

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

PubMed IDs to fetch directly, e.g. 41000000. Not-found PMIDs are free.

## `bulkPmids` (type: `string`):

PMIDs separated by new lines, commas or spaces.

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

Structured abstracts keep their section labels (BACKGROUND: ..., METHODS: ...).

## `onlyNew` (type: `boolean`):

Remembers PMIDs already returned (named key-value store 'pubmed-search-state') and outputs only new ones. Schedule the Actor daily or weekly for literature alerts.

## `stateKey` (type: `string`):

Use different names to keep separate 'already seen' lists for different monitors.

## `autoSplitByYear` (type: `boolean`):

When a search has more than 9,999 results and you want more, continue year by year.

## `ncbiApiKey` (type: `string`):

Optional free key from your NCBI account: raises the rate limit from 3 to 10 requests per second. Not required.

## Actor input object example

```json
{
  "queries": [
    "CRISPR base editing"
  ],
  "maxResultsPerQuery": 100,
  "sort": "relevance",
  "onlyFreeFullText": false,
  "onlyWithAbstract": false,
  "includeAbstract": true,
  "onlyNew": false,
  "stateKey": "default",
  "autoSplitByYear": true
}
```

# Actor output Schema

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

No description

## `authors` (type: `string`):

No description

## `results` (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 = {
    "queries": [
        "CRISPR base editing"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("gazidev/pubmed-search").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 = { "queries": ["CRISPR base editing"] }

# Run the Actor and wait for it to finish
run = client.actor("gazidev/pubmed-search").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 '{
  "queries": [
    "CRISPR base editing"
  ]
}' |
apify call gazidev/pubmed-search --silent --output-dataset

```

## MCP server setup

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

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/Lhbkf0blauPC3bNEr/builds/UQW7VjsBa9agT9jfN/openapi.json
