閃電
這組端點提供中央氣象署偵測到的閃電:每筆有種類(雲對雲或雲對地)、發生時間與座標。伺服器每 30 秒檢查一次來源,來源更新時新增一筆快照,保留 3 天。適合在地圖上畫閃電分布或做雷雨警示。共通格式見氣象 API 概要。
建議標示資料來源:中央氣象署、ExpTech Studio(exptech.dev)
上游條款
- 中央氣象署:另須遵守中央氣象署的資料使用規範(例如政府資料開放授權條款);氣象與地震資訊以中央氣象署發布的內容為準。
標示位置、範例與商業使用申請見資料授權與來源標示。
目前不需要 API Token。
取得最新閃電資料
Section titled “取得最新閃電資料”最新一筆閃電快照。閃電沒有測站,欄位化格式的每個陣列以同一個索引代表同一筆閃電。
curl "https://api.core-tnn1.exptech.dev/api/v5/meteor/lightning"const res = await fetch("https://api.core-tnn1.exptech.dev/api/v5/meteor/lightning");if (!res.ok) throw new Error(`HTTP ${res.status}`);const data = await res.json();console.log(data);import requests
res = requests.get( "https://api.core-tnn1.exptech.dev/api/v5/meteor/lightning", timeout=10,)res.raise_for_status()print(res.json())成功
{ "time": 1794636300, "type": [ 0, 0, 1 ], "t": [ 1794635880, 1794635940, 1794636120 ], "lat": [ 24.802, 24.804, 24.818 ], "lon": [ 121.008, 121.023, 120.978 ]}資料未變更(If-None-Match 相符),沒有 body沒有回應本文
試試看
| 欄位 | 類型 | 說明 |
|---|---|---|
time | number | 這批資料涵蓋區間的結束時間,Unix 秒 |
type | number[] | 閃電種類:0 雲對雲、1 雲對地 |
t | number[] | 每筆閃電的發生時間,Unix 秒 |
lat | number[] | 緯度,小數 4 位 |
lon | number[] | 經度,小數 4 位 |
這段期間沒有閃電時,各陣列為空。伺服器還沒有任何資料時回 {}。
取得快照時間列表
Section titled “取得快照時間列表”目前可查詢的閃電快照時間,差量編碼的 Unix 秒,由舊到新。還原方式見差量時間列表。
curl "https://api.core-tnn1.exptech.dev/api/v5/meteor/lightning/list"const res = await fetch("https://api.core-tnn1.exptech.dev/api/v5/meteor/lightning/list");if (!res.ok) throw new Error(`HTTP ${res.status}`);const data = await res.json();console.log(data);import requests
res = requests.get( "https://api.core-tnn1.exptech.dev/api/v5/meteor/lightning/list", timeout=10,)res.raise_for_status()print(res.json())成功
[ 1794377100, 300, 300, 600]資料未變更(If-None-Match 相符),沒有 body沒有回應本文
試試看
| 欄位 | 類型 | 說明 |
|---|---|---|
[0] | number | 最舊一筆快照的時間,Unix 秒 |
[i](i ≥ 1) | number | 與前一筆的時間差(秒)。只在來源有更新時才有新快照,間隔不固定 |
沒有快照時回 []。
取得指定時刻的閃電資料
Section titled “取得指定時刻的閃電資料”指定時刻的閃電快照,結構與最新閃電資料相同。只在 static.core 提供,api.core 對這個路徑回 404。
路徑參數
time路徑參數。快照時間,10 位 Unix 秒,必須是 /list 裡出現過的值
curl "https://static.core-tnn1.exptech.dev/api/v5/meteor/lightning/<time>"const res = await fetch("https://static.core-tnn1.exptech.dev/api/v5/meteor/lightning/<time>");if (!res.ok) throw new Error(`HTTP ${res.status}`);const data = await res.json();console.log(data);import requests
res = requests.get( "https://static.core-tnn1.exptech.dev/api/v5/meteor/lightning/<time>", timeout=10,)res.raise_for_status()print(res.json())成功,結構同最新閃電資料
{ "time": 1794636000, "type": [ 1 ], "t": [ 1794635710 ], "lat": [ 24.7921 ], "lon": [ 121.0113 ]}資料未變更(If-None-Match 相符),沒有 body沒有回應本文
time 不是整數,或該時刻沒有快照(超過保留期限也是)。沒有 body沒有回應本文
試試看
同最新閃電資料的回應欄位。
- 時間都是 Unix 秒。
time是快照區間的結束時間,個別閃電的時間看t。 - 快照保留 3 天。閃電沒有趨勢與測站目錄端點。
- 資料來源:中央氣象署開放資料的閃電資料。
- 伺服器選擇見氣象 API 概要:時間戳快照走
static.core,其他走api.core,建議直接用 TNN-1 的網址。
