ESG碳排API模組

台灣來修繕ESG碳排API提供完整的碳管理解決方案,從碳排放計算到碳權交易,再到ESG報告生成,一站式滿足企業的碳管理需求。

碳排放計算 API

精確計算Scope 1、2、3碳排放,支援多種計算方法與排放係數來源。

POST /api/v2/carbon/calculate

請求範例

{ "activity_type": "energy", "activity_data": { "energy_type": "electricity", "amount": 1250, "unit": "kWh", "location": "TW" }, "calculation_method": "location-based" }

程式碼範例

// PHP 範例 $url = 'https://api.faucetsolution.com.tw/v2/carbon/calculate'; $data = [ 'activity_type' => 'energy', 'activity_data' => [ 'energy_type' => 'electricity', 'amount' => 1250, 'unit' => 'kWh', 'location' => 'TW' ], 'calculation_method' => 'location-based' ]; $options = [ 'http' => [ 'header' => [ "Authorization: Bearer YOUR_API_KEY", "Content-Type: application/json" ], 'method' => 'POST', 'content' => json_encode($data) ] ]; $context = stream_context_create($options); $result = file_get_contents($url, false, $context); $response = json_decode($result, true);
# Python 範例 import requests url = "https://api.faucetsolution.com.tw/v2/carbon/calculate" headers = { "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json" } data = { "activity_type": "energy", "activity_data": { "energy_type": "electricity", "amount": 1250, "unit": "kWh", "location": "TW" }, "calculation_method": "location-based" } response = requests.post(url, headers=headers, json=data) print(response.json())
// Java 範例 import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import org.json.JSONObject; public class CarbonCalculate { public static void main(String[] args) throws Exception { String url = "https://api.faucetsolution.com.tw/v2/carbon/calculate"; String apiKey = "YOUR_API_KEY"; JSONObject data = new JSONObject(); data.put("activity_type", "energy"); JSONObject activityData = new JSONObject(); activityData.put("energy_type", "electricity"); activityData.put("amount", 1250); activityData.put("unit", "kWh"); activityData.put("location", "TW"); data.put("activity_data", activityData); data.put("calculation_method", "location-based"); HttpClient client = HttpClient.newHttpClient(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create(url)) .header("Authorization", "Bearer " + apiKey) .header("Content-Type", "application/json") .POST(HttpRequest.BodyPublishers.ofString(data.toString())) .build(); HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body()); } }
// C# 範例 using System; using System.Net.Http; using System.Text; using System.Threading.Tasks; class Program { static async Task Main() { var client = new HttpClient(); var request = new HttpRequestMessage { Method = HttpMethod.Post, RequestUri = new Uri("https://api.faucetsolution.com.tw/v2/carbon/calculate"), Headers = { { "Authorization", "Bearer YOUR_API_KEY" } }, Content = new StringContent( "{\"activity_type\":\"energy\"," + "\"activity_data\":{" + "\"energy_type\":\"electricity\"," + "\"amount\":1250," + "\"unit\":\"kWh\"," + "\"location\":\"TW\"}," + "\"calculation_method\":\"location-based\"}", Encoding.UTF8, "application/json") }; var response = await client.SendAsync(request); var content = await response.Content.ReadAsStringAsync(); Console.WriteLine(content); } }

碳權與碳交易鏈 API

管理碳權資產,追蹤區塊鏈碳交易,實現碳抵消。

POST /api/v2/carbon/credits/transaction

請求範例

{ "action": "purchase", "amount": 100, "unit": "kgCO₂e", "currency": "TWD", "payment_method": "credit_card" }

程式碼範例

// PHP 範例 $url = 'https://api.faucetsolution.com.tw/v2/carbon/credits/transaction'; $data = [ 'action' => 'purchase', 'amount' => 100, 'unit' => 'kgCO₂e', 'currency' => 'TWD', 'payment_method' => 'credit_card' ]; $options = [ 'http' => [ 'header' => [ "Authorization: Bearer YOUR_API_KEY", "Content-Type: application/json" ], 'method' => 'POST', 'content' => json_encode($data) ] ]; $context = stream_context_create($options); $result = file_get_contents($url, false, $context); $response = json_decode($result, true);
# Python 範例 import requests url = "https://api.faucetsolution.com.tw/v2/carbon/credits/transaction" headers = { "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json" } data = { "action": "purchase", "amount": 100, "unit": "kgCO₂e", "currency": "TWD", "payment_method": "credit_card" } response = requests.post(url, headers=headers, json=data) print(response.json())
// Java 範例 import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import org.json.JSONObject; public class CarbonTransaction { public static void main(String[] args) throws Exception { String url = "https://api.faucetsolution.com.tw/v2/carbon/credits/transaction"; String apiKey = "YOUR_API_KEY"; JSONObject data = new JSONObject(); data.put("action", "purchase"); data.put("amount", 100); data.put("unit", "kgCO₂e"); data.put("currency", "TWD"); data.put("payment_method", "credit_card"); HttpClient client = HttpClient.newHttpClient(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create(url)) .header("Authorization", "Bearer " + apiKey) .header("Content-Type", "application/json") .POST(HttpRequest.BodyPublishers.ofString(data.toString())) .build(); HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body()); } }
// C# 範例 using System; using System.Net.Http; using System.Text; using System.Threading.Tasks; class Program { static async Task Main() { var client = new HttpClient(); var request = new HttpRequestMessage { Method = HttpMethod.Post, RequestUri = new Uri("https://api.faucetsolution.com.tw/v2/carbon/credits/transaction"), Headers = { { "Authorization", "Bearer YOUR_API_KEY" } }, Content = new StringContent( "{\"action\":\"purchase\"," + "\"amount\":100," + "\"unit\":\"kgCO₂e\"," + "\"currency\":\"TWD\"," + "\"payment_method\":\"credit_card\"}", Encoding.UTF8, "application/json") }; var response = await client.SendAsync(request); var content = await response.Content.ReadAsStringAsync(); Console.WriteLine(content); } }

ESG自評與報告 API

自動生成符合GRI、SASB、TCFD等標準的ESG報告。

POST /api/v2/esg/report

請求範例

{ "organization_id": "org_12345", "reporting_period": { "start_date": "2023-01-01", "end_date": "2023-12-31" }, "framework": "GRI", "language": "zh-TW" }

程式碼範例

// PHP 範例 $url = 'https://api.faucetsolution.com.tw/v2/esg/report'; $data = [ 'organization_id' => 'org_12345', 'reporting_period' => [ 'start_date' => '2023-01-01', 'end_date' => '2023-12-31' ], 'framework' => 'GRI', 'language' => 'zh-TW' ]; $options = [ 'http' => [ 'header' => [ "Authorization: Bearer YOUR_API_KEY", "Content-Type: application/json" ], 'method' => 'POST', 'content' => json_encode($data) ] ]; $context = stream_context_create($options); $result = file_get_contents($url, false, $context); $response = json_decode($result, true);
# Python 範例 import requests url = "https://api.faucetsolution.com.tw/v2/esg/report" headers = { "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json" } data = { "organization_id": "org_12345", "reporting_period": { "start_date": "2023-01-01", "end_date": "2023-12-31" }, "framework": "GRI", "language": "zh-TW" } response = requests.post(url, headers=headers, json=data) print(response.json())
// Java 範例 import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import org.json.JSONObject; public class ESGReport { public static void main(String[] args) throws Exception { String url = "https://api.faucetsolution.com.tw/v2/esg/report"; String apiKey = "YOUR_API_KEY"; JSONObject data = new JSONObject(); data.put("organization_id", "org_12345"); JSONObject reportingPeriod = new JSONObject(); reportingPeriod.put("start_date", "2023-01-01"); reportingPeriod.put("end_date", "2023-12-31"); data.put("reporting_period", reportingPeriod); data.put("framework", "GRI"); data.put("language", "zh-TW"); HttpClient client = HttpClient.newHttpClient(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create(url)) .header("Authorization", "Bearer " + apiKey) .header("Content-Type", "application/json") .POST(HttpRequest.BodyPublishers.ofString(data.toString())) .build(); HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body()); } }
// C# 範例 using System; using System.Net.Http; using System.Text; using System.Threading.Tasks; class Program { static async Task Main() { var client = new HttpClient(); var request = new HttpRequestMessage { Method = HttpMethod.Post, RequestUri = new Uri("https://api.faucetsolution.com.tw/v2/esg/report"), Headers = { { "Authorization", "Bearer YOUR_API_KEY" } }, Content = new StringContent( "{\"organization_id\":\"org_12345\"," + "\"reporting_period\":{" + "\"start_date\":\"2023-01-01\"," + "\"end_date\":\"2023-12-31\"}," + "\"framework\":\"GRI\"," + "\"language\":\"zh-TW\"}", Encoding.UTF8, "application/json") }; var response = await client.SendAsync(request); var content = await response.Content.ReadAsStringAsync(); Console.WriteLine(content); } }

ESG評分與碳排摘要 API

查詢組織的ESG評分與碳排摘要資訊。

GET /api/v1/esg/report?organization_id={organization_id}&year={year}

請求參數

參數 類型 說明
organization_id string 必填,組織唯一識別碼
year number 選填,年份,預設當前年份

回應範例

{ "status": "success", "data": { "organization_id": "org_12345", "year": 2023, "esg_score": 78.5, "esg_rating": "A", "carbon_footprint": { "scope_1": 1250.5, "scope_2": 2450.2, "scope_3": 3820.7, "unit": "kgCO₂e" }, "carbon_intensity": 12.5, "intensity_unit": "kgCO₂e/萬元營收", "reduction_target": 30.0, "target_year": 2030, "compliance": [ "ISO 14064", "GHG Protocol", "TCFD" ] } }

程式碼範例

// PHP 範例 $url = 'https://api.faucetsolution.com.tw/v1/esg/report?organization_id=org_12345&year=2023'; $options = [ 'http' => [ 'header' => [ "Authorization: Bearer YOUR_API_KEY", "Content-Type: application/json" ], 'method' => 'GET' ] ]; $context = stream_context_create($options); $result = file_get_contents($url, false, $context); $response = json_decode($result, true);
# Python 範例 import requests url = "https://api.faucetsolution.com.tw/v1/esg/report" params = { "organization_id": "org_12345", "year": 2023 } headers = { "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers, params=params) result = response.json()
// Java 範例 import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; public class ESGReportSummary { public static void main(String[] args) throws Exception { String organizationId = "org_12345"; int year = 2023; String url = "https://api.faucetsolution.com.tw/v1/esg/report?organization_id=" + URLEncoder.encode(organizationId, StandardCharsets.UTF_8) + "&year=" + year; String apiKey = "YOUR_API_KEY"; HttpClient client = HttpClient.newHttpClient(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create(url)) .header("Authorization", "Bearer " + apiKey) .header("Content-Type", "application/json") .GET() .build(); HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body()); } }
// C# 範例 using System; using System.Net.Http; using System.Threading.Tasks; class Program { static async Task Main() { var client = new HttpClient(); var request = new HttpRequestMessage { Method = HttpMethod.Get, RequestUri = new Uri("https://api.faucetsolution.com.tw/v1/esg/report?organization_id=org_12345&year=2023"), Headers = { { "Authorization", "Bearer YOUR_API_KEY" } } }; var response = await client.SendAsync(request); var content = await response.Content.ReadAsStringAsync(); Console.WriteLine(content); } }

碳足跡查詢 API

查詢單一設備或部門的詳細碳足跡資訊。

GET /api/v1/esg/carbon-footprint?entity_id={entity_id}&entity_type={entity_type}&year={year}

請求參數

參數 類型 說明
entity_id string 必填,設備或部門ID
entity_type string 必填,實體類型 (device, department)
year number 選填,年份,預設當前年份
granularity string 選填,數據粒度 (month, quarter, year),預設month

回應範例

{ "status": "success", "data": { "entity_id": "dev_12345", "entity_type": "device", "year": 2023, "total_carbon_footprint": 1250.5, "unit": "kgCO₂e", "breakdown": { "electricity": 850.3, "fuel": 250.2, "water": 50.0, "waste": 100.0 }, "monthly_trend": [ { "month": "2023-01", "carbon_footprint": 105.2, "electricity_usage": 720.5, "unit": "kWh" }, { "month": "2023-02", "carbon_footprint": 98.7, "electricity_usage": 680.3, "unit": "kWh" } ], "comparison": { "industry_average": 1500.0, "best_practice": 800.0 } } }

程式碼範例

// PHP 範例 $url = 'https://api.faucetsolution.com.tw/v1/esg/carbon-footprint?entity_id=dev_12345&entity_type=device&year=2023'; $options = [ 'http' => [ 'header' => [ "Authorization: Bearer YOUR_API_KEY", "Content-Type: application/json" ], 'method' => 'GET' ] ]; $context = stream_context_create($options); $result = file_get_contents($url, false, $context); $response = json_decode($result, true);
# Python 範例 import requests url = "https://api.faucetsolution.com.tw/v1/esg/carbon-footprint" params = { "entity_id": "dev_12345", "entity_type": "device", "year": 2023 } headers = { "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers, params=params) result = response.json()
// Java 範例 import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; public class CarbonFootprint { public static void main(String[] args) throws Exception { String entityId = "dev_12345"; String entityType = "device"; int year = 2023; String url = "https://api.faucetsolution.com.tw/v1/esg/carbon-footprint?entity_id=" + URLEncoder.encode(entityId, StandardCharsets.UTF_8) + "&entity_type=" + URLEncoder.encode(entityType, StandardCharsets.UTF_8) + "&year=" + year; String apiKey = "YOUR_API_KEY"; HttpClient client = HttpClient.newHttpClient(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create(url)) .header("Authorization", "Bearer " + apiKey) .header("Content-Type", "application/json") .GET() .build(); HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body()); } }
// C# 範例 using System; using System.Net.Http; using System.Threading.Tasks; class Program { static async Task Main() { var client = new HttpClient(); var request = new HttpRequestMessage { Method = HttpMethod.Get, RequestUri = new Uri("https://api.faucetsolution.com.tw/v1/esg/carbon-footprint?entity_id=dev_12345&entity_type=device&year=2023"), Headers = { { "Authorization", "Bearer YOUR_API_KEY" } } }; var response = await client.SendAsync(request); var content = await response.Content.ReadAsStringAsync(); Console.WriteLine(content); } }

碳權估算 API

估算節能措施可產生的碳權(Carbon Credit)數量。

GET /api/v1/esg/carbon-credit-estimate?project_id={project_id}&methodology={methodology}

請求參數

參數 類型 說明
project_id string 必填,節能項目ID
methodology string 選填,碳權計算方法學,預設ACM0002

回應範例

{ "status": "success", "data": { "project_id": "proj_12345", "methodology": "ACM0002", "estimated_credits": 125.5, "unit": "tCO₂e", "credits_per_year": 25.1, "estimated_revenue": 12550.0, "currency": "TWD", "verification_cost": 2500.0, "currency": "TWD", "breakdown": { "baseline_emissions": 150.2, "project_emissions": 24.7, "leakage": 0.0, "unit": "tCO₂e/year" }, "certification_process": [ "PDD開發", "第三方驗證", "註冊", "監測", "核發" ], "estimated_timeline": { "pdd_development": 30, "validation": 60, "registration": 90, "first_verification": 180, "unit": "days" } } }

程式碼範例

// PHP 範例 $url = 'https://api.faucetsolution.com.tw/v1/esg/carbon-credit-estimate?project_id=proj_12345&methodology=ACM0002'; $options = [ 'http' => [ 'header' => [ "Authorization: Bearer YOUR_API_KEY", "Content-Type: application/json" ], 'method' => 'GET' ] ]; $context = stream_context_create($options); $result = file_get_contents($url, false, $context); $response = json_decode($result, true);
# Python 範例 import requests url = "https://api.faucetsolution.com.tw/v1/esg/carbon-credit-estimate" params = { "project_id": "proj_12345", "methodology": "ACM0002" } headers = { "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json" } response = requests.get(url, headers=headers, params=params) result = response.json()
// Java 範例 import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; public class CarbonCreditEstimate { public static void main(String[] args) throws Exception { String projectId = "proj_12345"; String methodology = "ACM0002"; String url = "https://api.faucetsolution.com.tw/v1/esg/carbon-credit-estimate?project_id=" + URLEncoder.encode(projectId, StandardCharsets.UTF_8) + "&methodology=" + URLEncoder.encode(methodology, StandardCharsets.UTF_8); String apiKey = "YOUR_API_KEY"; HttpClient client = HttpClient.newHttpClient(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create(url)) .header("Authorization", "Bearer " + apiKey) .header("Content-Type", "application/json") .GET() .build(); HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body()); } }
// C# 範例 using System; using System.Net.Http; using System.Threading.Tasks; class Program { static async Task Main() { var client = new HttpClient(); var request = new HttpRequestMessage { Method = HttpMethod.Get, RequestUri = new Uri("https://api.faucetsolution.com.tw/v1/esg/carbon-credit-estimate?project_id=proj_12345&methodology=ACM0002"), Headers = { { "Authorization", "Bearer YOUR_API_KEY" } } }; var response = await client.SendAsync(request); var content = await response.Content.ReadAsStringAsync(); Console.WriteLine(content); } }

碳排放趨勢

您的組織最近12個月的碳排放趨勢分析。

碳權餘額

當前碳權持有量與交易記錄。

ESG評分趨勢

您的組織ESG評分隨時間變化趨勢。

合規標準

ISO 14064 GHG Protocol TCFD SASB GRI