API Professional Service
台风预警
台风预警,我们致力于为用户提供专业的免费 API 数据接口服务
返回接口列表
GET
台风预警
v1.0最后更新:2026-10-23 21:53:04
免费
调用次数:295
正常运行
响应速度:310 ms
无需API密钥
台风预警
台风预警(实时):西北太平洋/南海台风一旦出编号(如 2026 年第 30 号「蔷琵」)即可查询,返回最新定位、强度、中心气压、风圈半径、移动方向,以及中央气象台未来 120 小时预报路径。数据源中央气象台台风网 typhoon.nmc.cn,缓存 60 秒,默认纯文本播报,传 format=json 取结构化数据。
总调用:295
今日:0
格式:text/plain
接口地址
https://api.wm2213.com/API/tfyj.php
请求地址
https://api.wm2213.com/API/tfyj.php
请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| type | string | 可选 | 类型:list(默认,活跃台风概览)/ detail(最新定位+路径+预报)/ all(全部活跃台风的详情) |
| num | string | 可选 | 指定台风:编号 2630、序号 30、或英文名 champi(留空=全部活跃) |
| all | string | 可选 | 填 1 时同时列出今年已停编的台风 |
| hours | string | 可选 | 预报时长过滤:24 / 48 / 72 / 120(小时) |
| fc | string | 可选 | 填 0 不返回预报路径(默认返回中央气象台预报) |
| format | string | 可选 | 输出格式:text(纯文本播报,默认)/ json(结构化数据) |
| fresh | string | 可选 | 填 1 跳过缓存强制刷新(缓存仅 60 秒) |
type
string类型:list(默认,活跃台风概览)/ detail(最新定位+路径+预报)/ all(全部活跃台风的详情)
num
string指定台风:编号 2630、序号 30、或英文名 champi(留空=全部活跃)
all
string填 1 时同时列出今年已停编的台风
hours
string预报时长过滤:24 / 48 / 72 / 120(小时)
fc
string填 0 不返回预报路径(默认返回中央气象台预报)
format
string输出格式:text(纯文本播报,默认)/ json(结构化数据)
fresh
string填 1 跳过缓存强制刷新(缓存仅 60 秒)
台风实时追踪
数据源:中央气象台台风网 typhoon.nmc.cn · 自动刷新 60 秒
等待数据…
正在获取实时数据…
台风路径动态图
中央气象台 · 台风路径
实线=已经走过的路径(按强度着色),虚线=预报路径;动点即当前位置。可随时暂停或重播。
查看浙江水利「台风路径」官方动态图(内嵌)
本页数据每 60 秒自动刷新;台风路径与预警以中央气象台(NMC)官方发布为准。
在线测试
返回结果
点击「发送请求」按钮,查看接口返回结果
返回码说明
| 返回码 | 说明 |
|---|---|
| 200 | 成功(无编号台风时 data 为空数组,msg 提示「当前无编号台风」) |
| -1 | 数据源暂时不可用且无历史缓存可回落,请稍后重试 |
200
成功(无编号台风时 data 为空数组,msg 提示「当前无编号台风」)
-1
数据源暂时不可用且无历史缓存可回落,请稍后重试
多语言调用示例
cURL
curl -X GET "https://api.wm2213.com/API/tfyj.php?key=你的授权密钥&type=your_type&num=your_num&all=your_all&hours=your_hours&fc=your_fc&format=your_format&fresh=your_fresh"
Python
import requests
url = "https://api.wm2213.com/API/tfyj.php?key=你的授权密钥"
params = {
'type': 'your_type',
'num': 'your_num',
'all': 'your_all',
'hours': 'your_hours',
'fc': 'your_fc',
'format': 'your_format',
'fresh': 'your_fresh'
}
response = requests.get(url, params=params)
print(response.text)
PHP
<?php
$url = "https://api.wm2213.com/API/tfyj.php?key=你的授权密钥";
$params = [
'type' => 'your_type',
'num' => 'your_num',
'all' => 'your_all',
'hours' => 'your_hours',
'fc' => 'your_fc',
'format' => 'your_format',
'fresh' => 'your_fresh'
];
$demo_url = $url . (strpos($url, '?') === false ? '?' : '&') . http_build_query($params);
$result = file_get_contents($demo_url);
echo $result;
?>
JavaScript
// 使用 fetch 发送GET请求
const url = new URL('https://api.wm2213.com/API/tfyj.php?key=你的授权密钥');
url.searchParams.append('type', 'your_type');
url.searchParams.append('num', 'your_num');
url.searchParams.append('all', 'your_all');
url.searchParams.append('hours', 'your_hours');
url.searchParams.append('fc', 'your_fc');
url.searchParams.append('format', 'your_format');
url.searchParams.append('fresh', 'your_fresh');
fetch(url)
.then(res => res.json())
.then(data => console.log(data))
.catch(err => console.error('请求失败:', err));
Java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class ApiRequest {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
String url = "https://api.wm2213.com/API/tfyj.php?key=你的授权密钥";
// 拼接请求参数
url += "?" + "type=your_type&num=your_num&all=your_all&hours=your_hours&fc=your_fc&format=your_format&fresh=your_fresh";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.GET()
.build();
client.sendAsync(request, HttpResponse.BodyHandlers.ofString())
.thenApply(HttpResponse::body)
.thenAccept(System.out::println)
.join();
}
}
Go
package main
import (
"fmt"
"net/http"
"net/url"
"io/ioutil"
)
func main() {
baseUrl := "https://api.wm2213.com/API/tfyj.php?key=你的授权密钥"
parsedUrl, _ := url.Parse(baseUrl)
q := parsedUrl.Query()
q.Set("type", "your_type");
q.Set("num", "your_num");
q.Set("all", "your_all");
q.Set("hours", "your_hours");
q.Set("fc", "your_fc");
q.Set("format", "your_format");
q.Set("fresh", "your_fresh");
parsedUrl.RawQuery = q.Encode()
resp, err := http.Get(parsedUrl.String())
if err != nil {
fmt.Println("请求失败:", err)
return
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
C#
using System;
using System.Net.Http;
using System.Collections.Generic;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
using var client = new HttpClient();
var url = new Uri("https://api.wm2213.com/API/tfyj.php?key=你的授权密钥");
var queryParams = new Dictionary<string, string>();
queryParams.Add("type", "your_type");
queryParams.Add("num", "your_num");
queryParams.Add("all", "your_all");
queryParams.Add("hours", "your_hours");
queryParams.Add("fc", "your_fc");
queryParams.Add("format", "your_format");
queryParams.Add("fresh", "your_fresh");
var uriBuilder = new UriBuilder(url);
uriBuilder.Query = new FormUrlEncodedContent(queryParams).ReadAsStringAsync().Result;
url = uriBuilder.Uri;
var response = await client.GetAsync(url);
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
}
}
Shell
# 使用curl发送GET请求
curl -X GET "https://api.wm2213.com/API/tfyj.php?key=你的授权密钥&type=your_type&num=your_num&all=your_all&hours=your_hours&fc=your_fc&format=your_format&fresh=your_fresh"
API Key 配置说明
=== API Key 使用说明 ===
1. 在本站注册账号并登录
2. 进入用户中心 → API密钥 → 申请API Key
3. 管理员审核通过后获得 apikey
4. 调用接口时在URL参数中添加 apikey 参数
示例:
https://api.wm2213.com/API/tfyj.php&apikey=你的apikey
注意事项:
- 请勿将 apikey 泄露给他人
- 如发现 apikey 泄露,请及时在用户中心申请删除
- 每个 apikey 有调用频率限制,请合理使用
词库
# Secluded/QRspeed/ClousX6
A:$访问 https://api.wm2213.com/API/tfyj.php?key=你的授权密钥&type=your_type&num=your_num&all=your_all&hours=your_hours&fc=your_fc&format=your_format&fresh=your_fresh$
Kotlin
import okhttp3.FormBody
import okhttp3.OkHttpClient
import okhttp3.Request
fun main() {
val client = OkHttpClient()
val url = "https://api.wm2213.com/API/tfyj.php?key=你的授权密钥"
// GET 请求拼接参数
val requestBuilder = Request.Builder().url(url + "?" + "type=your_type&num=your_num&all=your_all&hours=your_hours&fc=your_fc&format=your_format&fresh=your_fresh")
val request = requestBuilder.get().build()
client.newCall(request).execute().use { response ->
if (!response.isSuccessful) throw RuntimeException("请求失败: ${response.code}")
println(response.body?.string())
}
}