Standards

Overview

The Chinese national standards catalogue: which GB applies, its status, and whether the text is public. Catalogue only, not the text.

status
live
document id
std_code e.g. GB/T 42729-2023
citation
[GB/T 42729-2023]
updated
2026-10

Common calls

Find standardsPOST /v1/standards/search {"query": "锂离子电池安全", "filters": {"state": "现行"}}
Read one entryGET /v1/standards/read/GB%2FT%2042729-2023
The fine print
  • Metadata only: the text itself is on openstd (the `fulltext` flag says whether openstd has it online).
  • English titles and tags are generated from the Chinese title alone — not authoritative translations.
  • 48,406 are in force and 28,535 withdrawn — filter state=现行 before citing.
  • The index holds no full text: level=full is not available yet (the standard text is not in this corpus — see openstd.samr.gov.cn).

Read

GET/v1/standards/read/{std_code}
Three depths. detail is the default. Free sample: GB/T 42729-2023.

Levels

levelcreditsreturns
brief1Card: the fields needed to triage, same as in search hits
detail (default)2Every structured field (rule-derived plus model-generated; model fields are listed in _enrich.fields)
full5Full text (not available yet: the standard text is not in this corpus — see openstd.samr.gov.cn)

Parameters

ParameterTypeDescription
std_code (path) REQUIRED string Document id (std_code).
level brief · detail · full= detail How deep to read.
format json · md · html= json Response shape.

Example

{ "domain": "standards", "id": "GB/T 42729-2023", "level": "detail", "view": "head", "data": { … } | "text": "…", "token_count": 1834, "meta": { … } }
The older GET /v1/standards/doc/{id}?view=… still works.

Read many

POST/v1/standards/read
Up to 50 ids, one level. Missing ids come back with error: "not_found" and are not charged.

Parameters

ParameterTypeDescription
ids REQUIRED string[] Document ids.
level brief · detail · full= detail Level for every id.

Example

{ "domain": "standards", "level": "detail", "docs": [ { "id": "…", "data": { … } }, { "id": "…", "error": "not_found" } ], "meta": { … } }

Facets

GET/v1/standards/facets?field={field}
Legal values for a filter field, so an agent never guesses; precomputed fields carry counts, declared enums come without. Free, no key.

Parameters

ParameterTypeDescription
field REQUIRED nature · state · std_prefix · ics Filter field with facets.
limit integer= 50 Max values.

Example

{ "domain": "standards", "field": "…", "values": [ { "value": "…", "count": 3120 } ], "meta": { … } }

Askregistered key+ /stream

POST/v1/standards/ask
Agentic Q&A, with one boundary up front: this domain holds catalogue metadata only, no clause text. It can answer which standards exist, how they are classified, whether they are in force and when they take effect; it cannot answer what a clause says — it will say so and point at openstd. Citations are [standards: ]. <code>effort</code> low / medium / high = 50 / 100 / 200 credits. Append <code>/stream</code> for NDJSON; the first event is always <code>billing</code>. A failure before the first <code>answer_delta</code> is refunded.</div> <h4>Parameters</h4> <div class="tblwrap"><table class="tbl t3 tparam"> <thead><tr><th>Parameter</th><th>Type</th><th>Description</th></tr></thead> <tbody> <tr> <td>query<span class="req"> REQUIRED</span></td> <td class="ty">string</td> <td>1–2000 characters. Be specific; ask for numbers if you want numbers.</td> </tr><tr> <td>effort</td> <td class="ty">low · medium · high<span class="def">= low</span></td> <td>Reading rounds, and the price: 50 / 100 / 200 credits. Your plan caps it.</td> </tr><tr> <td>verbose</td> <td class="ty">bool<span class="def">= false</span></td> <td>Include the tool-call trace (tool_call / tool_result / thinking events when streaming).</td> </tr><tr> <td>top_k</td> <td class="ty">integer<span class="def">= 10</span></td> <td>Speculative prefetch size.</td> </tr><tr> <td>stream_answer</td> <td class="ty">bool<span class="def">= true</span></td> <td>Streaming only: false emits one answer event instead of deltas.</td> </tr><tr> <td>max_rounds</td> <td class="ty">integer</td> <td>0–8, overrides the effort preset.</td> </tr><tr> <td>force_answer_after</td> <td class="ty">number</td> <td>Seconds; hard cutover into the answer phase.</td> </tr><tr> <td>max_answer_tokens</td> <td class="ty">integer<span class="def">= 4096</span></td> <td>Hitting it sets answer_truncated.</td> </tr><tr> <td>language</td> <td class="ty">string</td> <td>Answer language; defaults to the query’s.</td> </tr> </tbody> </table></div> <h4>Example</h4> <pre class="code">{ "answer": "… [GB/T 42729-2023] …", "sources": [ … ], "stats": { "rounds": 1, "elapsed_s": 6.2, "answer_truncated": false }, "coverage"?: { … }, "meta": { "credits": { "charged": 50, … } } }</pre> <div class="callout "><b>Citations are real</b> — every id in <code>answer</code> exists in this domain (format <code>[GB/T 42729-2023]</code>). <b><code>sources</code> is the retrieval set</b>, not the citation list. <b><code>answer_truncated</code> means incomplete.</b></div> </section> </div> </div> <aside class="pg" data-playground> <div class="pg-handle" data-pg-handle></div> <div class="pg-head"><b>Playground</b><span class="hint">Follows the section you are reading</span><button class="icon-btn" data-pg-close type="button" aria-label="Close">✕</button></div> <div class="pg-body" data-pg-body></div> <script type="application/json" data-pg-specs>[{"id":"standards-search","domain":"standards","method":"POST","path":"/v1/standards/search","auth":"optional","status":"live","title":{"en":"Search","zh":"检索"},"summary":{"en":"Hybrid retrieval, one card per hit. 2 credits. Free sample: <code>锂离子电池 安全</code>.<h4 class=\"sub\">Filter fields</h4><div class=\"tblwrap\"><table class=\"tbl t3\"><thead><tr><th>field</th><th>type · ops</th><th>meaning</th></tr></thead><tbody><tr><td class=\"mono\">nature</td><td class=\"mono dim\">keyword · eq any<span class=\"vals\">强制性 · 推荐性 · 指导性技术文件</span></td><td>Nature: mandatory / recommended / guiding</td></tr><tr><td class=\"mono\">state</td><td class=\"mono dim\">keyword · eq any<span class=\"vals\">现行 · 即将实施 · 废止 · 暂不实施</span></td><td>Status: in force / coming into force / withdrawn / suspended</td></tr><tr><td class=\"mono\">std_prefix</td><td class=\"mono dim\">keyword · eq any<span class=\"vals\">GB · GB/T · GB/Z</span></td><td>Code prefix</td></tr><tr><td class=\"mono\">ics</td><td class=\"mono dim\">keyword · eq any</td><td>ICS top-level class (see facets)</td></tr><tr><td class=\"mono\">is_mandatory</td><td class=\"mono dim\">bool · eq</td><td>Mandatory</td></tr><tr><td class=\"mono\">issue_year</td><td class=\"mono dim\">integer · eq range</td><td>Issue year, range</td></tr><tr><td class=\"mono\">act_year</td><td class=\"mono dim\">integer · eq range</td><td>Effective year, range</td></tr></tbody></table></div><details class=\"adv\"><summary>1 more, all usable</summary><div class=\"tblwrap\"><table class=\"tbl t3\"><thead><tr><th>field</th><th>type · ops</th><th>meaning</th></tr></thead><tbody><tr><td class=\"mono\">tags</td><td class=\"mono dim\">keyword · eq any</td><td>Topic tags (model-generated)</td></tr></tbody></table></div></details>","zh":"混合检索,每条命中一张卡片。2 credits。免费样例:<code>锂离子电池 安全</code>。<h4 class=\"sub\">过滤字段</h4><div class=\"tblwrap\"><table class=\"tbl t3\"><thead><tr><th>字段</th><th>类型 · op</th><th>含义</th></tr></thead><tbody><tr><td class=\"mono\">nature</td><td class=\"mono dim\">keyword · eq any<span class=\"vals\">强制性 · 推荐性 · 指导性技术文件</span></td><td>性质</td></tr><tr><td class=\"mono\">state</td><td class=\"mono dim\">keyword · eq any<span class=\"vals\">现行 · 即将实施 · 废止 · 暂不实施</span></td><td>状态</td></tr><tr><td class=\"mono\">std_prefix</td><td class=\"mono dim\">keyword · eq any<span class=\"vals\">GB · GB/T · GB/Z</span></td><td>标准号前缀</td></tr><tr><td class=\"mono\">ics</td><td class=\"mono dim\">keyword · eq any</td><td>ICS 一级分类号(见 facets;13 环保安全、35 信息技术、77 冶金…)</td></tr><tr><td class=\"mono\">is_mandatory</td><td class=\"mono dim\">bool · eq</td><td>是否强制性</td></tr><tr><td class=\"mono\">issue_year</td><td class=\"mono dim\">integer · eq range</td><td>发布年份区间</td></tr><tr><td class=\"mono\">act_year</td><td class=\"mono dim\">integer · eq range</td><td>实施年份区间</td></tr></tbody></table></div><details class=\"adv\"><summary>还有 1 个,照样能用</summary><div class=\"tblwrap\"><table class=\"tbl t3\"><thead><tr><th>字段</th><th>类型 · op</th><th>含义</th></tr></thead><tbody><tr><td class=\"mono\">tags</td><td class=\"mono dim\">keyword · eq any</td><td>主题标签(模型生成)</td></tr></tbody></table></div></details>"},"params":[{"name":"query","type":"string","required":true,"in":"body","example":"锂离子电池 安全","desc":{"en":"1–1000 characters. Or an array of up to 5 (batch; hits become results[]).","zh":"1–1000 字符。也可以是最多 5 条的数组(批量,hits 变 results[])。"}},{"name":"top_k","type":"integer","default":"10","in":"body","desc":{"en":"1–100.","zh":"1–100。"}},{"name":"fields","type":"enum","options":["brief","head"],"default":"brief","in":"body","desc":{"en":"head costs one more credit and returns the head view per hit.","zh":"head 多扣 1 credit,每条附 head 视图。"}},{"name":"filters","type":"json","in":"body","example":"","desc":{"en":"Filter DSL object (see Getting started); declared fields are listed above.","zh":"过滤 DSL 对象(见快速开始);可用字段见上表。"}},{"name":"mode","type":"enum","options":["hybrid","dense","bm25"],"default":"hybrid","in":"body","advanced":false,"desc":{"en":"Retrieval mode. Leave it out to use the first.","zh":"检索模式。不传就用第一个。"}},{"name":"offset","type":"integer","default":"0","in":"body","advanced":true,"desc":{"en":"Pagination.","zh":"翻页。"}}],"example":"{ \"domain\": \"standards\", \"query\": \"…\", \"hits\": [ { \"id\": \"GB/T 42729-2023\", \"score\": 0.83, \"brief\": { … } } ], \"total\": null, \"coverage\": …, \"warnings\": [],\n \"meta\": { \"request_id\": \"req_…\", \"credits\": { \"charged\": 2, \"balance\": 1998, \"pool\": \"allowance\" }, \"latency_ms\": 41, \"cached\": false } }","notes":[{"html":{"en":"<b>Undeclared filter fields return 400</b> rather than being ignored silently. Filters combine with AND; <code>_or</code> / <code>_not</code> are available.","zh":"<b>用了未声明的过滤字段返回 400</b>,不会静默忽略。过滤条件是 AND;可用 <code>_or</code> / <code>_not</code>。"}}]},{"id":"standards-read","domain":"standards","method":"GET","path":"/v1/standards/read/{std_code}","auth":"optional","status":"live","title":{"en":"Read","zh":"读"},"summary":{"en":"Three depths. <code>detail</code> is the default. Free sample: <code>GB/T 42729-2023</code>.<h4 class=\"sub\">Levels</h4><div class=\"tblwrap\"><table class=\"tbl t3 tnum\"><thead><tr><th>level</th><th>credits</th><th>returns</th></tr></thead><tbody><tr><td class=\"mono\">brief</td><td class=\"mono num\">1</td><td>Card: the fields needed to triage, same as in search hits</td></tr><tr><td class=\"mono\">detail <span class=\"dim\">(default)</span></td><td class=\"mono num\">2</td><td>Every structured field (rule-derived plus model-generated; model fields are listed in _enrich.fields)</td></tr><tr><td class=\"mono\">full</td><td class=\"mono num\">5</td><td>Full text (not available yet: the standard text is not in this corpus — see openstd.samr.gov.cn)</td></tr></tbody></table></div>","zh":"三档深浅,不传就是 <code>detail</code>。免费样例:<code>GB/T 42729-2023</code>。<h4 class=\"sub\">三档</h4><div class=\"tblwrap\"><table class=\"tbl t3 tnum\"><thead><tr><th>深浅</th><th>credits</th><th>返回</th></tr></thead><tbody><tr><td class=\"mono\">brief</td><td class=\"mono num\">1</td><td>卡片:做取舍够用的字段(检索结果里那张)</td></tr><tr><td class=\"mono\">detail <span class=\"dim\">(默认)</span></td><td class=\"mono num\">2</td><td>全部结构化字段(规则字段 + 模型字段,模型字段在 _enrich.fields 里列名)</td></tr><tr><td class=\"mono\">full</td><td class=\"mono num\">5</td><td>全文(建设中:条文正文不公开在本库,去 openstd 官网(openstd.samr.gov.cn))</td></tr></tbody></table></div>"},"params":[{"name":"std_code","type":"string","required":true,"in":"path","example":"GB/T 42729-2023","desc":{"en":"Document id (std_code).","zh":"文档 id(std_code)。"}},{"name":"level","type":"enum","options":["brief","detail","full"],"default":"detail","desc":{"en":"How deep to read.","zh":"读多深。"}},{"name":"format","type":"enum","options":["json","md","html"],"default":"json","desc":{"en":"Response shape.","zh":"响应形态。"}}],"example":"{ \"domain\": \"standards\", \"id\": \"GB/T 42729-2023\", \"level\": \"detail\", \"view\": \"head\", \"data\": { … } | \"text\": \"…\", \"token_count\": 1834, \"meta\": { … } }","notes":[{"html":{"en":"The older <code>GET /v1/standards/doc/{id}?view=…</code> still works.","zh":"旧写法 <code>GET /v1/standards/doc/{id}?view=…</code> 仍然可用。"}}]},{"id":"standards-read-batch","domain":"standards","method":"POST","path":"/v1/standards/read","auth":"token","status":"live","title":{"en":"Read many","zh":"批量读"},"summary":{"en":"Up to 50 ids, one level. Missing ids come back with <code>error: \"not_found\"</code> and are not charged.","zh":"最多 50 个 id,同一档。查不到的 id 返回 <code>error: \"not_found\"</code>,不扣费。"},"params":[{"name":"ids","type":"array","list":true,"required":true,"in":"body","example":"GB/T 42729-2023","desc":{"en":"Document ids.","zh":"文档 id 列表。"}},{"name":"level","type":"enum","options":["brief","detail","full"],"default":"detail","in":"body","desc":{"en":"Level for every id.","zh":"所有 id 共用的档。"}}],"example":"{ \"domain\": \"standards\", \"level\": \"detail\", \"docs\": [ { \"id\": \"…\", \"data\": { … } }, { \"id\": \"…\", \"error\": \"not_found\" } ], \"meta\": { … } }"},{"id":"standards-facets","domain":"standards","method":"GET","path":"/v1/standards/facets","auth":"none","status":"live","title":{"en":"Facets","zh":"Facets"},"summary":{"en":"Legal values for a filter field, so an agent never guesses; precomputed fields carry counts, declared enums come without. Free, no key.","zh":"某个过滤字段的合法值,agent 不用猜;预聚合字段带计数,声明的枚举没有。免费、不需要 key。"},"params":[{"name":"field","type":"enum","options":["nature","state","std_prefix","ics"],"required":true,"example":"nature","desc":{"en":"Filter field with facets.","zh":"有 facets 的过滤字段。"}},{"name":"limit","type":"integer","default":"50","advanced":true,"desc":{"en":"Max values.","zh":"最多返回多少个值。"}}],"example":"{ \"domain\": \"standards\", \"field\": \"…\", \"values\": [ { \"value\": \"…\", \"count\": 3120 } ], \"meta\": { … } }"},{"id":"standards-ask","domain":"standards","method":"POST","path":"/v1/standards/ask","auth":"registered","status":"live","stream":true,"agentic":true,"title":{"en":"Ask","zh":"问"},"summary":{"en":"Agentic Q&A, with one boundary up front: this domain holds catalogue metadata only, no clause text. It can answer which standards exist, how they are classified, whether they are in force and when they take effect; it cannot answer what a clause says — it will say so and point at openstd. Citations are [standards:<std_code> <title>]. <code>effort</code> low / medium / high = 50 / 100 / 200 credits. Append <code>/stream</code> for NDJSON; the first event is always <code>billing</code>. A failure before the first <code>answer_delta</code> is refunded.","zh":"本域的 agentic 问答,但先看清边界:**只有目录元数据,没有条文正文**。能回答「有哪些标准、什么分类、现行还是废止、什么时候实施」;回答不了「某条怎么规定的」——问到正文时会说明并给出去 openstd 官网的指引。引用写成 [standards:<std_code> <标题>]。<code>effort</code> low / medium / high 对应 50 / 100 / 200 credits。加 <code>/stream</code> 走 NDJSON,第一个事件一定是 <code>billing</code>。首个 <code>answer_delta</code> 之前失败会退款。"},"params":[{"name":"query","type":"string","required":true,"in":"body","example":"锂离子电池 安全","desc":{"en":"1–2000 characters. Be specific; ask for numbers if you want numbers.","zh":"1–2000 字符。问得具体;要数字就直接问数字。"}},{"name":"effort","type":"enum","options":["low","medium","high"],"default":"low","in":"body","desc":{"en":"Reading rounds, and the price: 50 / 100 / 200 credits. Your plan caps it.","zh":"检索轮数,也决定价格:50 / 100 / 200 credits。套餐限制最高档。"}},{"name":"verbose","type":"bool","default":"false","in":"body","desc":{"en":"Include the tool-call trace (tool_call / tool_result / thinking events when streaming).","zh":"返回工具调用轨迹(流式时多 tool_call / tool_result / thinking 事件)。"}},{"name":"top_k","type":"integer","default":"10","in":"body","advanced":true,"desc":{"en":"Speculative prefetch size.","zh":"预取候选数。"}},{"name":"stream_answer","type":"bool","default":"true","in":"body","advanced":true,"desc":{"en":"Streaming only: false emits one answer event instead of deltas.","zh":"仅流式:false 时只发一个 answer 事件。"}},{"name":"max_rounds","type":"integer","in":"body","advanced":true,"desc":{"en":"0–8, overrides the effort preset.","zh":"0–8,覆盖 effort 预设。"}},{"name":"force_answer_after","type":"number","in":"body","advanced":true,"desc":{"en":"Seconds; hard cutover into the answer phase.","zh":"秒;强制切入作答阶段。"}},{"name":"max_answer_tokens","type":"integer","default":"4096","in":"body","advanced":true,"desc":{"en":"Hitting it sets answer_truncated.","zh":"触顶时置 answer_truncated。"}},{"name":"language","type":"string","in":"body","advanced":true,"desc":{"en":"Answer language; defaults to the query’s.","zh":"回答语言,默认跟随 query。"}}],"example":"{ \"answer\": \"… [GB/T 42729-2023] …\", \"sources\": [ … ], \"stats\": { \"rounds\": 1, \"elapsed_s\": 6.2, \"answer_truncated\": false }, \"coverage\"?: { … }, \"meta\": { \"credits\": { \"charged\": 50, … } } }","notes":[{"html":{"en":"<b>Citations are real</b> — every id in <code>answer</code> exists in this domain (format <code>[GB/T 42729-2023]</code>). <b><code>sources</code> is the retrieval set</b>, not the citation list. <b><code>answer_truncated</code> means incomplete.</b>","zh":"<b>引用是真的</b>——<code>answer</code> 里的每个 id 都存在于本垂域(格式 <code>[GB/T 42729-2023]</code>)。<b><code>sources</code> 是召回集</b>,不是引用列表。<b><code>answer_truncated</code> 表示不完整。</b>"}}]}]</script> <script type="application/json" data-pg-strings>{"title":"Playground","hint":"Follows the section you are reading","token":"API token","tokenHint":"fa_live_… key · optional for free samples · stored in this browser only","tokenReq":"API key required (fa_live_…)","send":"Send request","stream":"Stream","response":"Response","events":"Events","answer":"Answer","sources":"Sources","cited":"cited","retrieved":"retrieved","stats":"Stats","coming":"This domain is still building. The request shape is final; sending is disabled until it is live.","open":"Playground","close":"Close","tokens":"tokens","chars":"characters","truncated":"answer truncated","code":"Code","openTab":"Open in a new tab","report":"This one is wrong — report it","quotaHit":"Daily quota used up ({used} / {limit}, resets {reset}). It is a quota, not a rate limit, so retrying will not help: write to {mail} about {grant}.","rateHit":"Over your rpm. Retry in {n} s.","lang":"en","apiBase":"https://api.1stauthor.com","codeBase":"https://api.1stauthor.com","keys":"/dashboard/keys/","fb":"/feedback/","contact":"tommy@chien.io"}</script> </aside> <button class="btn btn-primary pg-fab" data-pg-open type="button">Playground</button> <script type="module" src="/_astro/DocsShell.astro_astro_type_script_index_0_lang.cOZozF12.js"></script> </main> <script type="module" src="/_astro/Base.astro_astro_type_script_index_0_lang.B9qjIrvh.js"></script> </body> </html>