# PubMed Search Scraper (`fetch_cat/pubmed-search-scraper`) Actor

Search PubMed and export public article metadata, abstracts, authors, journals, DOI, MeSH terms, and keywords.

- **URL**: https://apify.com/fetch\_cat/pubmed-search-scraper.md
- **Developed by:** [Hanna Nosova](https://apify.com/fetch_cat) (community)
- **Categories:** AI, Education, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.03 / 1,000 pubmed 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/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 Search Scraper

Search PubMed and export structured article metadata for literature monitoring, biomedical research, competitive intelligence, and medical AI workflows.

### What does PubMed Search Scraper do?

PubMed Search Scraper turns a PubMed query into a clean dataset of public biomedical literature records.

It can collect article titles, PMIDs, abstracts, authors, journals, publication dates, DOI values, article types, MeSH terms, keywords, language, source query, and PubMed URLs.

Use it when you need repeatable literature search exports without manually copying results from PubMed.

### Who is it for?

🧬 Biomedical researchers can monitor new publications for a disease, drug class, method, or intervention.

🏥 Healthcare analysts can build evidence datasets for market intelligence and clinical landscape reports.

💊 Pharma and biotech teams can track competitor research, biomarkers, indications, trial publications, and review articles.

📚 Librarians and research-support teams can automate recurring literature search exports for departments or patrons.

🤖 Medical AI teams can collect public article metadata for retrieval, evaluation, and knowledge-base workflows.

### Why use this PubMed scraper?

✅ Public PubMed data, ready as JSON, CSV, Excel, or API output.

✅ Search by keyword, author, journal, date range, and article type.

✅ Optional abstract and subject-term enrichment.

✅ Stable PubMed article URLs and PMID identifiers.

✅ Built for recurring searches and monitoring jobs.

### Input settings

| Setting | JSON key | Type / default | Description |
| --- | --- | --- | --- |
| Search query | `query` | string, default `"cancer immunotherapy"` | PubMed search query. You can use keywords, phrases, MeSH terms, PMID-like terms, or Boolean operators supported by PubMed. |
| Maximum articles | `maxItems` | integer, default `10` | Maximum number of PubMed articles to save to the dataset. |
| Resume from search result | `resumeFromIndex` | integer, default `0` | Optional absolute result offset from an interrupted-run checkpoint. Reuse the same query and filters. |
| Sort order | `sort` | string, default `"relevance"` | Order used by PubMed search. |
| Include abstracts and subject terms | `includeAbstracts` | boolean, default `true` | Fetch abstract text, article types, MeSH terms, keywords, and language for each article. Turn off for faster metadata-only runs. |
| Publication date range | `dateRange` | string, default `"any"` | Optional preset date filter. Choose Custom when using minimum or maximum dates below. |
| Minimum publication date | `minDate` | string | Optional minimum publication date for custom range. Accepted formats: YYYY, YYYY/MM, or YYYY/MM/DD. |
| Maximum publication date | `maxDate` | string | Optional maximum publication date for custom range. Accepted formats: YYYY, YYYY/MM, or YYYY/MM/DD. |
| Journal filter | `journal` | string | Optional journal name filter, for example The Lancet or Nature Medicine. |
| Author filter | `author` | string | Optional author name filter, for example Smith J. |
| Article type filter | `articleType` | string | Optional article type, for example Review, Clinical Trial, Meta-Analysis, Randomized Controlled Trial, or Case Reports. |

### Output fields

| JSON key | Label | Type | Description |
| --- | --- | --- | --- |
| `pmid` | Pmid | string | Output field for pmid. |
| `articleTitle` | ArticleTitle | string | Output field for articletitle. |
| `abstract` | Abstract | string / null | Output field for abstract. |
| `authors` | Authors | array | Output field for authors. |
| `journal` | Journal | string / null | Output field for journal. |
| `publicationDate` | PublicationDate | string / null | Output field for publicationdate. |
| `doi` | Doi | string / null | Output field for doi. |
| `articleTypes` | ArticleTypes | array | Output field for articletypes. |
| `meshTerms` | MeshTerms | array | Output field for meshterms. |
| `keywords` | Keywords | array | Output field for keywords. |
| `language` | Language | string / null | Output field for language. |
| `url` | Url | string | Output field for url. |
| `sourceQuery` | SourceQuery | string | Output field for sourcequery. |
| `scrapedAt` | ScrapedAt | string | Output field for scrapedat. |

### Pricing

This Actor uses Apify pay-per-event pricing. The prices below come from the current Actor pricing configuration. Apify public plans map to Store discount tiers, so the table shows both the user-facing plan context and the pricing tier name. The final price shown in Apify depends on the user account plan and any custom agreement.

| Event | What is charged | Price |
| --- | --- | ---: |
| `start` | One-time fee charged when a run starts. Covers fixed startup cost. | $0.005 |

| Event | What is charged | Free / no discount | Starter / Bronze | Scale / Silver | Business / Gold | Custom / Platinum | Custom / Diamond |
| --- | --- | ---: | ---: | ---: | ---: | ---: | ---: |
| `result` | Charged per PubMed article saved to the default dataset. Tiered floor used because Apify rejects sub-$0.00005 tiered pricing records. | $0.0575 / 1,000 | $0.05 / 1,000 | $0.039 / 1,000 | $0.03 / 1,000 | $0.02 / 1,000 | $0.014 / 1,000 |

Apify may also charge platform usage for compute, storage, proxies, or data transfer outside this Actor pricing. Check the Actor run and the Apify Pricing tab for the exact cost shown to your account.

### How to scrape PubMed articles

1. Open the actor on Apify.
2. Enter a PubMed query such as `cancer immunotherapy`.
3. Choose how many articles to collect.
4. Optionally add author, journal, publication date, or article type filters.
5. Keep `includeAbstracts` enabled if you need abstracts, MeSH terms, and keywords.
6. Run the actor.
7. Download the dataset as JSON, CSV, Excel, XML, or HTML table.

### Input options

#### `query`

Required. The PubMed search query.

Examples:

- `cancer immunotherapy`
- `machine learning radiology`
- `long covid treatment`
- `asthma children randomized trial`

#### `maxItems`

Maximum number of PubMed articles to save.

Use a small value for testing and a larger value for production monitoring.

#### `resumeFromIndex`

Optional. When an interrupted run leaves a `PENDING_WORK` record, copy its `nextIndex` here and rerun with the identical query and filters. PubMed search results can change over time, so resume as soon as practical.

#### `sort`

Choose relevance, publication date, most recent, first author, or journal ordering.

#### `dateRange`

Choose any time, last 1 year, last 5 years, last 10 years, or custom.

#### `minDate` and `maxDate`

Optional custom publication date bounds.

Accepted formats are `YYYY`, `YYYY/MM`, or `YYYY/MM/DD`.

#### `journal`

Optional journal filter.

Example: `Nature Medicine`.

#### `author`

Optional author filter.

Example: `Smith J`.

#### `articleType`

Optional publication type filter.

Examples: `Review`, `Clinical Trial`, `Meta-Analysis`, `Randomized Controlled Trial`, `Case Reports`.

#### `includeAbstracts`

When enabled, the actor includes abstracts, article types, MeSH terms, keywords, and language when available.

Turn it off for faster metadata-only exports.

### Input recipes

- **Small test**: Start with the default input and a low result limit.
- **Focused run**: Use one specific public URL, query, profile, or location before expanding the input.
- **Scheduled monitoring**: Save the input as a task and schedule repeat runs when you need fresh data.

### Example input

```json
{
  "query": "cancer immunotherapy",
  "maxItems": 25,
  "sort": "relevance",
  "dateRange": "5_years",
  "includeAbstracts": true
}
```

### Example output

```json
{
  "pmid": "42387269",
  "articleTitle": "Example PubMed article title",
  "abstract": "Abstract text when available.",
  "authors": ["Doe J", "Smith A"],
  "journal": "Journal Name",
  "publicationDate": "2026 Jul",
  "doi": "10.1000/example",
  "articleTypes": ["Journal Article"],
  "meshTerms": ["Neoplasms"],
  "keywords": ["immunotherapy"],
  "language": "eng",
  "url": "https://pubmed.ncbi.nlm.nih.gov/42387269/",
  "sourceQuery": "cancer immunotherapy",
  "scrapedAt": "2026-07-02T00:00:00.000Z"
}
```

### Tips for better PubMed searches

🔎 Start broad, then add filters after checking result volume.

📅 Use a date range for recurring monitoring jobs.

🧑‍🔬 Use the author filter when tracking a specific researcher.

📖 Use the journal filter for targeted journal surveillance.

🏷️ Use article type filters to focus on reviews, trials, meta-analyses, or case reports.

### Common use cases

- Weekly literature monitoring for disease areas.
- Competitive intelligence for pharma pipelines.
- Review article discovery for evidence summaries.
- Clinical trial publication tracking.
- Journal-specific monitoring.
- Author publication tracking.
- Dataset creation for medical NLP and retrieval workflows.
- DOI and PMID enrichment for internal bibliographies.

### Integrations

Use PubMed Search Scraper with Apify datasets, webhooks, API clients, scheduled tasks, and downstream automation tools.

Typical workflows include:

- Schedule a weekly PubMed query and send new results to a database.
- Export CSV files for analysts and librarians.
- Feed article metadata into a vector database or RAG pipeline.
- Trigger a webhook when new literature-monitoring results are ready.
- Combine PubMed metadata with your internal tagging or review workflow.

### API usage

Run PubMed Search Scraper from your own code with the Apify API.

**Node.js**

```js
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const input = {
  "query": "cancer immunotherapy",
  "maxItems": 10,
  "sort": "relevance",
  "includeAbstracts": true,
  "dateRange": "any"
};

const run = await client.actor('fetch_cat/pubmed-search-scraper').call(input);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

**Python**

```python
from apify_client import ApifyClient
import os

client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("fetch_cat/pubmed-search-scraper").call(run_input={
  "query": "cancer immunotherapy",
  "maxItems": 10,
  "sort": "relevance",
  "includeAbstracts": true,
  "dateRange": "any"
})
items = client.dataset(run["defaultDatasetId"]).list_items().items
print(items)
```

**cURL**

```bash
curl -X POST "https://api.apify.com/v2/acts/fetch_cat~pubmed-search-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"query":"cancer immunotherapy","maxItems":10,"sort":"relevance","includeAbstracts":true,"dateRange":"any"}'
```

### Use with AI agents via MCP

PubMed Search Scraper can be used by AI assistants through the hosted Apify MCP server.

**Claude Code setup**

```bash
claude mcp add --transport http apify "https://mcp.apify.com?tools=fetch_cat/pubmed-search-scraper"
```

**Claude Desktop, Cursor, or VS Code JSON config**

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=fetch_cat/pubmed-search-scraper"
    }
  }
}
```

**Example prompts**

- "Run PubMed Search Scraper with this input JSON and summarize the dataset."
- "Export the latest PubMed Search Scraper results to a table I can review."
- "Schedule this Actor for monitoring and tell me what changed between runs."

### Scheduling

Create an Apify schedule to run the same PubMed query daily, weekly, or monthly.

This is useful for literature alerts, competitor monitoring, or ongoing evidence reviews.

### Data freshness

PubMed is updated continuously by the source.

Each run searches the current public PubMed index and records a `scrapedAt` timestamp.

### Limits and reliability

The actor uses public PubMed records and conservative request pacing.

Very broad queries can have hundreds of thousands of matches, so set `maxItems` to the volume you actually need.

If an abstract, DOI, MeSH term, or keyword is missing, it usually means PubMed does not provide that field for the article.

### FAQ and troubleshooting

#### Why did I get fewer results than `maxItems`?

Your query and filters may have fewer matching PubMed records than requested.

Try removing restrictive filters or broadening the query.

#### Why is the abstract empty for some articles?

Not every PubMed record has an abstract available.

Some records are citations, editorials, corrections, or older articles without abstract text.

#### Why is DOI empty?

PubMed does not provide DOI values for every record.

Use the PMID and PubMed URL as stable identifiers when DOI is unavailable.

### Legality and responsible use

This actor extracts publicly available PubMed metadata.

You are responsible for using the data in compliance with PubMed, NCBI, Apify, and applicable laws and policies.

Do not use scraped data for unlawful, misleading, or privacy-invasive purposes.

### Related actors

- [arXiv Paper Search Scraper](https://apify.com/fetch_cat/arxiv-paper-search-scraper)
- [Reddit Scraper](https://apify.com/fetch_cat/reddit-scraper)
- [Web Page to Markdown Extractor](https://apify.com/fetch_cat/web-page-to-markdown-extractor)
- [Website Content Crawler Lite](https://apify.com/fetch_cat/website-content-crawler-lite)
- [YouTube Transcript Scraper](https://apify.com/fetch_cat/youtube-transcript-scraper)

### Changelog

#### 0.1

Initial version with PubMed search, metadata extraction, optional abstract enrichment, filters, and structured dataset output.

### Support

Report bugs, wrong output, blocked runs, or missing fields from the Actor page. Include the Apify run ID or run URL, your input JSON, what you expected, what the Actor returned, and one reproducible public URL so the issue can be tested quickly.

### Notes

PubMed terminology can be specialized.

For best results, test your query in PubMed first, then use the same query in this actor with a suitable `maxItems` value.

### Privacy and data handling

This Actor only requests the permissions needed to run the input you provide. It uses your input (such as URLs, search terms, identifiers, filters, and limits) only to fetch the requested public data from the relevant source site or API for this Actor, then writes results to your Apify dataset/key-value store.

Data may pass through Apify platform services and Apify Proxy during the run, and requests are sent only to the target site or public data provider required for this Actor's results. FetchCat does not send your inputs or outputs to advertising networks, data brokers, or model-training services, and does not retain run data outside Apify storage after the run except when you explicitly share run details for transient support debugging.

You are responsible for using this Actor lawfully, respecting the target site's terms, and avoiding unnecessary personal or sensitive data in inputs. Review the output before storing, sharing, or combining it with other data.

# Actor input Schema

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

PubMed search query. You can use keywords, phrases, MeSH terms, PMID-like terms, or Boolean operators supported by PubMed.

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

Maximum number of PubMed articles to save to the dataset.

## `resumeFromIndex` (type: `integer`):

Optional absolute PubMed result offset from the PENDING\_WORK checkpoint after an interrupted run. Keep the same query and filters when resuming.

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

Order used by PubMed search.

## `includeAbstracts` (type: `boolean`):

Fetch abstract text, article types, MeSH terms, keywords, and language for each article. Turn off for faster metadata-only runs.

## `dateRange` (type: `string`):

Optional preset date filter. Choose Custom only when you provide a minimum or maximum date below.

## `minDate` (type: `string`):

Minimum publication date for a custom range. Custom mode requires this field or Maximum publication date. Accepted formats: YYYY, YYYY/MM, or YYYY/MM/DD.

## `maxDate` (type: `string`):

Maximum publication date for a custom range. Custom mode requires this field or Minimum publication date. Accepted formats: YYYY, YYYY/MM, or YYYY/MM/DD.

## `journal` (type: `string`):

Optional journal name filter, for example The Lancet or Nature Medicine.

## `author` (type: `string`):

Optional author name filter, for example Smith J.

## `articleType` (type: `string`):

Optional article type, for example Review, Clinical Trial, Meta-Analysis, Randomized Controlled Trial, or Case Reports.

## Actor input object example

```json
{
  "query": "cancer immunotherapy",
  "maxItems": 10,
  "resumeFromIndex": 0,
  "sort": "relevance",
  "includeAbstracts": true,
  "dateRange": "any"
}
```

# Actor output Schema

## `overview` (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",
    "maxItems": 10,
    "sort": "relevance",
    "includeAbstracts": true,
    "dateRange": "any"
};

// Run the Actor and wait for it to finish
const run = await client.actor("fetch_cat/pubmed-search-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 = {
    "query": "cancer immunotherapy",
    "maxItems": 10,
    "sort": "relevance",
    "includeAbstracts": True,
    "dateRange": "any",
}

# Run the Actor and wait for it to finish
run = client.actor("fetch_cat/pubmed-search-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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",
  "maxItems": 10,
  "sort": "relevance",
  "includeAbstracts": true,
  "dateRange": "any"
}' |
apify call fetch_cat/pubmed-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=fetch_cat/pubmed-search-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/gL1js7kYVQD8UfmN4/builds/iQgCJDjEkLq4WGXWb/openapi.json
