跳到正文

医学公开数据库查询与登记

使用有明确接口的公开数据库查询方法保存请求、筛选、分页与来源,可用于医学文献、临床试验及药物资料检索。

开源精选医疗业务86 个文件50,135 Stars浏览次数 0K-Dense-AI/scientific-agent-skills MIT版本 a1043ef
开始使用

下载前阅读 SKILL.md 中的使用条件,并确认所用工具支持对应能力。

输入资料
指定数据库和查询问题 实际接口、筛选条件及使用范围 阅读本节完整说明
交付内容
可复查的查询资料 请求、分页与来源记录 阅读本节完整说明
  1. 获取完整包,保留配套文件的目录结构。
  2. 按照原文准备所需工具、依赖与输入资料。
  3. 阅读对应使用步骤与输入输出说明,在自己的环境中验证结果。

使用提示摘自原文,配套文件保留来源版本;实际运行条件以各包说明为准。

正文

获取原文件

references/pubchem.md

Base URL

https://pubchem.ncbi.nlm.nih.gov/rest/pug

URL Pattern

/{domain}/{namespace}/{identifiers}/{operation}/{output}
  • domain: compound, substance, assay
  • namespace: cid, name, smiles, inchi, inchikey, fastformula
  • operation: record, property, synonyms, description, cids, xrefs
  • output: JSON, XML, CSV, TXT, SDF, PNG

Key Endpoints

Search by name

GET /compound/name/{name}/JSON

Example: /compound/name/aspirin/JSON

Search by CID

GET /compound/cid/{cid}/JSON

Example: /compound/cid/2244/JSON

Multiple CIDs: /compound/cid/2244,5988,3672/JSON

Search by SMILES

GET /compound/smiles/{smiles}/JSON

For SMILES with special characters, use POST:

POST /compound/smiles/JSON
Content-Type: application/x-www-form-urlencoded
smiles=CC(=O)OC1=CC=CC=C1C(=O)O

Search by InChIKey

GET /compound/inchikey/{inchikey}/JSON

Search by InChI (POST only — InChI strings are too long for URLs)

POST /compound/inchi/JSON
Content-Type: application/x-www-form-urlencoded
inchi=InChI=1S/C9H8O4/...

Search by molecular formula

GET /compound/fastformula/{formula}/JSON

Example: /compound/fastformula/C9H8O4/JSON

Property retrieval

GET /compound/{namespace}/{id}/property/{property_list}/JSON

Properties are comma-separated. Available properties:

MolecularFormula, MolecularWeight, ConnectivitySMILES, SMILES, InChI, InChIKey, IUPACName, XLogP, ExactMass, MonoisotopicMass, TPSA, Complexity, Charge, HBondDonorCount, HBondAcceptorCount, RotatableBondCount, HeavyAtomCount, CID

Example:

/compound/cid/2244/property/MolecularFormula,MolecularWeight,ConnectivitySMILES,IUPACName/JSON

Response:

{
  "PropertyTable": {
    "Properties": [
      {
        "CID": 2244,
        "MolecularFormula": "C9H8O4",
        "MolecularWeight": "180.16",
        "IUPACName": "2-acetyloxybenzoic acid",
        "ConnectivitySMILES": "CC(=O)OC1=CC=CC=C1C(O)=O"
      }
    ]
  }
}

Synonym lookup

GET /compound/{namespace}/{id}/synonyms/JSON

Compound description

GET /compound/cid/{cid}/description/JSON

Get just CIDs from a name

GET /compound/name/{name}/cids/JSON

Cross-references (patents, registry IDs)

GET /compound/cid/{cid}/xrefs/PatentID/JSON
GET /compound/cid/{cid}/xrefs/RegistryID/JSON

Fast similarity search (synchronous CID result)

POST /compound/fastsimilarity_2d/smiles/cids/JSON
smiles=CC(=O)OC1=CC=CC=C1C(=O)O&Threshold=90

2D structure image

GET /compound/cid/{cid}/PNG
GET /compound/cid/{cid}/PNG?image_size=300x300

Rate Limits

  • Max 5 requests per second
  • Max 400 requests per minute
  • Batch CIDs with commas; use POST when the URL becomes long and keep batches small enough to meet time/payload limits. Endpoint-specific limits differ.
  • Throttle error returns PUGREST.ServerBusy fault code

Error Format

{
  "Fault": {
    "Code": "PUGREST.NotFound",
    "Message": "No CID found",
    "Details": ["..."]
  }
}

fastsimilarity_2d returns IdentifierList.CID synchronously; do not look for an asynchronous ListKey in a successful fast-search response. Older SMILES property aliases may still be accepted but returned JSON keys use the current names above. Official contract: https://pubchem.ncbi.nlm.nih.gov/docs/pug-rest

CONTACT HAONAN

联系haonan

医疗 AI · 产品与独立开发

刘浩南

关注医疗 AI 从 demo 到真实落地,聚焦产品化、商业化与院内工作流效率提升。

12年医疗产研经验,大湾区头部医疗AI公司前产品总监,独立开发者

医疗 AI 产品化医疗 AI 商业化院内工作流效率
刘浩南的微信联系二维码
微信扫一扫,联系 haonan