pubmed-database

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

PubMed Database

PubMed数据库

Use this skill when a task needs biomedical literature from PubMed rather than general web search.
当任务需要从PubMed获取生物医学文献而非进行通用网络搜索时,使用此技能。

When to Use

使用场景

  • Searching MEDLINE or life-sciences literature.
  • Building PubMed queries with MeSH terms, field tags, dates, or article types.
  • Looking up PMIDs, abstracts, publication metadata, or related citations.
  • Running systematic-review search passes that need repeatable search strings.
  • Using NCBI E-utilities directly from Python, shell, or another HTTP client.
  • 搜索MEDLINE或生命科学文献。
  • 结合MeSH术语、字段标签、日期或文章类型构建PubMed查询语句。
  • 查找PMID、摘要、出版物元数据或相关引文。
  • 执行需要可重复搜索字符串的系统综述搜索流程。
  • 直接从Python、Shell或其他HTTP客户端调用NCBI E-utilities。

Query Construction

查询语句构建

Start with the research question, split it into concepts, then combine concepts with Boolean operators.
text
concept_1 AND concept_2 AND filter
synonym_a OR synonym_b
NOT exclusion_term
Useful PubMed field tags:
  • [ti]
    : title
  • [ab]
    : abstract
  • [tiab]
    : title or abstract
  • [au]
    : author
  • [ta]
    : journal title abbreviation
  • [mh]
    : MeSH term
  • [majr]
    : major MeSH topic
  • [pt]
    : publication type
  • [dp]
    : date of publication
  • [la]
    : language
Examples:
text
diabetes mellitus[mh] AND treatment[tiab] AND systematic review[pt] AND 2023:2026[dp]
(metformin[nm] OR insulin[nm]) AND diabetes mellitus, type 2[mh] AND randomized controlled trial[pt]
smith ja[au] AND cancer[tiab] AND 2026[dp] AND english[la]
从研究问题入手,将其拆分为多个概念,然后用布尔运算符组合这些概念。
text
concept_1 AND concept_2 AND filter
synonym_a OR synonym_b
NOT exclusion_term
实用的PubMed字段标签:
  • [ti]
    : 标题
  • [ab]
    : 摘要
  • [tiab]
    : 标题或摘要
  • [au]
    : 作者
  • [ta]
    : 期刊名称缩写
  • [mh]
    : MeSH术语
  • [majr]
    : 主要MeSH主题
  • [pt]
    : 出版物类型
  • [dp]
    : 出版日期
  • [la]
    : 语言
示例:
text
diabetes mellitus[mh] AND treatment[tiab] AND systematic review[pt] AND 2023:2026[dp]
(metformin[nm] OR insulin[nm]) AND diabetes mellitus, type 2[mh] AND randomized controlled trial[pt]
smith ja[au] AND cancer[tiab] AND 2026[dp] AND english[la]

MeSH and Subheadings

MeSH与副标题

Prefer MeSH when the concept has a stable controlled-vocabulary term. Combine MeSH with title/abstract terms when the topic is new or terminology varies.
Correct subheading syntax puts the subheading before the field tag:
text
diabetes mellitus, type 2/drug therapy[mh]
cardiovascular diseases/prevention & control[mh]
Use
[majr]
only when the topic must be central to the paper. It can improve precision but may miss relevant work.
当概念有稳定的受控词汇术语时,优先使用MeSH。当主题较新或术语多样时,将MeSH与标题/摘要术语结合使用。
正确的副标题语法是将副标题放在字段标签之前:
text
diabetes mellitus, type 2/drug therapy[mh]
cardiovascular diseases/prevention & control[mh]
仅当主题必须是论文核心内容时才使用
[majr]
。它可以提高精准度,但可能会遗漏相关研究。

Filters

筛选条件

Publication types:
  • clinical trial[pt]
  • meta-analysis[pt]
  • randomized controlled trial[pt]
  • review[pt]
  • systematic review[pt]
  • guideline[pt]
Date filters:
text
2026[dp]
2020:2026[dp]
2026/03/15[dp]
Availability filters:
text
free full text[sb]
hasabstract[text]
出版物类型:
  • clinical trial[pt]
    :临床试验
  • meta-analysis[pt]
    :荟萃分析
  • randomized controlled trial[pt]
    :随机对照试验
  • review[pt]
    :综述
  • systematic review[pt]
    :系统综述
  • guideline[pt]
    :指南
日期筛选:
text
2026[dp]
2020:2026[dp]
2026/03/15[dp]
可用性筛选:
text
free full text[sb]
hasabstract[text]

E-utilities Workflow

E-utilities工作流

NCBI E-utilities supports repeatable API workflows:
  1. esearch.fcgi
    : search and return PMIDs.
  2. esummary.fcgi
    : return lightweight article metadata.
  3. efetch.fcgi
    : fetch abstracts or full records in XML, MEDLINE, or text.
  4. elink.fcgi
    : find related articles and linked resources.
Use an email and API key for production scripts. Store API keys in environment variables, never in committed files or command history.
python
import os
import time
import requests

BASE = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils"


def esearch(query: str, retmax: int = 20) -> list[str]:
    params = {
        "db": "pubmed",
        "term": query,
        "retmode": "json",
        "retmax": retmax,
        "tool": "ecc-pubmed-search",
        "email": os.environ.get("NCBI_EMAIL", ""),
    }
    api_key = os.environ.get("NCBI_API_KEY")
    if api_key:
        params["api_key"] = api_key

    response = requests.get(f"{BASE}/esearch.fcgi", params=params, timeout=30)
    response.raise_for_status()
    time.sleep(0.35)
    return response.json()["esearchresult"]["idlist"]


pmids = esearch("hypertension[mh] AND randomized controlled trial[pt] AND 2024:2026[dp]")
print(pmids)
For batches, prefer NCBI history server parameters (
usehistory=y
,
WebEnv
,
query_key
) instead of passing very long PMID lists through URLs.
NCBI E-utilities支持可重复的API工作流:
  1. esearch.fcgi
    :执行搜索并返回PMID。
  2. esummary.fcgi
    :返回轻量级文章元数据。
  3. efetch.fcgi
    :以XML、MEDLINE或文本格式获取摘要或完整记录。
  4. elink.fcgi
    :查找相关文章及关联资源。
生产脚本中请使用邮箱和API密钥。将API密钥存储在环境变量中,切勿存入已提交的文件或命令历史记录。
python
import os
import time
import requests

BASE = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils"


def esearch(query: str, retmax: int = 20) -> list[str]:
    params = {
        "db": "pubmed",
        "term": query,
        "retmode": "json",
        "retmax": retmax,
        "tool": "ecc-pubmed-search",
        "email": os.environ.get("NCBI_EMAIL", ""),
    }
    api_key = os.environ.get("NCBI_API_KEY")
    if api_key:
        params["api_key"] = api_key

    response = requests.get(f"{BASE}/esearch.fcgi", params=params, timeout=30)
    response.raise_for_status()
    time.sleep(0.35)
    return response.json()["esearchresult"]["idlist"]


pmids = esearch("hypertension[mh] AND randomized controlled trial[pt] AND 2024:2026[dp]")
print(pmids)
对于批量处理,优先使用NCBI历史服务器参数(
usehistory=y
WebEnv
query_key
),而非通过URL传递超长PMID列表。

Output Discipline

输出规范

For each search pass, record:
  • exact search string
  • database searched
  • date searched
  • filters used
  • result count
  • export format
  • any manual exclusions
Example:
markdown
| Database | Date searched | Query | Filters | Results |
| --- | --- | --- | --- | ---: |
| PubMed | 2026-05-11 | `sickle cell disease[mh] AND CRISPR[tiab]` | 2020:2026[dp], English | 42 |
每次搜索流程,需记录:
  • 精确的搜索字符串
  • 搜索的数据库
  • 搜索日期
  • 使用的筛选条件
  • 结果数量
  • 导出格式
  • 任何手动排除项
示例:
markdown
| Database | Date searched | Query | Filters | Results |
| --- | --- | --- | --- | ---: |
| PubMed | 2026-05-11 | `sickle cell disease[mh] AND CRISPR[tiab]` | 2020:2026[dp], English | 42 |

Review Checklist

审核清单

  • Are field tags valid PubMed tags?
  • Are MeSH terms paired with free-text synonyms for newer topics?
  • Is the date range explicit and appropriate?
  • Does the search log include enough detail to reproduce the query?
  • Are API keys loaded from the environment?
  • Does HTTP code call
    raise_for_status()
    or otherwise handle non-200 responses before parsing?
  • Are rate limits respected?
  • 字段标签是否为有效的PubMed标签?
  • 对于较新主题,MeSH术语是否搭配了自由文本同义词?
  • 日期范围是否明确且合适?
  • 搜索日志是否包含足够细节以重现查询?
  • API密钥是否从环境变量加载?
  • HTTP调用是否在解析前调用了
    raise_for_status()
    或处理了非200响应?
  • 是否遵守了速率限制?

References

参考资料