基本信息
查询天气
查询天气,温度,风向和风级
常用接口
POST
¥0.01/次
https://sharkapi.cn/weather/get
/weather/get
接口详情
请求参数
参数名称位置类型是否必须示例描述
apptokenheadstring您自己的应用token请求验证令牌
typebodystring“district”类型:地区
valuebodystring"500100"需要查询的地区区号
返回示例
//成功返回参数
{
    "code": 200,
    "data": {
        "weather": {
            "location": {//当前地区信息
                "country": "中国",//当前国家
                "province": "重庆市",//当前省份
                "city": "重庆市",//当前城市
                "name": "重庆",//城市简称
                "id": "500100"//区号
            },
            "now": {
                "text": "中雨",//今日天气
                "temp": 8,//今日温度(摄氏度)
                "feels_like": 8,
                "rh": 88,
                "wind_class": "3级",//风等级
                "wind_dir": "西风",//风向
                "uptime": "20221227140000"//更新时间
            },
            "forecasts": [
                {
                    "text_day": "小雨",
                    "text_night": "小雨",
                    "high": 8,
                    "low": 7,
                    "wc_day": "<3级",
                    "wd_day": "西北风",
                    "wc_night": "<3级",
                    "wd_night": "西北风",
                    "date": "2022-12-27",
                    "week": "星期二"
                },
                {
                    "text_day": "小雨",
                    "text_night": "阴",
                    "high": 9,
                    "low": 7,
                    "wc_day": "<3级",
                    "wd_day": "西南风",
                    "wc_night": "<3级",
                    "wd_night": "北风",
                    "date": "2022-12-28",
                    "week": "星期三"
                },
                {
                    "text_day": "阴",
                    "text_night": "多云",
                    "high": 11,
                    "low": 5,
                    "wc_day": "<3级",
                    "wd_day": "北风",
                    "wc_night": "<3级",
                    "wd_night": "东风",
                    "date": "2022-12-29",
                    "week": "星期四"
                },
                {
                    "text_day": "多云",
                    "text_night": "阴",
                    "high": 12,
                    "low": 10,
                    "wc_day": "<3级",
                    "wd_day": "东风",
                    "wc_night": "<3级",
                    "wd_night": "东北风",
                    "date": "2022-12-30",
                    "week": "星期五"
                },
                {
                    "text_day": "小雨",
                    "text_night": "小雨",
                    "high": 13,
                    "low": 9,
                    "wc_day": "<3级",
                    "wd_day": "北风",
                    "wc_night": "<3级",
                    "wd_night": "西风",
                    "date": "2022-12-31",
                    "week": "星期六"
                }
            ]
        }
    },
    "message": "获取成功"
}
//失败返回参数
{
  "code":201,
  "data":[],
  "message":"账户余额不足"//失败提示信息
}

返回参数
参数名称类型是否必须示例描述
countrystring中国国家名称
provincestring重庆省市地区
citystring重庆城市
namestring重庆区域简称
idint500100区号
textstring小雨当前天气状况
tempstring添加当前温度
feels_likestring 8体感温度
rhstring 6相对湿度
wind_classstring2级当前风力
wind_dirstring东北风当前风向
uptimestring20221228120000更新时间
text_daystring白天天气
text_nightstring夜晚天气
highstring14最高温度
lowstring6最低温度
wc_daystring<3级白天风力
wd_daystring东北风白天风向
wc_nightstring<3级夜晚风力
wd_nightstring东北风夜晚风向
datestring2022-12-30查询日期
weekstring星期五星期几

把这个接口分享给其他人

复制复制成功