清華大學變電站即時負載 API 使用說明
API 端點
API 回應範例
{
"station": "North 1",
"time": "2023-10-17 03:03:38",
"value": 3608
}
API 使用範例
PHP
// Sample PHP code
$url = "https://powerapi.tsinghua.tw/n1";
$response = file_get_contents($url);
$data = json_decode($response, true);
echo "Current Load: " . $data['value'] . " kW";
cURL
// Sample cURL command
curl https://powerapi.tsinghua.tw/n1
Python
# Sample Python code
import requests
url = "https://powerapi.tsinghua.tw/n1";
response = requests.get(url);
data = response.json();
print("Current Load:", data['value'], "kW");