# PubMed Scraper — Articles, Abstracts, Authors & Emails (`jeffev/pubmed-scraper`) Actor

Search PubMed with full PubMed syntax, date range and publication type, or fetch PMIDs: title, abstract, journal, date, DOI, PMC link, authors with affiliations, corresponding author emails, ORCID, keywords and MeSH terms. Official NCBI API.

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

## Pricing

from $0.56 / 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 Scraper — Articles, Abstracts, Authors & Emails

Search **PubMed** with the full PubMed syntax, a publication date range and publication types (reviews, clinical trials, meta-analyses...), or fetch articles by PMID. For each article: title, **full abstract**, journal, volume, pages, publication and electronic dates, **DOI**, PMC link, **authors with affiliations, ORCID and the emails that appear in the affiliations**, keywords, MeSH terms and publication types. Uses the **official NCBI E-utilities API**.

Built for **literature reviews and research, pharma and medtech market intelligence, KOL (key opinion leader) and researcher outreach**, and AI / RAG datasets.

### Why this one

- **Author emails and affiliations** pulled from each article: find corresponding authors for outreach.
- **Full PubMed query syntax** and date / type filters.
- **Official API**: stable and fast (hundreds of articles in seconds). Add your free NCBI key for even faster runs.

### Input

Recent reviews on semaglutide and obesity, only with an author email:

```json
{
  "searchQueries": ["semaglutide obesity"],
  "publicationTypes": ["Review"],
  "dateFrom": "2025-01-01",
  "sortBy": "date",
  "onlyWithAuthorEmail": true,
  "maxArticlesPerSearch": 500
}
```

### Output

| Field | Description |
|---|---|
| `pmid`, `title`, `abstract`, `url`, `pmcUrl` | article |
| `journal`, `journalAbbreviation`, `volume`, `issue`, `pages` | publication |
| `publicationDate`, `electronicDate`, `doi`, `pmcId`, `language`, `publicationTypes` | metadata |
| `authors[]` | `name`, `affiliations`, `emails`, `orcid` |
| `authorEmails`, `firstAuthor`, `lastAuthor` | quick access |
| `keywords`, `meshTerms` | topics |

### Example output

One real item from a test run (long texts and lists shortened):

```json
{
  "type": "article",
  "pmid": "39762910",
  "title": "Medical therapy to treat obesity and optimize fertility in women of reproductive age: a narrative review.",
  "abstract": "BACKGROUND: Overweight and obesity-chronic illnesses in which an increase in body fat promotes adipose tissue dysfunction and abnormal fat mass resulting in ...",
  "journal": "Reproductive biology and endocrinology : RB&E",
  "journalAbbreviation": "Reprod Biol Endocrinol",
  "volume": "23",
  "issue": "1",
  "pages": "2",
  "publicationDate": "2025-01-06",
  "electronicDate": "2025-01-06",
  "doi": "10.1186/s12958-024-01339-y",
  "pmcId": "PMC11702155",
  "language": "eng",
  "publicationTypes": [
    "Journal Article",
    "Review"
  ],
  "keywords": [
    "GLP1-RAs",
    "Infertility",
    "Obesity"
  ],
  "meshTerms": [
    "Humans",
    "Female",
    "Obesity"
  ],
  "authors": [
    {
      "name": "Janelle Duah",
      "affiliations": [
        "Departments of Internal Medicine and Obstetrics, Gynecology and Reproductive Sciences, Yale School of Medicine, 330 Cedar St, New Haven, CT, 06510, USA. Jane..."
      ],
      "emails": [
        "janelle.duah@yale.edu"
      ],
      "orcid": null
    },
    {
      "name": "David B Seifer",
      "affiliations": [
        "Departments of Internal Medicine and Obstetrics, Gynecology and Reproductive Sciences, Yale School of Medicine, 330 Cedar St, New Haven, CT, 06510, USA."
      ],
      "emails": [],
      "orcid": null
    }
  ],
  "authorEmails": [
    "janelle.duah@yale.edu"
  ],
  "firstAuthor": "Janelle Duah",
  "lastAuthor": "David B Seifer",
  "url": "https://pubmed.ncbi.nlm.nih.gov/39762910/",
  "pmcUrl": "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC11702155/",
  "search": "semaglutide obesity"
}
```

### Notes

- PubMed returns up to 10,000 articles per search; split by date range for more.
- Emails appear only when the journal includes them in the affiliation (usually the corresponding author).

### Feedback

Found a problem or need a field? Open an issue in the **Issues** tab: every issue is read and answered. If the actor helped you, a review on the Store helps a lot.

### How much does it cost?

You pay only for results delivered, at a fixed price per item. **Apify platform usage is included** in that price, so there are no compute costs on top. Errors and items that couldn't be found are free.

| What you get | Price | Example |
|---|---|---|
| Article | $0.0008 each | 1,000 articles = $0.80 |

The Apify **Free plan includes $5 of monthly credit**, enough for about **6,250 articles** per month at no cost. You can also set a maximum spend per run.

On paid Apify plans it gets cheaper automatically: **10% off on Starter, 20% on Scale and 30% on Business**.

# Actor input Schema

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

PubMed search terms; full syntax works (e.g. 'GLP-1\[tiab] AND obesity', 'Smith J\[au]', 'Nature\[ta]').

## `maxArticlesPerSearch` (type: `integer`):

PubMed returns up to 10,000 articles per search; split by date range for more.

## `sortBy` (type: `string`):

Order of results.

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

YYYY-MM-DD or YYYY

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

YYYY-MM-DD or YYYY

## `publicationTypes` (type: `array`):

e.g. 'Review', 'Clinical Trial', 'Randomized Controlled Trial', 'Meta-Analysis', 'Systematic Review'.

## `onlyWithAuthorEmail` (type: `boolean`):

Keep only articles where an author email appears in the affiliations (useful for researcher outreach). Skipped articles are not charged.

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

PubMed IDs to fetch directly.

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

Your free NCBI API key raises the limit from 3 to 10 requests per second (faster for big runs).

## Actor input object example

```json
{
  "searchQueries": [
    "semaglutide obesity"
  ],
  "maxArticlesPerSearch": 50,
  "sortBy": "relevance",
  "onlyWithAuthorEmail": false
}
```

# Actor output Schema

## `results` (type: `string`):

PubMed articles.

# 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": [
        "semaglutide obesity"
    ],
    "maxArticlesPerSearch": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("jeffev/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 = {
    "searchQueries": ["semaglutide obesity"],
    "maxArticlesPerSearch": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("jeffev/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 '{
  "searchQueries": [
    "semaglutide obesity"
  ],
  "maxArticlesPerSearch": 50
}' |
apify call jeffev/pubmed-scraper --silent --output-dataset

```

## MCP server setup

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