scientific-db-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 获取生物医学文献而非进行常规网页搜索时,使用此 skill。

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]
从研究问题开始,将其拆分为多个概念,然后使用 Boolean 运算符组合这些概念。
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
    :查找相关 articles 和关联资源。
生产环境脚本应使用 email 和 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 history server 参数(
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
| 数据库 | 搜索日期 | 查询 | 筛选条件 | 结果 |
| --- | --- | --- | --- | ---: |
| 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

参考资料