PubMed REST API Search
davila7/claude-code-templates
Searches PubMed directly through its E-utilities REST API, with guidance on Boolean and MeSH query syntax, batch retrieval and citation data.
Searches and fetches PubMed and PMC via NCBI E-utilities (ESearch then EFetch/ESummary) to gather biomedical evidence and build text corpora.
$ npx skills add maziyarpanahi/openmed --skill mining-pubmed-literature -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install maziyarpanahi/openmed mining-pubmed-literature --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/maziyarpanahi/openmed.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/mining-pubmed-literature .claude/skills/mining-pubmed-literature && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "mining-pubmed-literature" agent skill from https://github.com/maziyarpanahi/openmed/tree/master/skills/mining-pubmed-literature into .claude/skills/mining-pubmed-literature/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mining-pubmed-literature", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/maziyarpanahi/openmed/tree/master/skills/mining-pubmed-literatureType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add maziyarpanahi/openmed --skill mining-pubmed-literature -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install maziyarpanahi/openmed mining-pubmed-literature --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/maziyarpanahi/openmed.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/mining-pubmed-literature .agents/skills/mining-pubmed-literature && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "mining-pubmed-literature" agent skill from https://github.com/maziyarpanahi/openmed/tree/master/skills/mining-pubmed-literature into .agents/skills/mining-pubmed-literature/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mining-pubmed-literature", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add maziyarpanahi/openmed --skill mining-pubmed-literature -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install maziyarpanahi/openmed mining-pubmed-literature --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/maziyarpanahi/openmed.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/mining-pubmed-literature .cursor/skills/mining-pubmed-literature && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "mining-pubmed-literature" agent skill from https://github.com/maziyarpanahi/openmed/tree/master/skills/mining-pubmed-literature into .cursor/skills/mining-pubmed-literature/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mining-pubmed-literature", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/maziyarpanahi/openmed.git --path skills/mining-pubmed-literature--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add maziyarpanahi/openmed --skill mining-pubmed-literature -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install maziyarpanahi/openmed mining-pubmed-literature --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/maziyarpanahi/openmed.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/mining-pubmed-literature .gemini/skills/mining-pubmed-literature && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "mining-pubmed-literature" agent skill from https://github.com/maziyarpanahi/openmed/tree/master/skills/mining-pubmed-literature into .gemini/skills/mining-pubmed-literature/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mining-pubmed-literature", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install maziyarpanahi/openmed mining-pubmed-literatureInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add maziyarpanahi/openmed --skill mining-pubmed-literature -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/maziyarpanahi/openmed.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/mining-pubmed-literature .github/skills/mining-pubmed-literature && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "mining-pubmed-literature" agent skill from https://github.com/maziyarpanahi/openmed/tree/master/skills/mining-pubmed-literature into .github/skills/mining-pubmed-literature/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mining-pubmed-literature", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add maziyarpanahi/openmed --skill mining-pubmed-literature -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install maziyarpanahi/openmed mining-pubmed-literature --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/maziyarpanahi/openmed.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/mining-pubmed-literature .opencode/skills/mining-pubmed-literature && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "mining-pubmed-literature" agent skill from https://github.com/maziyarpanahi/openmed/tree/master/skills/mining-pubmed-literature into .opencode/skills/mining-pubmed-literature/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mining-pubmed-literature", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
mining-pubmed-literatureSearches and fetches PubMed and PMC via NCBI E-utilities (ESearch then EFetch/ESummary) to gather biomedical evidence and build text corpora.
Mining Pubmed Literature is an agent skill from maziyarpanahi/openmed. Searches and fetches PubMed and PMC via NCBI E-utilities (ESearch then EFetch/ESummary) to gather biomedical evidence and build text corpora. Use when the user wants citations for a condition or drug, abstracts to summarize, MeSH-based searches, or a corpus of literature to run NER over. Trigger keywords: PubMed, PMC, NCBI, E-utilities, ESearch, EFetch, ESummary, MeSH, PMID, literature search, abstracts, evidence. Pairs adjacent to OpenMed: fetched abstracts feed openmed.analyzetext for biomedical NER, and…
Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Research & Science, covering Academic paper search, Rate limiting and Literature review. It works with PubMed and NCBI. The repository describes itself as: Local-first healthcare AI: clinical NER and HIPAA PII de-identification on hardware you control. 2,200+ medical models, 35 model-backed PII languages, and Python, MLX, Android… The licence is Apache-2.0.
5 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 34d7b8c. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
curlFrom the folder's file list and the shell code blocks in SKILL.md.
Hosts in commands or code, which the agent is likely to contact:
eutils.ncbi.nlm.nih.govAlso links to:
ncbi.nlm.nih.govsupport.nlm.nih.govpubmed.ncbi.nlm.nih.govmeshb.nlm.nih.govFrom URLs in SKILL.md, links to its own repository left out.
Names these keys or tokens, usually read from environment variables:
API_KEYFrom names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Mining Pubmed Literature loads about 1.7k tokens when it runs. Until then it costs about 175 tokens; SKILL.md has 525 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from maziyarpanahi/openmed at commit 34d7b8c, republished under its Apache-2.0 licence (© maziyarpanahi). 525 words, ~1,747 tokens.
.claude/skills/mining-pubmed-literature/SKILL.md (or your agent's skills folder).Search PubMed (citations/abstracts) and PMC (full text) programmatically
with NCBI E-utilities — the stable HTTP interface to Entrez. The core pattern
is two steps: ESearch returns matching record IDs (PMIDs), then EFetch (or
ESummary) downloads the records. The Entrez History server (usehistory=y)
lets you chain the two without re-sending thousands of IDs.
E-utilities are public. No key is required, but a free API key raises your limit from 3 to 10 requests/second and is strongly recommended for batch work.
For ClinicalTrials.gov use searching-clinicaltrials; this skill is for the
published literature.
Base URL: https://eutils.ncbi.nlm.nih.gov/entrez/eutils/. JSON for ESearch/
ESummary via retmode=json; EFetch returns text or XML (no JSON for PubMed).
import requests, time
BASE = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils"
API_KEY = None # set to your free NCBI key to get 10 req/s instead of 3
def _params(**kw):
if API_KEY:
kw["api_key"] = API_KEY
return kw
def esearch(term: str, retmax: int = 50) -> dict:
"""Find PMIDs; usehistory=y stores them on the Entrez History server."""
r = requests.get(f"{BASE}/esearch.fcgi", params=_params(
db="pubmed", term=term, retmax=retmax,
usehistory="y", retmode="json"), timeout=30)
r.raise_for_status()
res = r.json()["esearchresult"]
return {"count": int(res["count"]), "ids": res["idlist"],
"webenv": res["webenv"], "query_key": res["querykey"]}
def efetch_abstracts(webenv: str, query_key: str, retmax: int = 50) -> str:
"""Pull abstracts by reference to the stored result set (no ID list needed)."""
r = requests.get(f"{BASE}/efetch.fcgi", params=_params(
db="pubmed", WebEnv=webenv, query_key=query_key,
retmax=retmax, rettype="abstract", retmode="text"), timeout=60)
r.raise_for_status()
return r.text
hits = esearch('("type 2 diabetes"[MeSH]) AND metformin AND 2023:2025[pdat]')
print(hits["count"], "papers")
abstracts = efetch_abstracts(hits["webenv"], hits["query_key"])Equivalent cURL (search then fetch one PMID's abstract):
curl "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term=metformin&retmode=json"
curl "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=pubmed&id=38000000&rettype=abstract&retmode=text"When you need titles/authors/journal/date as JSON (not the full abstract), use ESummary — it returns one record per ID:
def esummary(ids: list[str]) -> dict:
r = requests.get(f"{BASE}/esummary.fcgi", params=_params(
db="pubmed", id=",".join(ids), retmode="json"), timeout=30)
r.raise_for_status()
return r.json()["result"] # keyed by PMID: title, pubdate, source, authors…For PMC full text, repeat with db=pmc and EFetch rettype=""/retmode=xml
(JATS XML). Respect each article's license before redistributing full text.
"<disease>"[MeSH] AND <drug>[tiab] AND 2020:2025[pdat]. Use
[tiab] (title/abstract), [au] (author), [pdat] (publication date).usehistory=y to capture WebEnv + query_key and the count.openmed.analyze_text to extract diseases, drugs,
genes, and oncology entities for downstream synthesis.openmed.analyze_text(note) yields Disease,
Pharmaceutical, Genomics, and Oncology entities. Turn the top spans into the
ESearch term (optionally grounded: ICD-10 label, RxNorm ingredient, gene
symbol) to retrieve targeted evidence.openmed.analyze_text(abstract, model_name="disease_detection_superclinical")
(or a Genomics/Oncology model) to structure the literature into entities for
evidence tables or knowledge-graph edges.api_key, throttle, and retry with backoff. NCBI also requests a
tool= and email= parameter identifying your application.retmode=text (human-readable) or
retmode=xml (PubMedArticle XML) and parse XML for structured fields.WebEnv/query_key are session-scoped — fetch promptly
after searching, or re-run ESearch.retstart/retmax (or history) rather than
pulling everything at once; cap total fetches.[tiab]
term variants so you do not miss them.© maziyarpanahi, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in skills/mining-pubmed-literature of maziyarpanahi/openmed.
Open the folder on GitHubat commit 34d7b8c
Mining Pubmed Literature next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Mining Pubmed Literature this skillmaziyarpanahi/openmed | 5.5k | — | ~1.7k | Automated safety check: Pass | Apache-2.0 | |
| PubMed REST API Searchdavila7/claude-code-templates | 33k | 14 repos | ~3.9k | Automated safety check: Pass | MIT | |
| Pubmed Databasejaechang-hits/SciAgent-Skills | 374 | 1 repos | ~4.4k | Automated safety check: Pass | CC-BY-4.0 | |
| Molecular Review Workflowaipoch/medical-research-skills | 1.9k | — | ~1.8k | Automated safety check: Pass | MIT | |
| Literature Reviewneflibata-feng/MyArxiv-Agent | 126 | 20 repos | ~5.9k | Automated safety check: Notes | MIT | |
| Academic Search and Citation RouterYuan1z0825/nature-skills | 47k | — | ~884 | Automated safety check: Pass | Apache-2.0 |
davila7/claude-code-templates
Searches PubMed directly through its E-utilities REST API, with guidance on Boolean and MeSH query syntax, batch retrieval and citation data.
jaechang-hits/SciAgent-Skills
Programmatic PubMed access via NCBI E-utilities REST API. An agent skill from jaechang-hits/SciAgent-Skills.
aipoch/medical-research-skills
Generates academic reviews for molecules in diseases using PubMed research.
neflibata-feng/MyArxiv-Agent
Conduct comprehensive, systematic literature reviews using multiple academic databases (PubMed, arXiv, bioRxiv, Semantic Scholar, etc.).
Yuan1z0825/nature-skills
Finds papers across literature sources, verifies and converts citations, builds MeSH strategies and audits independent citations of a paper.
K-Dense-AI/scientific-agent-skills
Runs systematic, scoping or narrative literature reviews across PubMed, arXiv, bioRxiv and Semantic Scholar, with citation checks and Markdown or PDF output.
maziyarpanahi/openmed
Checks OpenMed de-identified clinical text against the 18 HIPAA Safe Harbor identifier categories and reports gaps and residual re-identification risk.
maziyarpanahi/openmed
Fills in a model card for an OpenMed clinical NER or de-identification model from its evaluation reports: intended use, metrics, subgroups and limitations.
maziyarpanahi/openmed
Walks a data pipeline against the HIPAA Privacy and Security Rule checklist and produces a gap report before it processes patient data.
maziyarpanahi/openmed
Suggests candidate ICD-10-CM diagnosis and ICD-10-PCS procedure codes for clinical text extracted by OpenMed, with rationale for a certified coder to review.
maziyarpanahi/openmed
Maps OpenMed-extracted, terminology-coded conditions, drugs and measurements into OMOP CDM v5.4 tables for OHDSI and ATLAS analytics.
maziyarpanahi/openmed
Finds social risks such as housing instability or food insecurity in clinical notes and proposes matching ICD-10-CM Z-codes for a coder to confirm.
Categories
Searches and fetches PubMed and PMC via NCBI E-utilities (ESearch then EFetch/ESummary) to gather biomedical evidence and build text corpora. Mining Pubmed Literature is an agent skill from maziyarpanahi/openmed. Searches and fetches PubMed and PMC via NCBI E-utilities (ESearch then EFetch/ESummary) to gather biomedical evidence and build text corpora.
Mining Pubmed Literature fits situations like: the user wants citations for a condition; abstracts to summarize; meSH-based searches; A corpus of literature to run NER over.
Run `npx skills add maziyarpanahi/openmed --skill mining-pubmed-literature -a claude-code`. Or copy the skill folder (skills/mining-pubmed-literature in maziyarpanahi/openmed) into .claude/skills/mining-pubmed-literature in your project. Claude Code loads it when a task matches its description.
Run `npx skills add maziyarpanahi/openmed --skill mining-pubmed-literature -a codex`. Or copy the skill folder (skills/mining-pubmed-literature in maziyarpanahi/openmed) into .agents/skills/mining-pubmed-literature in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add maziyarpanahi/openmed --skill mining-pubmed-literature -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/mining-pubmed-literature, .gemini/skills/mining-pubmed-literature, .github/skills/mining-pubmed-literature and .opencode/skills/mining-pubmed-literature in your project.
Going by SKILL.md and its folder, Mining Pubmed Literature needs the command-line tools its instructions call (curl) and credentials named API_KEY. Our summary lists: Python 3; A credential in API_KEY.
SKILL.md names 5 domains. In commands or code: eutils.ncbi.nlm.nih.gov; the agent is likely to contact it when it follows the instructions. As links in the text: ncbi.nlm.nih.gov, support.nlm.nih.gov, pubmed.ncbi.nlm.nih.gov and meshb.nlm.nih.gov. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Mining Pubmed Literature is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.7k tokens (SKILL.md is roughly 7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Mining Pubmed Literature: PubMed REST API Search (davila7/claude-code-templates, 33k stars), Pubmed Database (jaechang-hits/SciAgent-Skills, 374 stars), Molecular Review Workflow (aipoch/medical-research-skills, 1.9k stars) and Literature Review (neflibata-feng/MyArxiv-Agent, 126 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
maziyarpanahi (a GitHub user) maintains it in maziyarpanahi/openmed, which has 5,506 GitHub stars. The repository holds 74 skills in this directory. The repository was last updated on October 11, 2026.
Source: maziyarpanahi/openmed on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.