六派数据-全国天气预报
  • ID

    6

  • 收藏

    7

  • 使用

    4

全国天气预报

全国3000多个省市的天气预报查询,包括实时天气气温、最高最低温度、风级、风力、湿度、气压,穿衣、运动、洗车、感冒、空气污染扩散、紫外线等指数,7天天气、风力、最低最高温度、日出日落时间,未来24小时的时天气、气温,空气质量指数、PM2.5指数、主要污染物等信息。
天气图片地址:https://www.6api.net/weather/icon.zip
套餐
100次 50000次 500000次 1000000次 5000000次 10000000次
价格

  • 天气实况
  • 获取城市
  • 天气预报24小时
  • 天气预报15天

基本信息

  • 接口地址: http://open.liupai.net/weather/query
  • 支持格式: JSON,JSONP
  • 请求方法: GET POST
  • 请求示例: http://open.liupai.net/weather/query?appkey=yourappsecret

请求参数 API在线测试

参数名称 类型 必填 说明
city string 城市ID

返回参数

参数名称 类型   说明
city array   城市数据
cityId int   城市ID
counname string   国家名称
ianatimezone string   标准时区
name string   城市名称
pname string   上级区域名称
secondaryname string   二级城市名
timezone string   时区
condition array   天气实况
condition string   实时天气
conditionId int   实时天气id
humidity int   湿度
icon int   天气icon
pressure int   气压
realFeel int   体感温度
sunRise string   日出时间
sunSet string   日落时间
temp int   温度
tips string   一句话提示
updatetime string   发布时间
uvi int   紫外线强度
vis int   能见度
windDegrees int   风向角度
windDir string   风向
windLevel decimal   风级
windSpeed decimal   风速

请求代码 查看代码

  • PHP
  • JAVA
  • Python
require_once("curl.func.php");

$method = "POST";
$url = "http://open.liupai.net/weather/query";
$headers = NULL;
$params = array(  
    "appkey" => "yourappsecret",
    "city" => "2"
);
$result = api_curl($method, $url, $headers, $params);
if ($result) {
    $body = json_decode($result["body"], TRUE);
    $status_code = $body["status"];
    if ($status_code == "200") { 
        var_dump($body["result"]);
    }else
        var_dump($body); 
}else  
    echo "发送请求失败";

JSON返回示例

{

    "status": 200,
    "msg": "OK",
    "result": {
        "city": {
            "cityId": 3,
            "counname": "中国",
            "ianatimezone": "Asia/Shanghai",
            "name": "北京市朝阳区",
            "pname": "北京市",
            "secondaryname": "北京市",
            "timezone": "8"
        },
        "condition": {
            "condition": "阴",
            "conditionId": "85",
            "humidity": "91",
            "icon": "2",
            "pressure": "1024",
            "realFeel": "1",
            "sunRise": "2020-11-21 07:06:00",
            "sunSet": "2020-11-21 16:54:00",
            "temp": "3",
            "tips": "今天有雪,天气阴冷,穿暖和点吧!",
            "updatetime": "2020-11-21 18:20:08",
            "uvi": "1",
            "vis": "11159",
            "windDegrees": "45",
            "windDir": "东北风",
            "windLevel": "2",
            "windSpeed": "1.9"
        }
    }
}

    数据信息

  • 今日调用: 2,500  次
  • 客服电话: 010-8639-9970
  • 客服邮箱: kf@ksmsoft.net
  • 售前客服:
  • 售后技术:

全国天气预报问答专区

问答专区

相关资讯

其他推荐