«
天气API获取未来30天气预报 | 中国天气网

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


查询未来1~40天气预报API接口

该接口2小时更新一次,返回最近40日天气, 包含每日日期、农历日期、星期几、天气情况、白天天气、夜间天气、高温低温、日出日落时间、空气质量等,可按地名、城市编号、LBS、IP查询。


1. 需求说明:

  1. 未来7日天气
  2. 未来15日天气
  3. 未来一个月天气
  4. 未来40日天气

2. 请求步骤:


1. 请求接口

请将线路地址设置在服务端, 为动态可修改的

线路1(推荐):http://v1.yiketianqi.com
线路2:http://v0.yiketianqi.com/api

http://v0.yiketianqi.com/api?unescape=1&version=v61&appid=你的参数&appsecret=你的参数
2. 请求参数
参数名 必选 类型 说明 备注(示例)
appid string 用户appid 先注册开发账号
appsecret string 用户appsecret
version string 接口版本标识 固定值: v61 每个接口的version值都不一样
adcode string 国家统计局城市ID 如:130200000000 请参考 全国统计用区划代码表
cityid string 城市ID 请参考 城市ID列表
city string 城市名称 不要带市和区; 如: 青岛、铁西
province string 所在省 如果您担心city重名可传此参数, 不要带省和市; 如: 山东、上海
ip string IP地址 查询IP所在城市天气
lng String 经度 如: 119.545023 (需额外开通lbs权限)
lat String 纬度 如: 36.044254
point String 坐标体系 默认百度坐标, 如使用高德坐标, 请传参: gaode
callback string jsonp参数 如: jQuery.Callbacks
vue string 跨域参数 如果您使用的是react、vue、angular请填写值: 1
unescape Int 是否转义中文 如果您希望json不被unicode, 直接输出中文, 请传此参数: 1
3. 返回内容
{
    "city":"济南",
    "cityid":"101120101",
    "update_time":"2024-01-18 23:08:24",
    "data":[
        {
            "date":"2024-01-18",
            "date_nl":"腊月初八",
            "week":"星期四",
            "wea":"多云转阴",
            "wea_c":"01",
            "wea_img":"yun",
            "wea_day":"多云",
            "wea_day_img":"yun",
            "wea_night":"阴",
            "wea_night_img":"yin",
            "tem1":"0",
            "tem2":"-2",
            "sunrise":"07:22",
            "sunset":"17:21",
            "air":"",
            "win":"东风3-4级",
            "win_day":"",
            "win_night":""
        },
        {
            "date":"2024-01-19",
            "date_nl":"腊月初九",
            "week":"星期五",
            "wea":"阴",
            "wea_c":"02",
            "wea_img":"yin",
            "wea_day":"阴",
            "wea_day_img":"yin",
            "wea_night":"阴",
            "wea_night_img":"yin",
            "tem1":"2",
            "tem2":"-3",
            "sunrise":"07:21",
            "sunset":"17:22",
            "air":"",
            "win":"东北风3-4级",
            "win_day":"",
            "win_night":""
        },
        {
            "date":"2024-01-20",
            "date_nl":"腊月初十",
            "week":"星期六",
            "wea":"阴转多云",
            "wea_c":"02",
            "wea_img":"yun",
            "wea_day":"阴",
            "wea_day_img":"yin",
            "wea_night":"多云",
            "wea_night_img":"yun",
            "tem1":"1",
            "tem2":"-4",
            "sunrise":"07:21",
            "sunset":"17:23",
            "air":"",
            "win":"微风<3级",
            "win_day":"",
            "win_night":""
        },
        {
            "date":"2024-01-21",
            "date_nl":"腊月十一",
            "week":"星期日",
            "wea":"晴",
            "wea_c":"00",
            "wea_img":"qing",
            "wea_day":"晴",
            "wea_day_img":"qing",
            "wea_night":"晴",
            "wea_night_img":"qing",
            "tem1":"0",
            "tem2":"-7",
            "sunrise":"07:20",
            "sunset":"17:24",
            "air":"",
            "win":"微风<3级",
            "win_day":"",
            "win_night":""
        },
        {
            "date":"2024-01-22",
            "date_nl":"腊月十二",
            "week":"星期一",
            "wea":"晴",
            "wea_c":"00",
            "wea_img":"qing",
            "wea_day":"晴",
            "wea_day_img":"qing",
            "wea_night":"晴",
            "wea_night_img":"qing",
            "tem1":"-4",
            "tem2":"-8",
            "sunrise":"07:20",
            "sunset":"17:25",
            "air":"",
            "win":"微风<3级",
            "win_day":"",
            "win_night":""
        },
        {
            "date":"2024-01-23",
            "date_nl":"腊月十三",
            "week":"星期二",
            "wea":"晴",
            "wea_c":"00",
            "wea_img":"qing",
            "wea_day":"晴",
            "wea_day_img":"qing",
            "wea_night":"晴",
            "wea_night_img":"qing",
            "tem1":"0",
            "tem2":"-7",
            "sunrise":"07:19",
            "sunset":"17:26",
            "air":"",
            "win":"微风<3级",
            "win_day":"",
            "win_night":""
        },
        {
            "date":"2024-01-24",
            "date_nl":"腊月十四",
            "week":"星期三",
            "wea":"多云转阴",
            "wea_c":"01",
            "wea_img":"yun",
            "wea_day":"多云",
            "wea_day_img":"yun",
            "wea_night":"阴",
            "wea_night_img":"yin",
            "tem1":"4",
            "tem2":"-4",
            "sunrise":"07:19",
            "sunset":"17:27",
            "air":"",
            "win":"微风<3级",
            "win_day":"",
            "win_night":""
        },
        {
            "date":"2024-01-25",
            "date_nl":"腊月十五",
            "week":"星期四",
            "wea":"阴转晴",
            "wea_c":"02",
            "wea_img":"yin",
            "wea_day":"阴",
            "wea_day_img":"yin",
            "wea_night":"晴",
            "wea_night_img":"qing",
            "tem1":"7",
            "tem2":"-2",
            "sunrise":"07:18",
            "sunset":"17:28",
            "air":"",
            "win":"微风<3级",
            "win_day":"",
            "win_night":""
        },
        {
            "date":"2024-01-26",
            "date_nl":"腊月十六",
            "week":"星期五",
            "wea":"晴",
            "wea_c":"00",
            "wea_img":"qing",
            "wea_day":"晴",
            "wea_day_img":"qing",
            "wea_night":"晴",
            "wea_night_img":"qing",
            "tem1":"6",
            "tem2":"-2",
            "sunrise":"07:18",
            "sunset":"17:29",
            "air":"",
            "win":"东北风<3级",
            "win_day":"",
            "win_night":""
        },
        {
            "date":"2024-01-27",
            "date_nl":"腊月十七",
            "week":"星期六",
            "wea":"晴",
            "wea_c":"00",
            "wea_img":"qing",
            "wea_day":"晴",
            "wea_day_img":"qing",
            "wea_night":"晴",
            "wea_night_img":"qing",
            "tem1":"6",
            "tem2":"-1",
            "sunrise":"07:17",
            "sunset":"17:30",
            "air":"",
            "win":"南风<3级",
            "win_day":"",
            "win_night":""
        },
        {
            "date":"2024-01-28",
            "date_nl":"腊月十八",
            "week":"星期日",
            "wea":"阴转晴",
            "wea_c":"02",
            "wea_img":"yin",
            "wea_day":"阴",
            "wea_day_img":"yin",
            "wea_night":"晴",
            "wea_night_img":"qing",
            "tem1":"9",
            "tem2":"1",
            "sunrise":"07:16",
            "sunset":"17:31",
            "air":"",
            "win":"西南风<3级",
            "win_day":"",
            "win_night":""
        },
        {
            "date":"2024-01-29",
            "date_nl":"腊月十九",
            "week":"星期一",
            "wea":"晴转阴",
            "wea_c":"00",
            "wea_img":"yin",
            "wea_day":"晴",
            "wea_day_img":"qing",
            "wea_night":"阴",
            "wea_night_img":"yin",
            "tem1":"11",
            "tem2":"2",
            "sunrise":"07:16",
            "sunset":"17:32",
            "air":"",
            "win":"东南风<3级",
            "win_day":"",
            "win_night":""
        },
        {
            "date":"2024-01-30",
            "date_nl":"腊月二十",
            "week":"星期二",
            "wea":"阴",
            "wea_c":"02",
            "wea_img":"yin",
            "wea_day":"阴",
            "wea_day_img":"yin",
            "wea_night":"阴",
            "wea_night_img":"yin",
            "tem1":"8",
            "tem2":"4",
            "sunrise":"07:15",
            "sunset":"17:33",
            "air":"",
            "win":"东北风<3级",
            "win_day":"",
            "win_night":""
        },
        {
            "date":"2024-01-31",
            "date_nl":"腊月廿一",
            "week":"星期三",
            "wea":"阴",
            "wea_c":"02",
            "wea_img":"yin",
            "wea_day":"阴",
            "wea_day_img":"yin",
            "wea_night":"阴",
            "wea_night_img":"yin",
            "tem1":"10",
            "tem2":"0",
            "sunrise":"07:14",
            "sunset":"17:35",
            "air":"",
            "win":"东北风<3级",
            "win_day":"",
            "win_night":""
        },
        {
            "date":"2024-02-01",
            "date_nl":"腊月廿二",
            "week":"星期四",
            "wea":"阴",
            "wea_c":"02",
            "wea_img":"yin",
            "wea_day":"阴",
            "wea_day_img":"yin",
            "wea_night":"阴",
            "wea_night_img":"yin",
            "tem1":"5",
            "tem2":"0",
            "sunrise":"07:13",
            "sunset":"17:36",
            "air":"",
            "win":"东北风3-4级",
            "win_day":"",
            "win_night":""
        },
        {
            "date":"2024-02-02",
            "date_nl":"腊月廿三",
            "week":"星期五",
            "wea":"多云",
            "wea_c":"01",
            "wea_img":"yun",
            "wea_day":"多云",
            "wea_day_img":"yun",
            "wea_night":"多云",
            "wea_night_img":"yun",
            "tem1":"4",
            "tem2":"-4",
            "sunrise":"",
            "sunset":"",
            "air":"",
            "win":"",
            "win_day":"",
            "win_night":""
        },
        {
            "date":"2024-02-03",
            "date_nl":"腊月廿四",
            "week":"星期六",
            "wea":"多云",
            "wea_c":"01",
            "wea_img":"yun",
            "wea_day":"多云",
            "wea_day_img":"yun",
            "wea_night":"多云",
            "wea_night_img":"yun",
            "tem1":"5",
            "tem2":"-4",
            "sunrise":"",
            "sunset":"",
            "air":"",
            "win":"",
            "win_day":"",
            "win_night":""
        },
        {
            "date":"2024-02-04",
            "date_nl":"腊月廿五",
            "week":"星期日",
            "wea":"多云",
            "wea_c":"01",
            "wea_img":"yun",
            "wea_day":"多云",
            "wea_day_img":"yun",
            "wea_night":"多云",
            "wea_night_img":"yun",
            "tem1":"5",
            "tem2":"-4",
            "sunrise":"",
            "sunset":"",
            "air":"",
            "win":"",
            "win_day":"",
            "win_night":""
        },
        {
            "date":"2024-02-05",
            "date_nl":"腊月廿六",
            "week":"星期一",
            "wea":"多云",
            "wea_c":"01",
            "wea_img":"yun",
            "wea_day":"多云",
            "wea_day_img":"yun",
            "wea_night":"多云",
            "wea_night_img":"yun",
            "tem1":"6",
            "tem2":"-3",
            "sunrise":"",
            "sunset":"",
            "air":"",
            "win":"",
            "win_day":"",
            "win_night":""
        },
        {
            "date":"2024-02-06",
            "date_nl":"腊月廿七",
            "week":"星期二",
            "wea":"多云",
            "wea_c":"01",
            "wea_img":"yun",
            "wea_day":"多云",
            "wea_day_img":"yun",
            "wea_night":"多云",
            "wea_night_img":"yun",
            "tem1":"7",
            "tem2":"-3",
            "sunrise":"",
            "sunset":"",
            "air":"",
            "win":"",
            "win_day":"",
            "win_night":""
        },
        {
            "date":"2024-02-07",
            "date_nl":"腊月廿八",
            "week":"星期三",
            "wea":"多云",
            "wea_c":"01",
            "wea_img":"yun",
            "wea_day":"多云",
            "wea_day_img":"yun",
            "wea_night":"多云",
            "wea_night_img":"yun",
            "tem1":"7",
            "tem2":"-3",
            "sunrise":"",
            "sunset":"",
            "air":"",
            "win":"",
            "win_day":"",
            "win_night":""
        },
        {
            "date":"2024-02-08",
            "date_nl":"腊月廿九",
            "week":"星期四",
            "wea":"多云",
            "wea_c":"01",
            "wea_img":"yun",
            "wea_day":"多云",
            "wea_day_img":"yun",
            "wea_night":"多云",
            "wea_night_img":"yun",
            "tem1":"7",
            "tem2":"-3",
            "sunrise":"",
            "sunset":"",
            "air":"",
            "win":"",
            "win_day":"",
            "win_night":""
        },
        {
            "date":"2024-02-09",
            "date_nl":"腊月三十",
            "week":"星期五",
            "wea":"多云",
            "wea_c":"01",
            "wea_img":"yun",
            "wea_day":"多云",
            "wea_day_img":"yun",
            "wea_night":"多云",
            "wea_night_img":"yun",
            "tem1":"7",
            "tem2":"-2",
            "sunrise":"",
            "sunset":"",
            "air":"",
            "win":"",
            "win_day":"",
            "win_night":""
        },
        {
            "date":"2024-02-10",
            "date_nl":"正月初一",
            "week":"星期六",
            "wea":"多云",
            "wea_c":"01",
            "wea_img":"yun",
            "wea_day":"多云",
            "wea_day_img":"yun",
            "wea_night":"多云",
            "wea_night_img":"yun",
            "tem1":"7",
            "tem2":"-2",
            "sunrise":"",
            "sunset":"",
            "air":"",
            "win":"",
            "win_day":"",
            "win_night":""
        },
        {
            "date":"2024-02-11",
            "date_nl":"正月初二",
            "week":"星期日",
            "wea":"多云",
            "wea_c":"01",
            "wea_img":"yun",
            "wea_day":"多云",
            "wea_day_img":"yun",
            "wea_night":"多云",
            "wea_night_img":"yun",
            "tem1":"8",
            "tem2":"-2",
            "sunrise":"",
            "sunset":"",
            "air":"",
            "win":"",
            "win_day":"",
            "win_night":""
        },
        {
            "date":"2024-02-12",
            "date_nl":"正月初三",
            "week":"星期一",
            "wea":"多云",
            "wea_c":"01",
            "wea_img":"yun",
            "wea_day":"多云",
            "wea_day_img":"yun",
            "wea_night":"多云",
            "wea_night_img":"yun",
            "tem1":"7",
            "tem2":"-2",
            "sunrise":"",
            "sunset":"",
            "air":"",
            "win":"",
            "win_day":"",
            "win_night":""
        },
        {
            "date":"2024-02-13",
            "date_nl":"正月初四",
            "week":"星期二",
            "wea":"多云",
            "wea_c":"01",
            "wea_img":"yun",
            "wea_day":"多云",
            "wea_day_img":"yun",
            "wea_night":"多云",
            "wea_night_img":"yun",
            "tem1":"7",
            "tem2":"-2",
            "sunrise":"",
            "sunset":"",
            "air":"",
            "win":"",
            "win_day":"",
            "win_night":""
        },
        {
            "date":"2024-02-14",
            "date_nl":"正月初五",
            "week":"星期三",
            "wea":"多云",
            "wea_c":"01",
            "wea_img":"yun",
            "wea_day":"多云",
            "wea_day_img":"yun",
            "wea_night":"多云",
            "wea_night_img":"yun",
            "tem1":"9",
            "tem2":"-1",
            "sunrise":"",
            "sunset":"",
            "air":"",
            "win":"",
            "win_day":"",
            "win_night":""
        },
        {
            "date":"2024-02-15",
            "date_nl":"正月初六",
            "week":"星期四",
            "wea":"多云",
            "wea_c":"01",
            "wea_img":"yun",
            "wea_day":"多云",
            "wea_day_img":"yun",
            "wea_night":"多云",
            "wea_night_img":"yun",
            "tem1":"9",
            "tem2":"-1",
            "sunrise":"",
            "sunset":"",
            "air":"",
            "win":"",
            "win_day":"",
            "win_night":""
        },
        {
            "date":"2024-02-16",
            "date_nl":"正月初七",
            "week":"星期五",
            "wea":"多云",
            "wea_c":"01",
            "wea_img":"yun",
            "wea_day":"多云",
            "wea_day_img":"yun",
            "wea_night":"多云",
            "wea_night_img":"yun",
            "tem1":"9",
            "tem2":"0",
            "sunrise":"",
            "sunset":"",
            "air":"",
            "win":"",
            "win_day":"",
            "win_night":""
        },
        {
            "date":"2024-02-17",
            "date_nl":"正月初八",
            "week":"星期六",
            "wea":"多云",
            "wea_c":"01",
            "wea_img":"yun",
            "wea_day":"多云",
            "wea_day_img":"yun",
            "wea_night":"多云",
            "wea_night_img":"yun",
            "tem1":"9",
            "tem2":"-1",
            "sunrise":"",
            "sunset":"",
            "air":"",
            "win":"",
            "win_day":"",
            "win_night":""
        },
        {
            "date":"2024-02-18",
            "date_nl":"正月初九",
            "week":"星期日",
            "wea":"多云",
            "wea_c":"01",
            "wea_img":"yun",
            "wea_day":"多云",
            "wea_day_img":"yun",
            "wea_night":"多云",
            "wea_night_img":"yun",
            "tem1":"9",
            "tem2":"-1",
            "sunrise":"",
            "sunset":"",
            "air":"",
            "win":"",
            "win_day":"",
            "win_night":""
        },
        {
            "date":"2024-02-19",
            "date_nl":"正月初十",
            "week":"星期一",
            "wea":"多云",
            "wea_c":"01",
            "wea_img":"yun",
            "wea_day":"多云",
            "wea_day_img":"yun",
            "wea_night":"多云",
            "wea_night_img":"yun",
            "tem1":"9",
            "tem2":"0",
            "sunrise":"",
            "sunset":"",
            "air":"",
            "win":"",
            "win_day":"",
            "win_night":""
        },
        {
            "date":"2024-02-20",
            "date_nl":"正月十一",
            "week":"星期二",
            "wea":"多云",
            "wea_c":"01",
            "wea_img":"yun",
            "wea_day":"多云",
            "wea_day_img":"yun",
            "wea_night":"多云",
            "wea_night_img":"yun",
            "tem1":"10",
            "tem2":"-1",
            "sunrise":"",
            "sunset":"",
            "air":"",
            "win":"",
            "win_day":"",
            "win_night":""
        },
        {
            "date":"2024-02-21",
            "date_nl":"正月十二",
            "week":"星期三",
            "wea":"多云",
            "wea_c":"01",
            "wea_img":"yun",
            "wea_day":"多云",
            "wea_day_img":"yun",
            "wea_night":"多云",
            "wea_night_img":"yun",
            "tem1":"9",
            "tem2":"-1",
            "sunrise":"",
            "sunset":"",
            "air":"",
            "win":"",
            "win_day":"",
            "win_night":""
        },
        {
            "date":"2024-02-22",
            "date_nl":"正月十三",
            "week":"星期四",
            "wea":"多云",
            "wea_c":"01",
            "wea_img":"yun",
            "wea_day":"多云",
            "wea_day_img":"yun",
            "wea_night":"多云",
            "wea_night_img":"yun",
            "tem1":"10",
            "tem2":"0",
            "sunrise":"",
            "sunset":"",
            "air":"",
            "win":"",
            "win_day":"",
            "win_night":""
        },
        {
            "date":"2024-02-23",
            "date_nl":"正月十四",
            "week":"星期五",
            "wea":"多云",
            "wea_c":"01",
            "wea_img":"yun",
            "wea_day":"多云",
            "wea_day_img":"yun",
            "wea_night":"多云",
            "wea_night_img":"yun",
            "tem1":"10",
            "tem2":"0",
            "sunrise":"",
            "sunset":"",
            "air":"",
            "win":"",
            "win_day":"",
            "win_night":""
        },
        {
            "date":"2024-02-24",
            "date_nl":"正月十五",
            "week":"星期六",
            "wea":"雨夹雪",
            "wea_c":"06",
            "wea_img":"xue",
            "wea_day":"雨夹雪",
            "wea_day_img":"xue",
            "wea_night":"雨夹雪",
            "wea_night_img":"xue",
            "tem1":"10",
            "tem2":"0",
            "sunrise":"",
            "sunset":"",
            "air":"",
            "win":"",
            "win_day":"",
            "win_night":""
        },
        {
            "date":"2024-02-25",
            "date_nl":"正月十六",
            "week":"星期日",
            "wea":"多云",
            "wea_c":"01",
            "wea_img":"yun",
            "wea_day":"多云",
            "wea_day_img":"yun",
            "wea_night":"多云",
            "wea_night_img":"yun",
            "tem1":"10",
            "tem2":"0",
            "sunrise":"",
            "sunset":"",
            "air":"",
            "win":"",
            "win_day":"",
            "win_night":""
        },
        {
            "date":"2024-02-26",
            "date_nl":"正月十七",
            "week":"星期一",
            "wea":"多云",
            "wea_c":"01",
            "wea_img":"yun",
            "wea_day":"多云",
            "wea_day_img":"yun",
            "wea_night":"多云",
            "wea_night_img":"yun",
            "tem1":"10",
            "tem2":"0",
            "sunrise":"",
            "sunset":"",
            "air":"",
            "win":"",
            "win_day":"",
            "win_night":""
        }
    ]
}

3. 获取appid和appsecret:

登录官网( http(s): //tianqiapi.com ), 点击右上角“[用户中心]“,即可进行申请

重要说明
重要提示: 您的appid和appsecret是重要信息,请务必妥善保存,避免泄漏!