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
| 数据库 | 搜索日期 | 查询 | 过滤器 | 结果 |
| --- | --- | --- | --- | ---: |
| 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

参考