架构师

您现在的位置是:首页 > 程序人生 > 程序人生

程序人生

今日头条的天气API,支持自动定位功能

架构师小跟班 2020-06-30 程序人生
今日头条天气预报API。作用:首先根据访问者IP确认所在城市,然后查询该城市最近几天的天气情况。说明:这个接口并非头条对外公开的,所以并没有官方文档,但是好在接口并不复杂,数据含义一猜便知。

今日头条天气预报API

API接口:

https://www.toutiao.com/stream/widget/local_weather/data/

API作用:

首先根据访问者IP确认所在城市,然后查询该城市最近几天的天气情况。

API说明:

这个接口并非头条对外公开的,所以并没有官方文档,但是好在接口并不复杂,数据含义一猜便知。

数据举例:

{

"data": {    

    "city": "南京",

    "ip": "183.209.152.199",

    "weather": {

    "aqi": 51,

    "city_name": "南京",

    "current_condition": "",

    "current_temperature": 26,

    "current_time": 1593531096,

    "dat_condition": "雷阵雨",

    "dat_high_temperature": 25,

    "dat_low_temperature": 22,

    "dat_weather_icon_id": "4",

    "day_condition": "多云",

    "forecast_list": [

    {

    "condition": "多云",

    "date": "2020-06-29",

    "high_temperature": "29",

    "low_temperature": "20",

    "weather_icon_id": "1",

    "wind_direction": "西风",

    "wind_level": "4-5"

    },

    

    {

    "condition": "多云转雷阵雨",

    "date": "2020-06-30",

    "high_temperature": "29",

    "low_temperature": "22",

    "weather_icon_id": "1",

    "wind_direction": "南风",

    "wind_level": "3"

    },

    

    {

    "condition": "多云",

    "date": "2020-07-01",

    "high_temperature": "27",

    "low_temperature": "22",

    "weather_icon_id": "1",

    "wind_direction": "东风",

    "wind_level": "3"

    },

    ......

    ],

    

    "low_temperature": 22,

    "moji_city_id": 1045,

    "night_condition": "雷阵雨",

    "origin_data": {},

    "quality_level": "",

    "tomorrow_aqi": 90,

    "tomorrow_condition": "多云",

    "tomorrow_high_temperature": 27,

    "tomorrow_low_temperature": 22,

    "tomorrow_quality_level": "",

    "tomorrow_weather_icon_id": "1",

    "update_time": "2020-06-30 23:25:08",

    "weather_icon_id": "30",

    "wind_direction": "东风",

    "wind_level": 2

    }

    }

}




文章评论