台风实时与历史详情查询免费 API 接口完整教程 一、接口能查到什么接口盒子的这个接口一次性覆盖了实时台风 历史台风两类需求而且数据粒度很细不只是给你一个「台风名字」台风基础信息中文名、英文名、国内编号、国际编号、代号寓意、当前状态移动/停止逐时段实况路径时间、经纬度、强度等级、中心气压、风速、移向、移速风圈半径7 级、10 级、12 级风圈且按东北/东南/西南/西北四个象限分别给出未来预报路径12h / 24h / 36h / 48h / 72h / 96h / 120h 的预测位置、强度、气压、风速换句话说做一个台风路径动画或者影响范围评估这套数据基本够用。二、请求地址与参数请求地址https://cn.apihz.cn/api/tianqi/taifeng.php请求方式GET 或 POST 均可。参数名称必填说明id用户 ID是用户中心的数字 ID如id10000000key用户 KEY是用户中心通讯秘钥year年份否2000 年到当前年传此参数返回当年台风列表与 no 二选一no台风编号否传此参数返回该台风详情与 year 二选一三、两种调用模式模式 1传 year —— 拿某一年台风列表比如year2026返回的是这一年的台风清单里面包含list.no1这个台风唯一编号再用它去查详情。返回核心字段字段含义list.no1台风唯一编号用来查详情list.no2国内编号list.no3国际编号list.namecn中文代号list.nameen英文代号list.explanation代号寓意list.typestart移动stop停止模式 2传 no —— 拿单个台风完整详情这是最常用的姿势。拿到编号后返回的数据包非常完整台风头部信息字段含义no1 / no2 / no3各类编号namecn / nameen中英文名称explanation名字寓意type当前状态datas 路径数据集每个时间点一条字段含义time_ymdh时间点lat / lon中心经纬度position_text坐标描述intensity_code / intensity_text强度代码与中文pressure_hpa中心最低气压wind_speed_ms中心风速intensity_desc强度完整文本move_dir_code / move_dir_text移向move_speed_kmh / move_desc移速wind_radius风圈数据集forecast_babj未来预报节点一般只在最后一个时间段出现风圈 wind_radius 子字段字段含义grade / grade_text风级代码与中文ne/se/sw/nw_radius_km四象限半径avg_radius_km四向平均半径适合快速评估影响范围预报 forecast_babj 子字段字段含义forecast_hour未来小时数target_time_ymdh预报时间lat / lon预测位置pressure_hpa / wind_speed_ms预测气压风速intensity_code / intensity_text预测强度forecast_desc预报描述四、返回数据示例失败返回{code:400,msg:查询失败请重试。}成功返回节选关键结构{ code: 200, no1: 3257931, no2: 2609, no3: 2609, namecn: 巴威, nameen: BAVI, explanation: 位于越南北部的山脉, type: start, datas: [ { time_ymdh: 2026-07-02 08:00:00, lat: 11, lon: 160.1, position_text: 11.0°N, 159.4°E, intensity_code: TS, intensity_text: 热带风暴, pressure_hpa: 998, wind_speed_ms: 18, intensity_desc: 热带风暴中心气压998hPa最大风速18m/s, move_dir_code: WNW, move_dir_text: 西北西, move_speed_kmh: 20, move_desc: 向西北西移动时速20公里, wind_radius: [ { grade: 30KTS, grade_text: 七级, grade_desc: 七级风圈≥17.2m/s风力7级, ne_radius_km: 280, se_radius_km: 180, sw_radius_km: 180, nw_radius_km: 220, avg_radius_km: 215 } ] } ], forecast_babj: [ { forecast_hour: 24, target_time_ymdh: 202607070600, lat: 17.2, lon: 133.4, pressure_hpa: 930, wind_speed_ms: 55, intensity_code: SuperTY, intensity_text: 超强台风, forecast_desc: 24小时后17.2°N, 133.4°E超强台风气压930hPa风速55m/s } ] }五、PHP 调用示例示例 1GET 方式最简单?php $apiUrl https://接口盒子/api/tianqi/taifeng.php; // 替换为自己的 ID 和 KEY $userId 10000000; $userKey 15he5h15ty854j5sr152hs2; // 方式一查 2026 年台风列表 $params [ id $userId, key $userKey, year 2026, no ]; // 方式二查指定台风详情拿到 no1 后使用 // $params [ // id $userId, // key $userKey, // year , // no 3257931 // ]; $url $apiUrl . ? . http_build_query($params); $response file_get_contents($url); $data json_decode($response, true); if ($data[code] 200) { echo 查询成功\n; echo 台风名称{$data[namecn]} ({$data[nameen]})\n; echo 当前状态{$data[type]}\n; foreach ($data[datas] as $item) { echo 时间{$item[time_ymdh]}位置{$item[position_text]}强度{$item[intensity_text]}风速{$item[wind_speed_ms]}m/s\n; } // 未来预报 if (!empty($data[forecast_babj])) { echo \n未来预报\n; foreach ($data[forecast_babj] as $f) { echo {$f[forecast_desc]}\n; } } } else { echo 查询失败{$data[msg]}\n; }示例 2POST 方式cURL更规范?php $apiUrl https://接口盒子/api/tianqi/taifeng.php; $userId 10000000; $userKey 15he5h15ty854j5sr152hs2; $postData [ id $userId, key $userKey, year 2026, no ]; $ch curl_init(); curl_setopt($ch, CURLOPT_URL, $apiUrl); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postData)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_TIMEOUT, 10); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); $response curl_exec($ch); if (curl_errno($ch)) { echo 请求错误 . curl_error($ch); exit; } curl_close($ch); $data json_decode($response, true); header(Content-Type:text/html;charsetutf-8); if ($data[code] 200) { echo h3台风 . $data[namecn] . . $data[nameen] . /h3; echo p代号寓意 . $data[explanation] . /p; echo p当前状态 . $data[type] . /p; echo h4路径数据/h4ul; foreach ($data[datas] as $v) { echo li{$v[time_ymdh]} | {$v[position_text]} | {$v[intensity_text]} | 风速{$v[wind_speed_ms]}m/s | {$v[move_desc]}/li; } echo /ul; } else { echo 接口返回错误 . $data[msg]; }六、Python 调用示例示例 1GET 方式#!/usr/bin/env python3 # -*- coding: utf-8 -*- import requests import json class TyphoonAPI: def __init__(self, uid, ukey): self.url https://接口盒子/api/tianqi/taifeng.php self.uid uid self.ukey ukey def query(self, yearNone, noNone): params { id: self.uid, key: self.ukey, year: year, no: no } try: resp requests.get(self.url, paramsparams, timeout10) resp.raise_for_status() return resp.json() except Exception as e: return {code: 400, msg: f请求异常: {e}} if __name__ __main__: # 替换为自己的 ID 和 KEY api TyphoonAPI(uid10000000, ukey15he5h15ty854j5sr152hs2) # 1. 先查年份列表 data api.query(year2026) # 2. 再查某个台风详情 # data api.query(no3257931) if data.get(code) 200: print(f台风{data.get(namecn)}({data.get(nameen)})) print(f寓意{data.get(explanation)}) print(f状态{data.get(type)}) print(- * 60) for item in data.get(datas, []): print( f{item[time_ymdh]} | f{item[position_text]} | f{item[intensity_text]} | f风速{item[wind_speed_ms]}m/s | f{item[move_desc]} ) # 风圈信息 if data[datas]: last data[datas][-1] for wr in last.get(wind_radius, []): print( f风圈{wr[grade_text]} f四向平均半径{wr[avg_radius_km]}km fNE{wr[ne_radius_km]}/SE{wr[se_radius_km]}/ fSW{wr[sw_radius_km]}/NW{wr[nw_radius_km]} ) # 未来预报 if data.get(forecast_babj): print(\n未来预报) for f in data[forecast_babj]: print(f[forecast_desc]) else: print(f查询失败{data.get(msg)})示例 2POST 方式#!/usr/bin/env python3 # -*- coding: utf-8 -*- 台风 API - Python POST 示例 import requests def query_typhoon(uid, ukey, yearNone, noNone): url https://接口盒子/api/tianqi/taifeng.php data { id: uid, key: ukey, year: year, no: no } try: resp requests.post(url, datadata, timeout10) resp.raise_for_status() return resp.json() except Exception as e: return {code: 400, msg: str(e)} if __name__ __main__: UID 10000000 UKEY 15he5h15ty854j5sr152hs2 result query_typhoon(UID, UKEY, year2026) if result[code] 200: # 如果是列表模式 if list in result: print(2026 年台风列表) for t in result[list]: print( f编号:{t[no1]} f中文名:{t[namecn]} f英文名:{t[nameen]} f状态:{t[type]} ) else: print(f台风详情{result[namecn]}) else: print(f错误{result[msg]})七、常见坑位与注意事项year 和 no 必须传一个两个都空会直接失败推荐先用 year 拿列表、再用 no1 查详情。历史年份范围支持 2000 年到当前年份查不到 1999 年的。强度代码含义TS热带风暴、STS强热带风暴、TY台风、STY强台风、SuperTY超强台风做可视化时可以直接映射颜色。风圈 avg_radius_km 很好用不想画四个象限直接用平均值就能快速圈出影响范围。