pubmed-search

Search PubMed/MEDLINE for biomedical literature via NCBI E-utilities API. Use when: (1) searching medical/biomedical papers, (2) finding clinical studies, (3) querying with MeSH terms, (4) retrieving abstracts by PMID. NOT for: non-biomedical papers (use arxiv-search or semantic-scholar), full-text access (PubMed provides abstracts), or social science literature.

564 stars

Best use case

pubmed-search is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Search PubMed/MEDLINE for biomedical literature via NCBI E-utilities API. Use when: (1) searching medical/biomedical papers, (2) finding clinical studies, (3) querying with MeSH terms, (4) retrieving abstracts by PMID. NOT for: non-biomedical papers (use arxiv-search or semantic-scholar), full-text access (PubMed provides abstracts), or social science literature.

Teams using pubmed-search should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/pubmed-search/SKILL.md --create-dirs "https://raw.githubusercontent.com/beita6969/ScienceClaw/main/skills/pubmed-search/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/pubmed-search/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How pubmed-search Compares

Feature / Agentpubmed-searchStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Search PubMed/MEDLINE for biomedical literature via NCBI E-utilities API. Use when: (1) searching medical/biomedical papers, (2) finding clinical studies, (3) querying with MeSH terms, (4) retrieving abstracts by PMID. NOT for: non-biomedical papers (use arxiv-search or semantic-scholar), full-text access (PubMed provides abstracts), or social science literature.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# PubMed Search

Search PubMed/MEDLINE (36M+ citations) via NCBI E-utilities REST API.

## API Endpoints

Base: `https://eutils.ncbi.nlm.nih.gov/entrez/eutils/`

### esearch -- Search and get PMIDs

```bash
curl -s "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term=COVID-19+vaccine+efficacy&retmax=10&retmode=json"
```

Parameters: `db=pubmed`, `term=` (URL-encoded query), `retmax=` (default 20, max 10000),
`retstart=` (pagination), `retmode=json`, `sort=relevance|pub_date`,
`mindate=`/`maxdate=` (YYYY/MM/DD), `datetype=pdat`.

### efetch -- Retrieve records by PMID

```bash
curl -s "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=pubmed&id=39142890,39088712&retmode=xml&rettype=abstract"
```

### einfo -- Database metadata

```bash
curl -s "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/einfo.fcgi?db=pubmed&retmode=json"
```

## Query Syntax

**Boolean**: `AND`, `OR`, `NOT`, parentheses for grouping.

**Field tags**: `[ti]` title, `[tiab]` title/abstract, `[au]` author, `[mesh]` MeSH heading,
`[majr]` MeSH major topic, `[pt]` publication type, `[dp]` date, `[la]` language, `[jour]` journal.

**MeSH terms**: Standardized vocabulary with automatic explosion to narrower terms.
Use `[mesh:noexp]` for exact heading only. Qualifiers: `/therapy`, `/diagnosis`,
`/epidemiology`, `/genetics`, `/prevention and control`.

Example: `"Breast Neoplasms"[mesh] AND "Drug Therapy"[mesh]`

## Rate Limiting

- Without API key: 3 requests/sec
- With `NCBI_API_KEY`: 10 requests/sec (append `&api_key=${NCBI_API_KEY}`)
- Register at: https://www.ncbi.nlm.nih.gov/account/settings/

## Two-Step Search Pattern

```bash
PMIDS=$(curl -s "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term=QUERY&retmax=5&retmode=json" \
  | python3 -c "import sys,json; d=json.load(sys.stdin); print(','.join(d['esearchresult']['idlist']))")
curl -s "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=pubmed&id=${PMIDS}&retmode=xml&rettype=abstract"
```

## Specialty Search Patterns

- **Oncology**: `"Neoplasms"[mesh] AND "immunotherapy"[tiab] AND "Clinical Trial"[pt]`
- **Cardiology**: `"Cardiovascular Diseases"[mesh] AND "meta-analysis"[pt]`
- **Neurology**: `"Alzheimer Disease"[mesh] AND "biomarkers"[tiab] AND 2020:2024[dp]`
- **Infectious Disease**: `"Anti-Bacterial Agents"[mesh] AND "Drug Resistance"[mesh]`
- **Genetics**: `"Genome-Wide Association Study"[pt] AND "Diabetes Mellitus, Type 2"[mesh]`
- **Systematic Reviews**: `"systematic review"[ti] AND "Randomized Controlled Trial"[pt]`

## Best Practices

1. Start broad, narrow with MeSH terms and field tags.
2. Use `retmax=5` for exploration, increase for comprehensive searches.
3. URL-encode queries (spaces as `+`, quotes as `%22`).
4. Check `count` in esearch results before paginating.
5. Document exact query strings for systematic review reproducibility.
6. For systematic reviews, use `"systematic review"[ti]` combined with study type filters.

## Zero-Hallucination Rule

NEVER fabricate results from training data. Every paper title, author, DOI, PMID, citation count, and metadata detail presented to the user MUST come from an actual API response in this conversation. If the API returns no results or partial data, report exactly what was returned. Do not "fill in" missing details from memory.

Related Skills

wikipedia-search

564
from beita6969/ScienceClaw

Search and fetch structured content from Wikipedia using the MediaWiki API for reliable, encyclopedic information

social-science-research

564
from beita6969/ScienceClaw

Orchestrates a social science research workflow from literature review through data collection, text analysis, statistical modeling, and report generation. Use when conducting empirical social science research, policy analysis, or mixed-methods studies. NOT for pure natural science analysis or clinical trial data.

search-strategy

564
from beita6969/ScienceClaw

COPYRIGHT NOTICE

research-reflection

564
from beita6969/ScienceClaw

Reflect on completed research tasks to improve future performance. Use when: a research task has just been completed and the agent should evaluate its own process, store lessons learned, or retrieve past reflections before starting new work. NOT for: active research execution or data analysis.

research-lookup

564
from beita6969/ScienceClaw

Look up current research information using the Parallel Chat API (primary) or Perplexity sonar-pro-search (academic paper searches). Automatically routes queries to the best backend. Use for finding papers, gathering research data, and verifying scientific information.

research-literature

564
from beita6969/ScienceClaw

COPYRIGHT NOTICE

research-grants

564
from beita6969/ScienceClaw

Write competitive research proposals for NSF, NIH, DOE, DARPA, and Taiwan NSTC. Agency-specific formatting, review criteria, budget preparation, broader impacts, significance statements, innovation narratives, and compliance with submission requirements.

research-ethics

564
from beita6969/ScienceClaw

Guides research ethics compliance including IRB protocol preparation, informed consent document drafting, research integrity standards, data management plans, and ethical considerations for human/animal subjects; trigger when users discuss IRB, ethical approval, consent forms, or responsible conduct of research.

pubmed-database

564
from beita6969/ScienceClaw

Direct REST API access to PubMed. Advanced Boolean/MeSH queries, E-utilities API, batch processing, citation management. For Python workflows, prefer biopython (Bio.Entrez). Use this for direct HTTP/REST work or custom API implementations.

psychology-research

564
from beita6969/ScienceClaw

Conduct psychological research analysis including mental health, cognitive science, and behavioral studies

perplexity-search

564
from beita6969/ScienceClaw

Perform AI-powered web searches with real-time information using Perplexity models via LiteLLM and OpenRouter. This skill should be used when conducting web searches for current information, finding recent scientific literature, getting grounded answers with source citations, or accessing information beyond the model knowledge cutoff. Provides access to multiple Perplexity models including Sonar Pro, Sonar Pro Search (advanced agentic search), and Sonar Reasoning Pro through a single OpenRouter API key.

openalex-search

564
from beita6969/ScienceClaw

Open academic metadata via OpenAlex API. Use when: user needs author profiles, institution data, concept mapping, or open citation data. NOT for: full-text search or downloading papers.