MangroveNP v0.6

数据接口 / API

中文

MangroveNP 不运行服务器端程序:网站只提供静态文件,所有数据以普通文件形式公开,无需注册或密钥。检索、筛选、分页与结构检索均在浏览器中计算。所有数据以 CC BY 4.0 发布,使用时请按"如何引用"页署名。

{id} 为 MangroveNP 记录号,格式为 mangrove- 加数字。

1. 文件与路径

路径 内容 Content-Type 缓存 大小(原始 / gzip)
/data/db/db-manifest.json 数据库清单,指向当前的索引文件;返回 200 即表示网站正常 application/json; charset=utf-8 no-cache 约 247 B
/data/db/db-index.<sha12>.json 检索索引:概况、物种列表与每条记录的检索行 application/json; charset=utf-8 public, max-age=31536000, immutable 4.13 MB / 0.94 MB
/data/db/records/{id}.json 单条记录详情(6,234 个文件) application/json; charset=utf-8 public, max-age=3600 每个约 2–6 KB
/data/svg/{id}.svg 单条记录的 SVG 结构图 image/svg+xml; charset=utf-8 public, max-age=86400 —
/api/database/compounds/{id}/structure.svg 旧结构图地址,内容同上 image/svg+xml; charset=utf-8 public, max-age=86400 —
/data/struct/struct-manifest.json 结构检索索引清单,指向 4 个带哈希的文件 application/json no-cache 约 1.3 KB
/data/struct/struct-meta.<sha12>.json 结构检索元数据,每个唯一 InChIKey 一行 application/json public, max-age=31536000, immutable 808 KB / 287 KB
/data/struct/morgan2048.<sha12>.bin Morgan 指纹(每行 256 字节) application/octet-stream public, max-age=31536000, immutable 1.48 MB / 272 KB
/data/struct/sslib-pattern.<sha12>.bin 子结构检索用的 RDKit pattern 指纹 application/octet-stream public, max-age=31536000, immutable 2.57 MB / 859 KB
/data/struct/struct-props.<sha12>.json 描述符与 NPClassifier 类别(供浏览器筛选) application/json public, max-age=31536000, immutable 432 KB / 136 KB
/vendor/rdkit/RDKit_minimal.js、/vendor/rdkit/RDKit_minimal.wasm 浏览器端 RDKit.js 运行库 application/javascript、application/wasm public, max-age=604800 —
/struct-worker.js 浏览器端结构检索程序 application/javascript no-cache —
/data/npclassifier/npc-browse.json NPClassifier 类别浏览树 application/json public, max-age=3600 —
/data/errata/tombstones.json 已撤回记录说明 application/json public, max-age=3600 —
/compound/mangrove-XXXX 记录永久链接(见第 4 节) text/html no-cache —

2. 下载文件

均位于 /data/,缓存 public, max-age=3600。

文件 Content-Type 大小(原始 / gzip)
mangrovenp-v0.6-public.json application/json 12.7 MB / 1.35 MB
mangrovenp-v0.6-public.csv text/csv 4.86 MB / 1.03 MB
mangrovenp-v0.6-structures.sdf chemical/x-mdl-sdfile 16.8 MB / 1.88 MB
mangrovenp-v0.6-structures.smi chemical/x-daylight-smiles 786 KB / 251 KB
mangrovenp-v0.6-descriptors.tsv text/tab-separated-values 1.28 MB / 425 KB
mangrovenp-v0.6-npclassifier.tsv text/tab-separated-values 490 KB / 109 KB
mangrovenp-v0.6-literature.json application/json 16.4 MB / 1.39 MB
resources.json application/json 30.0 KB / 5.75 KB
SHA256SUMS text/plain 1.15 MB / 516 KB

字段说明见"数据字典"页;校验方法见"帮助"页。

3. JSON 结构

/data/db/db-manifest.json

{schema, release, index, sha256, records, recordsPath}:index 为当前索引文件名(db-index.<sha12>.json),sha256 为其校验值,records 为记录数,recordsPath 为详情文件路径格式(records/<id>.json)。

/data/db/db-index.<sha12>.json

{schema, release, license, notice, stats, taxa, fields, rows}

/data/db/records/{id}.json

{id, structureFrom, recordId, name, formula, smiles, inchiKey, taxa, occurrenceCount, license, alsoListedIn, structureCaution, identifiers, metadata, occurrences}

/data/struct/struct-manifest.json

{schema, release, builtAt, source, sourceSha256, rdkitjs, records, structures, organismTypes, morgan, fields, files}:rdkitjs 为 RDKit.js 版本;records 为记录数(6,234),structures 为唯一结构数(5,773);morgan 为 {radius: 2, nBits: 2048};files 列出 struct-meta、morgan2048、sslib-pattern、struct-props 四个文件的 {file, sha256, bytes}。

/data/npclassifier/npc-browse.json

{schema, source, records, levels, unclassified, notFurtherClassified, note_zh, note_en, nodes}:levels 为 pathway、superclass、class;nodes 为 [{level, label, parent, records}],records 为记录数(以 6,234 条公开记录计)。有多个类别的记录在其每个类别下各计一次;无类别的记录归入「未分类 / Unclassified」。parent 为从最高一级起的上级类别名数组:pathway 为 [],superclass 为 [pathway],class 为 [pathway, superclass]。source 为 {labels_flat, sha256, npclassifier_tsv};顶层 records 为公开记录数(6,234);unclassified 与 notFurtherClassified 分别给出「未分类 / Unclassified」与「未细分 / Not further classified」的中英文标签;无其他键。

/data/errata/tombstones.json

{schema, release, source, records}:release 为 "MangroveNP v0.6";source 为 {file, sha256};records 为 [{record_id, name, removed_in_version, reason_en, reason_zh}],列出已撤回的记录;不含结构、SMILES、InChIKey 或分子式。

4. 永久链接

5. 检索参数(在浏览器中处理)

网站检索页面在浏览器中按以下参数筛选和分页,参数名与旧接口相同并有新增。参数写在网址的 #database? 之后(路径为 /),例如 /#database?q=luteolin&org=plant&mwmin=200&mwmax=400。

参数 取值 说明
q 文本 检索词
type any、name、recordId、inchiKey、formula、smiles 检索类型
database COCONUT、LOTUS、OPSIN 按结构来源(structure_from)筛选;有多个来源的记录(如同时来自 COCONUT 与 LOTUS)匹配其中每一个。交叉引用数据库(also_listed_in)不能筛选,只在记录详情中显示
taxon 物种名称 按物种筛选
status literature_evidence 只显示有文献证据的记录
structure available、missing 按是否有结构筛选
sort name、source source 按 structureFrom 的第一项排序,相同时按记录号的数值排序
page、limit 正整数;limit 最大 100 分页
org plant、fungus、bacterium、protist、alga、animal、other 按来源生物类型筛选。alga、animal、other 为保留值,本版本没有对应记录;界面只显示本版本有记录的四种类型(plant、fungus、bacterium、protist)。一条记录可能属于多种类型,因此各类型的记录数相加会超过记录总数
<k>min、<k>max 数值;k 为 mw、logp、tpsa、hbd、hba、rotb、lipv、heavy、rings、fsp3 描述符范围
mass、masstol、massunit 数值;masstol 默认 0.005;massunit 为 da 或 ppm 按精确质量检索
veber、glyco 0、1 是否符合 Veber 规则;是否为糖苷
npcp、npcs、npcc 单个类别名称 按 NPClassifier pathway / superclass / class 筛选

不支持的参数返回 {error: "Unsupported parameter"}。检索结果对象为 {total, page, limit, scope, notice, records},每条为 {id, structureFrom, recordId, name, formula, smiles, inchiKey, taxa(最多 6 个), occurrenceCount, license},其中 structureFrom 为字符串数组,不为空。导出也在浏览器中生成,"导出全部筛选结果"包含全部匹配记录。

6. 访问频率限制

服务器按 IP 地址限制请求频率:每秒 30 次,允许 40–60 次的短时突发;SDF、SMI 与两个 TSV 下载文件(描述符表与 NPClassifier 分类表)另限为每秒 2 次,突发 4 次;超出时返回 HTTP 429。批量使用请直接下载完整数据文件,不要逐条抓取。

7. 版本与稳定性

接口版本与兼容性安排:当前为 v0.6 静态接口,字段变更记录在变更日志中。

English

MangroveNP runs no server-side program: the website serves static files only, and all data are published as plain files; no registration or key is needed. Search, filtering, paging and structure search are computed in your browser. All data are released under CC BY 4.0; please give credit as described on the How to cite page.

{id} is a MangroveNP record ID: mangrove- followed by digits.

1. Files and paths

Path Content Content-Type Caching Size (raw / gzip)
/data/db/db-manifest.json database manifest pointing to the current index file; a 200 response means the site is up application/json; charset=utf-8 no-cache about 247 B
/data/db/db-index.<sha12>.json search index: overview, species list and one search row per record application/json; charset=utf-8 public, max-age=31536000, immutable 4.13 MB / 0.94 MB
/data/db/records/{id}.json one record in detail (6,234 files) application/json; charset=utf-8 public, max-age=3600 about 2–6 KB each
/data/svg/{id}.svg SVG structure image of one record image/svg+xml; charset=utf-8 public, max-age=86400 —
/api/database/compounds/{id}/structure.svg old structure image URL, same content image/svg+xml; charset=utf-8 public, max-age=86400 —
/data/struct/struct-manifest.json structure-search index manifest pointing to 4 hashed files application/json no-cache about 1.3 KB
/data/struct/struct-meta.<sha12>.json structure-search metadata, one row per unique InChIKey application/json public, max-age=31536000, immutable 808 KB / 287 KB
/data/struct/morgan2048.<sha12>.bin Morgan fingerprints (256 bytes per row) application/octet-stream public, max-age=31536000, immutable 1.48 MB / 272 KB
/data/struct/sslib-pattern.<sha12>.bin RDKit pattern fingerprints for substructure search application/octet-stream public, max-age=31536000, immutable 2.57 MB / 859 KB
/data/struct/struct-props.<sha12>.json descriptors and NPClassifier classes (for filtering in the browser) application/json public, max-age=31536000, immutable 432 KB / 136 KB
/vendor/rdkit/RDKit_minimal.js, /vendor/rdkit/RDKit_minimal.wasm RDKit.js runtime for the browser application/javascript, application/wasm public, max-age=604800 —
/struct-worker.js structure-search program that runs in the browser application/javascript no-cache —
/data/npclassifier/npc-browse.json NPClassifier browsing tree application/json public, max-age=3600 —
/data/errata/tombstones.json notices for withdrawn records application/json public, max-age=3600 —
/compound/mangrove-XXXX permanent record link (see section 4) text/html no-cache —

2. Download files

All under /data/, cached public, max-age=3600.

File Content-Type Size (raw / gzip)
mangrovenp-v0.6-public.json application/json 12.7 MB / 1.35 MB
mangrovenp-v0.6-public.csv text/csv 4.86 MB / 1.03 MB
mangrovenp-v0.6-structures.sdf chemical/x-mdl-sdfile 16.8 MB / 1.88 MB
mangrovenp-v0.6-structures.smi chemical/x-daylight-smiles 786 KB / 251 KB
mangrovenp-v0.6-descriptors.tsv text/tab-separated-values 1.28 MB / 425 KB
mangrovenp-v0.6-npclassifier.tsv text/tab-separated-values 490 KB / 109 KB
mangrovenp-v0.6-literature.json application/json 16.4 MB / 1.39 MB
resources.json application/json 30.0 KB / 5.75 KB
SHA256SUMS text/plain 1.15 MB / 516 KB

See the Data dictionary page for field descriptions and the Help page for how to check checksums.

3. JSON structures

/data/db/db-manifest.json

{schema, release, index, sha256, records, recordsPath}: index is the current index file name (db-index.<sha12>.json), sha256 its checksum, records the number of records and recordsPath the path pattern of the detail files (records/<id>.json).

/data/db/db-index.<sha12>.json

{schema, release, license, notice, stats, taxa, fields, rows}

/data/db/records/{id}.json

{id, structureFrom, recordId, name, formula, smiles, inchiKey, taxa, occurrenceCount, license, alsoListedIn, structureCaution, identifiers, metadata, occurrences}

/data/struct/struct-manifest.json

{schema, release, builtAt, source, sourceSha256, rdkitjs, records, structures, organismTypes, morgan, fields, files}: rdkitjs is the RDKit.js version; records is the number of records (6,234) and structures the number of unique structures (5,773); morgan is {radius: 2, nBits: 2048}; files gives {file, sha256, bytes} for struct-meta, morgan2048, sslib-pattern and struct-props.

/data/npclassifier/npc-browse.json

{schema, source, records, levels, unclassified, notFurtherClassified, note_zh, note_en, nodes}: levels is pathway, superclass, class; nodes is [{level, label, parent, records}], where records is a record count (on the basis of the 6,234 public records). A record with several labels is counted under each of them; records without a label are shown under 「未分类 / Unclassified」. parent is the array of ancestor labels from the top: [] for pathway, [pathway] for superclass, [pathway, superclass] for class. source is {labels_flat, sha256, npclassifier_tsv}; the top-level records is the number of public records (6,234); unclassified and notFurtherClassified give the Chinese and English labels 「未分类 / Unclassified」 and 「未细分 / Not further classified」; there are no other keys.

/data/errata/tombstones.json

{schema, release, source, records}: release is "MangroveNP v0.6"; source is {file, sha256}; records is [{record_id, name, removed_in_version, reason_en, reason_zh}] for the withdrawn records; it contains no structure, SMILES, InChIKey or formula.

4. Permanent links

5. Search parameters (handled in your browser)

The site's search page filters and pages records in your browser using the parameters below; the names are the same as in the old interface, plus new ones. They appear in the page address after #database? (the path is /), for example /#database?q=luteolin&org=plant&mwmin=200&mwmax=400.

Parameter Values Description
q text search terms
type any, name, recordId, inchiKey, formula, smiles search type
database COCONUT, LOTUS, OPSIN filter by structure source (structure_from); a record with several sources (for example both COCONUT and LOTUS) matches each of them. Cross-reference databases (also_listed_in) cannot be filtered and are shown on the record detail only
taxon species name filter by species
status literature_evidence only records with literature evidence
structure available, missing filter by whether a structure is present
sort name, source source sorts by the first item of structureFrom, ties broken by the numeric record number
page, limit positive integers; limit at most 100 paging
org plant, fungus, bacterium, protist, alga, animal, other filter by source organism type. alga, animal and other are reserved values with no records in this release; the interface shows only the four types that have records in this release (plant, fungus, bacterium, protist). A record may belong to more than one type, so the per-type counts add up to more than the total number of records
<k>min, <k>max numbers; k is mw, logp, tpsa, hbd, hba, rotb, lipv, heavy, rings, fsp3 descriptor ranges
mass, masstol, massunit numbers; masstol default 0.005; massunit is da or ppm search by exact mass
veber, glyco 0, 1 meets the Veber rule; is a glycoside
npcp, npcs, npcc a single class name filter by NPClassifier pathway / superclass / class

An unsupported parameter returns {error: "Unsupported parameter"}. The result object is {total, page, limit, scope, notice, records}, each record being {id, structureFrom, recordId, name, formula, smiles, inchiKey, taxa (up to 6), occurrenceCount, license}; structureFrom is an array of strings, never empty. Exports are also built in your browser; "export all filtered" covers every matching record.

6. Rate limits

Requests are rate-limited per IP address: 30 per second, with short bursts of 40–60 allowed; downloads of the SDF, the SMI and the two TSV files (descriptors and NPClassifier) are further limited to 2 per second, with a burst of 4; requests above the limit receive HTTP 429. For bulk use, please download the full data files instead of fetching files one by one.

7. Versioning and stability

Interface versioning and compatibility: The current interface is the v0.6 static API; field changes are recorded in the changelog.

数据许可:CC BY 4.0 · Data licence: CC BY 4.0 — 许可与引用 · License & citation

返回首页 · Back to home