Provides direct REST API access to PubMed via NCBI E-utilities for Boolean/MeSH queries, batch PMID retrieval, and citation management. Use for custom HTTP/REST PubMed workflows instead of Biopython.
PubMed is the U.S. National Library of Medicine's comprehensive database providing free access to MEDLINE and life sciences literature. Construct advanced queries with Boolean operators, MeSH terms, and field tags, access data programmatically via E-utilities API for systematic reviews and literature analysis.
scripts/query_pubmed.py — NCBI E-utilities (ESearch/ESummary/EFetch; stdlib only, JSON to stdout):
python scripts/query_pubmed.py search "crispr[tiab] AND 2024[dp]" --retmax 20 # PMIDs
python scripts/query_pubmed.py summary 39726939 39492484 # metadata for PMIDs
python scripts/query_pubmed.py fetch 39726939 # abstracts (set NCBI_API_KEY or --api-key for 10 req/s)
This skill should be used when:
| Scenario | Use Instead |
|---|---|
| Cross-disciplinary literature search, citation counts, bibliometrics | alterlab-research-lookup |
| Life-science preprints not yet peer reviewed | alterlab-biorxiv |
| Trial registrations, recruitment status, NCT records | alterlab-clinicaltrials |
| Checking that a bibliography's references exist or were retracted | alterlab-citation-verifier |
| Python Entrez workflows inside a larger Biopython pipeline | alterlab-biopython |
Hand-off rule. When the request matches a row above, open your answer by naming that skill by its exact id (for example alterlab-research-lookup) and saying in one line why it fits better, then stop applying this skill's procedure. Name it even when you also need to ask for missing input. If only part of the request is out of scope, name the skill for that part and do only the in-scope part. A brief general pointer is fine; the named skill does the work.
Construct sophisticated PubMed queries using Boolean operators, field tags, and specialized syntax.
Basic Search Strategies:
Example Queries:
# Recent systematic reviews on diabetes treatment
diabetes mellitus[mh] AND treatment[tiab] AND systematic review[pt] AND 2023:2024[dp]
# Clinical trials comparing two drugs
(metformin[nm] OR insulin[nm]) AND diabetes mellitus, type 2[mh] AND randomized controlled trial[pt]
# Author-specific research
smith ja[au] AND cancer[tiab] AND 2023[dp] AND english[la]
When to consult search_syntax.md:
Grep pattern for field tags: \[au\]|\[ti\]|\[ab\]|\[mh\]|\[pt\]|\[dp\]
Use Medical Subject Headings (MeSH) for precise, consistent searching across the biomedical literature.
MeSH Searching:
Common MeSH Subheadings:
Example:
# Diabetes therapy with specific focus
diabetes mellitus, type 2[mh]/drug therapy AND cardiovascular diseases[mh]/prevention & control
Filter results by publication type, date, text availability, and other attributes.
Publication Types (use [pt] field tag):
Date Filtering:
2024[dp]2020:2024[dp]2024/03/15[dp]Text Availability:
AND free full text[sb] to queryAND hasabstract[text] to queryExample:
# Recent free full-text RCTs on hypertension
hypertension[mh] AND randomized controlled trial[pt] AND 2023:2024[dp] AND free full text[sb]
Access PubMed data programmatically using the NCBI E-utilities REST API for automation and bulk operations.
Core API Endpoints:
Basic Workflow:
import requests
# Step 1: Search for articles
base_url = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/"
search_url = f"{base_url}esearch.fcgi"
params = {
"db": "pubmed",
"term": "diabetes[tiab] AND 2024[dp]",
"retmax": 100,
"retmode": "json",
"api_key": "YOUR_API_KEY" # Optional but recommended
}
response = requests.get(search_url, params=params)
pmids = response.json()["esearchresult"]["idlist"]
# Step 2: Fetch article details
fetch_url = f"{base_url}efetch.fcgi"
params = {
"db": "pubmed",
"id": ",".join(pmids),
"rettype": "abstract",
"retmode": "text",
"api_key": "YOUR_API_KEY"
}
response = requests.get(fetch_url, params=params)
abstracts = response.text
Rate Limits:
Best Practices:
When to consult api_reference.md:
Grep pattern for API endpoints: esearch|efetch|esummary|epost|elink|einfo
Find articles using partial citation information or specific identifiers.
By Identifier:
# By PMID
12345678[pmid]
# By DOI (-> PMID 33301246)
10.1056/NEJMoa2034577[doi]
# By PMC ID
PMC123456[pmc]
Citation Matching (via ECitMatch API): Use journal name, year, volume, page, and author to find PMIDs:
Format: journal|year|volume|page|author|key|
Example: Science|2008|320|5880|1185|key1|
By Author and Metadata:
# First author with year and topic
smith ja[1au] AND 2023[dp] AND cancer[tiab]
# Journal, volume, and page
nature[ta] AND 2024[dp] AND 456[vi] AND 123-130[pg]
Conduct comprehensive literature searches for systematic reviews and meta-analyses.
PICO Framework (Population, Intervention, Comparison, Outcome): Structure clinical research questions systematically:
# Example: Diabetes treatment effectiveness
# P: diabetes mellitus, type 2[mh]
# I: metformin[nm]
# C: lifestyle modification[tiab]
# O: glycemic control[tiab]
diabetes mellitus, type 2[mh] AND
(metformin[nm] OR lifestyle modification[tiab]) AND
glycemic control[tiab] AND
randomized controlled trial[pt]
Comprehensive Search Strategy:
# Include multiple synonyms and MeSH terms
(disease name[tiab] OR disease name[mh] OR synonym[tiab]) AND
(treatment[tiab] OR therapy[tiab] OR intervention[tiab]) AND
(systematic review[pt] OR meta-analysis[pt] OR randomized controlled trial[pt]) AND
2020:2024[dp] AND
english[la]
Search Refinement:
When to consult common_queries.md:
Grep pattern for query examples: diabetes|cancer|cardiovascular|clinical trial|systematic review
Find related research programmatically with ELink (pre-calculated neighbors based on title/abstract similarity and MeSH overlap):
elink.fcgi?dbfrom=pubmed&db=pubmed&id=PMID&cmd=neighbor
cmd=prlinks returns publisher full-text URLs; cmd=llinks returns LinkOut URLs.
Use EFetch with rettype=medline&retmode=text to export records in MEDLINE/.nbib format for reference managers (Zotero, Mendeley, EndNote):
efetch.fcgi?db=pubmed&id=PMID1,PMID2&rettype=medline&retmode=text
This skill includes three comprehensive reference files in the references/ directory:
Complete E-utilities API documentation including all nine endpoints, parameters, response formats, and best practices. Consult when:
Detailed guide to PubMed search syntax including field tags, Boolean operators, wildcards, and special characters. Consult when:
Extensive collection of example queries for various research scenarios, disease types, and methodologies. Consult when:
Reference Loading Strategy:
Load reference files as needed. For basic searches this SKILL.md is usually enough; consult the references for complex query construction (search_syntax.md), API workflows (api_reference.md), or domain templates (common_queries.md).
usehistory=y, then page EFetch with retstart/retmax) or EPost, rather than one huge id list (which can hit HTTP 414). The history server does not lift the 9,999-record cap below.systematic review[pt], meta-analysis[pt], and randomized controlled trial[pt]; pair with humans[mh], english[la], and a [dp] range as appropriate.retstart above 9998 returns an error, and EFetch/ESummary from the history server hit the same wall. For bigger sets, split the query into date windows (e.g. AND 2020/01/01:2020/06/30[dp]) that each stay under 9,999 hits, or use EDirect, which batches automatically.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Not loaded · from alterlab-writing-tools
Claude Code won't load this skill
It ships in alterlab-writing-tools at skills/, but Claude Code only loads skills/<name>/SKILL.md and folders listed under skills in plugin.json. Installing the plugin doesn't add it.
Generated from the plugin's indexed repository (alterlab-ieu/alterlab-academic-skills) — no native marketplace selected
npx claudepluginhub p/alterlab-ieu-alterlab-writing-tools241 skills in this plugin
/alterlab-abm-mesaBuilds agent-based models of social systems with Mesa 3 — the current AgentSet API (model.agents.shuffle_do('step'), auto-assigned unique_id, mandatory super().__init__(rng=...)), cell spaces (mesa.discrete_space OrthogonalMooreGrid / classic mesa.space grids), the DataCollector, batch_run parameter sweeps, and SolaraViz — for emergence, segregation, diffusion, opinion dynamics, and cooperation models. It uses the Mesa 3.x API (the old mesa.time schedulers like RandomActivation are removed) and treats the model as a generative theory to be validated, not just run. Use when the request mentions an agent-based model, Mesa, simulating interacting agents, or emergent macro behavior from micro rules. For discrete-event (queueing/process) simulation prefer alterlab-simpy; for reinforcement learning prefer alterlab-stable-baselines3. Part of the AlterLab Academic Skills suite./alterlab-academic-careerPrepares academic career documents and professional-development materials for faculty and researchers. Use when drafting academic CVs, research statements, teaching philosophies, diversity statements, faculty-position cover letters, tenure dossiers, promotion narratives, academic portfolios, or mentorship statements, and when planning conference-networking strategy, building academic web presence, setting up ORCID profiles, or understanding impact metrics. Part of the AlterLab Academic Skills suite.2 plugins in one repository ship this exact skill · first indexed Nov 9, 2026
Other plugins' skills for the same job