PubMed Search Scraper

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

Data fields

FieldTypeDescription
pmidstringValue exported as pmid.
articleTitlestringValue exported as articleTitle.
abstractstring | nullValue exported as abstract.
authorsarrayValue exported as authors.
journalstring | nullValue exported as journal.
publicationDatestring | nullValue exported as publicationDate.
doistring | nullValue exported as doi.
articleTypesarrayValue exported as articleTypes.

Input preview

querySearch query *
maxItemsMaximum articles
sortSort order
includeAbstractsInclude abstracts and subject terms
dateRangePublication date range
minDateMinimum publication date

API and agents

This actor can be run through Apify API, datasets, webhooks, schedules, and the official Apify MCP server.

How this actor works

See example inputs, outputs, API usage, and practical limits before running this actor on Apify.

Open Apify page

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.
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.

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.

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

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

Example output

{
  "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

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

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

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

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

Claude Desktop, Cursor, or VS Code JSON config

{
  "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.

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.

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.

Common questions

Questions and answers reused from the canonical actor README.

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.