CCDB Carbon Emission Factor Search
Queries the Carbonstop CCDB emission factor database via directly calling the public HTTP API.
Prerequisites
Zero dependencies. The tool uses a native Node.js script scripts/ccdb-search.mjs with built-in crypto and fetch. No API Key is needed.
Available Tools
This skill comes with a lightweight CLI script scripts/ccdb-search.mjs that can be executed directly.
You can execute it by running node /workspace/skills/skills/ccdb/scripts/ccdb-search.mjs (replace the path with the actual absolute path to the script).
1. Search Emission Factors (Formatted Output)
Purpose: Search for carbon emission factors by keyword and return human-readable formatted text.
CODEBLOCK0
Parameters:
- *
keyword: Search keyword, e.g., "electricity", "cement", "steel", "natural gas" - INLINECODE6 : (Optional) Target language for the search. Defaults to
zh. Pass en for English.
Returns: Formatted text containing the factor value, unit, applicable region, year, publishing institution, etc.
2. Search Emission Factors (JSON Output)
Purpose: Operates the same as regular search, but returns structured JSON data. Highly recommended for programmatic handling and carbon emission calculations.
CODEBLOCK1
Parameters are identical to formatting search, just append the --json flag.
JSON Return Fields:
| Field | Description |
|---|
| INLINECODE10 | Factor Name |
| INLINECODE11 |
Emission Factor Value |
|
unit | Unit (e.g., kgCO₂e/kWh) |
|
countries | Applicable Countries/Regions |
|
year | Publication Year |
|
institution | Publishing Institution |
|
specification | Specification details |
|
description | Additional description |
|
sourceLevel | Factor source level |
|
business | Industry sector |
|
documentType | Document/Source type |
3. Compare Multiple Emission Factors
Purpose: Compare the carbon emission factors of up to 5 keywords simultaneously. Useful for horizontal comparison of different energy sources or materials.
CODEBLOCK2
Parameters:
- *
--compare: Flag to trigger comparison mode. - INLINECODE22 : List of search keywords, 1-5 items maximum.
Node.js One-Liner (Fallback)
If the script is somehow inaccessible, you can use this standalone Node.js snippet:
CODEBLOCK3
Usage Scenarios & Examples
Scenario 1: Query Emission Factor for a Specific Energy Source
User: What is the carbon emission factor for the Chinese power grid?
→ Action: Execute node /workspace/skills/skills/ccdb/scripts/ccdb-search.mjs "electricity" en or node /workspace/skills/skills/ccdb/scripts/ccdb-search.mjs "中国电网". Find the one corresponding to China and the most recent year.
Scenario 2: Carbon Emission Calculation
User: My company used 500,000 kWh of electricity last year, what is the carbon footprint?
→ Workflow:
- 1. Search the
"electricity" factor (preferably with --json), select China and the latest year. - Calculate Carbon Emissions = 500,000 kWh × Factor Value (in kgCO₂e/kWh).
Scenario 3: Comparing Energy Alternatives
User: Compare the carbon emission factors of electricity, natural gas, and diesel.
→ Action: Execute INLINECODE27
Scenario 4: Querying Industry-Specific Data
User: What is the emission factor for the cement industry?
→ Action: Search using "cement".
Important Notes
- 1. Prioritize China Mainland and the Latest Year: Unless the user specifies another region or year, implicitly prioritize data for China and the most recent year available.
- Pay Close Attention to Unit Conversion: Different factors might have entirely different units (e.g., kgCO₂/kWh vs. tCO₂/TJ). Always double-check before doing mathematical calculations.
- Data Authority / Providers: Take note of the publishing institutions (e.g., MEE, IPCC, IEA, EPA).
- No Results Found? Use Synonyms: If the search yields empty results, attempt to use synonyms (e.g., translate your query, or map "power" → "electricity" → "grid").
- Always Use JSON for Calculations: The
--json format returns highly precise numerical figures that are ideal for programmatic multiplication.
CCDB 碳排放因子搜索
通过直接调用公共HTTP API查询碳阻迹CCDB排放因子数据库。
前置条件
零依赖。该工具使用原生Node.js脚本scripts/ccdb-search.mjs,内置crypto和fetch模块。无需API密钥。
可用工具
本技能附带一个轻量级CLI脚本scripts/ccdb-search.mjs,可直接执行。
通过运行node /workspace/skills/skills/ccdb/scripts/ccdb-search.mjs执行(请将路径替换为脚本的实际绝对路径)。
1. 搜索排放因子(格式化输出)
用途:按关键词搜索碳排放因子,返回人类可读的格式化文本。
bash
node /workspace/skills/skills/ccdb/scripts/ccdb-search.mjs 电力
node /workspace/skills/skills/ccdb/scripts/ccdb-search.mjs electricity en
参数:
- * keyword:搜索关键词,例如electricity、cement、steel、natural gas
- lang:(可选)搜索的目标语言。默认为zh。传入en表示英文。
返回:包含因子值、单位、适用区域、年份、发布机构等的格式化文本。
2. 搜索排放因子(JSON输出)
用途:操作方式与常规搜索相同,但返回结构化JSON数据。强烈推荐用于程序化处理和碳排放计算。
bash
node /workspace/skills/skills/ccdb/scripts/ccdb-search.mjs electricity en --json
参数与格式化搜索相同,只需附加--json标志。
JSON返回字段:
排放因子值 |
| unit | 单位(例如kgCO₂e/kWh) |
| countries | 适用国家/地区 |
| year | 发布年份 |
| institution | 发布机构 |
| specification | 规范详情 |
| description | 附加描述 |
| sourceLevel | 因子来源级别 |
| business | 行业领域 |
| documentType | 文档/来源类型 |
3. 比较多个排放因子
用途:同时比较最多5个关键词的碳排放因子。适用于不同能源或材料的横向对比。
bash
node /workspace/skills/skills/ccdb/scripts/ccdb-search.mjs --compare 电力 天然气 柴油
node /workspace/skills/skills/ccdb/scripts/ccdb-search.mjs --compare electricity natural gas en
node /workspace/skills/skills/ccdb/scripts/ccdb-search.mjs --compare electricity natural gas --json
参数:
- * --compare:触发比较模式的标志。
- keywords:搜索关键词列表,最多1-5个。
Node.js单行命令(备用方案)
如果脚本无法访问,可以使用以下独立的Node.js代码片段:
bash
node -e const c=require(crypto),n=process.argv[1],s=c.createHash(md5).update(mcpccdbsearch+n).digest(hex);fetch(https://gateway.carbonstop.com/management/system/website/searchFactorDataMcp,{method:POST,headers:{Content-Type:application/json},body:JSON.stringify({sign:s,name:n,lang:en})}).then(r=>r.json()).then(d=>console.log(JSON.stringify(d,null,2))) electricity
使用场景与示例
场景1:查询特定能源的排放因子
用户:中国电网的碳排放因子是多少?
→ 操作:执行node /workspace/skills/skills/ccdb/scripts/ccdb-search.mjs electricity en或node /workspace/skills/skills/ccdb/scripts/ccdb-search.mjs 中国电网。找到对应中国且年份最新的数据。
场景2:碳排放计算
用户:我公司去年用电50万度,碳足迹是多少?
→ 工作流程:
- 1. 搜索electricity因子(建议使用--json),选择中国和最新年份。
- 计算碳排放量 = 500,000 kWh × 因子值(单位kgCO₂e/kWh)。
场景3:比较能源替代方案
用户:比较电力、天然气和柴油的碳排放因子。
→ 操作:执行node /workspace/skills/skills/ccdb/scripts/ccdb-search.mjs --compare electricity natural gas diesel en
场景4:查询行业特定数据
用户:水泥行业的排放因子是多少?
→ 操作:使用cement进行搜索。
重要提示
- 1. 优先选择中国大陆和最新年份:除非用户指定其他地区或年份,默认优先选择中国数据和最新可用年份。
- 密切关注单位换算:不同因子的单位可能完全不同(例如kgCO₂/kWh vs tCO₂/TJ)。进行数学计算前务必仔细核对。
- 数据权威性/提供方:注意发布机构(例如生态环境部、IPCC、IEA、EPA)。
- 无搜索结果?使用同义词:如果搜索返回空结果,尝试使用同义词(例如翻译查询词,或将power映射为electricity→grid)。
- 计算时始终使用JSON:--json格式返回高精度数值,非常适合程序化乘法运算。