«
[天气API]实时降水、降雨量接口对接,预报未来2小时有没有下雨

时间:2024-8-14    作者:程序猿    分类:


可实现的效果图

接口请求地址: http://ykyrain.tianqiapi.com

请求示例: http://ykyrain.tianqiapi.com/?version=rain&appid=17256853&appsecret=YtFbK6VP&lng=114.302953&lat=30.585411

请求参数

参数名 必选 类型 说明 备注(示例)
appid string 用户appid 先注册开发账号
appsecret string 用户appsecret
version string 接口标识 固定值: rain
lng string 经度 如: 119.545023
lat string 纬度 如: 36.044254

响应JSON

{
    "errcode": 0,
    "time": "2024-04-30 06:35:00",
    "update_time": "2024-04-30 06:30:00",
    "msg": "雨渐大,80分钟转为中雨",
    "data": [
        {
            "time": "2024-04-30 06:45:00",
            "level": "小雨",
            "value": "0.15"
        },
        {
            "time": "2024-04-30 06:50:00",
            "level": "小雨",
            "value": "0.09"
        },
        {
            "time": "2024-04-30 06:55:00",
            "level": "小雨",
            "value": "0.07"
        },
        {
            "time": "2024-04-30 07:00:00",
            "level": "小雨",
            "value": "0.09"
        },
        {
            "time": "2024-04-30 07:05:00",
            "level": "小雨",
            "value": "0.12"
        },
        {
            "time": "2024-04-30 07:10:00",
            "level": "小雨",
            "value": "0.15"
        },
        {
            "time": "2024-04-30 07:15:00",
            "level": "小雨",
            "value": "0.17"
        },
        {
            "time": "2024-04-30 07:20:00",
            "level": "小雨",
            "value": "0.18"
        },
        {
            "time": "2024-04-30 07:25:00",
            "level": "小雨",
            "value": "0.18"
        },
        {
            "time": "2024-04-30 07:30:00",
            "level": "小雨",
            "value": "0.16"
        },
        {
            "time": "2024-04-30 07:35:00",
            "level": "小雨",
            "value": "0.09"
        },
        {
            "time": "2024-04-30 07:40:00",
            "level": "小雨",
            "value": "0.05"
        },
        {
            "time": "2024-04-30 07:45:00",
            "level": "小雨",
            "value": "0.03"
        },
        {
            "time": "2024-04-30 07:50:00",
            "level": "小雨",
            "value": "0.05"
        },
        {
            "time": "2024-04-30 07:55:00",
            "level": "小雨",
            "value": "0.07"
        },
        {
            "time": "2024-04-30 08:00:00",
            "level": "小雨",
            "value": "0.12"
        },
        {
            "time": "2024-04-30 08:05:00",
            "level": "小雨",
            "value": "0.2"
        },
        {
            "time": "2024-04-30 08:10:00",
            "level": "中雨",
            "value": "0.27"
        },
        {
            "time": "2024-04-30 08:15:00",
            "level": "中雨",
            "value": "0.29"
        },
        {
            "time": "2024-04-30 08:20:00",
            "level": "中雨",
            "value": "0.3"
        },
        {
            "time": "2024-04-30 08:25:00",
            "level": "中雨",
            "value": "0.25"
        }
    ]
}

tips:接口需要注册自己的账号, 测试后开通接口权限
接口官方文档 http://tianqiapi.com/index/doc?version=v11