接口地址:https://api.moonwl.cn/api/wea/wea.php?city=
返回格式:json
请求方式:POST
请求示例:https://api.moonwl.cn/api/wea/wea.php?city=郑州

请求参数说明:

名称 必填 类型 说明
  city string 输入正确的城市名称,如:郑州

返回参数说明:

名称 类型 说明
  code string 返回的状态码
  msg string 返回错误提示信息!

返回示例:

{"data":{"yesterday":{"date":"26日星期三","high":"高温 3℃","fx":"东北风","low":"低温 -4℃","fl":"","type":"多云"},"city":"郑州","aqi":"322","forecast":[{"date":"27日星期四","high":"高温 3℃","fengli":"","low":"低温 -4℃","fengxiang":"东北风","type":"多云"},{"date":"28日星期五","high":"高温 0℃","fengli":"","low":"低温 -6℃","fengxiang":"东北风","type":"阴"},{"date":"29日星期六","high":"高温 -1℃","fengli":"","low":"低温 -7℃","fengxiang":"东北风","type":"多云"},{"date":"30日星期天","high":"高温 3℃","fengli":"","low":"低温 -5℃","fengxiang":"东南风","type":"多云"},{"date":"31日星期一","high":"高温 0℃","fengli":"","low":"低温 -6℃","fengxiang":"东风","type":"阴"}],"ganmao":"相对于今天将会出现大幅度降温,易发生感冒,注意增加衣服,加强自我防护避免感冒。","wendu":"-2"},"status":1000,"desc":"OK"}

服务级错误码参照(error_code):

  错误码 说明
  201201 城市名称不能为空

系统级错误码参照:

  错误码 说明 旧版本(resultcode)
 

错误码格式说明(示例:200201):

  2 002 01
  服务级错误(1为系统级错误) 服务模块代码(即数据ID) 具体错误代码

PHP演示:

https://api.moonwl.cn/api/wea/wea.php?city=郑州