menu 云析API铺 - 云析文档平台 公告 打赏
child_care
医药百科
keyboard_arrow_down
star_border

天气查询

使用教程


请求地址 https://api.a20safe.com/api.php?api=11&key=你的KEY&city=城市名

返回示例 {"code":0,"msg":"success","data":[{"city":"吉安市","time":"2023-02-24 18:18:03","total":"15","weather":[{"date":"24","high":"高温 10℃","low":"低温 6℃","ymd":"2023-02-24","week":"星期五","sunrise":"06:48","sunset":"18:17","aqi":51,"fx":"北风","fl":"2级","type":"阴","notice":"不要被阴云遮挡住好心情"},{"date":"25","high":"高温 15℃","low":"低温 5℃","ymd":"2023-02-25","week":"星期六","sunrise":"06:47","sunset":"18:18","aqi":54,"fx":"北风","fl":"3级","type":"多云","notice":"阴晴之间,谨防紫外线侵扰"},{"date":"26","high":"高温 16℃","low":"低温 4℃","ymd":"2023-02-26","week":"星期日","sunrise":"06:46","sunset":"18:18","aqi":49,"fx":"东北风","fl":"2级","type":"晴","notice":"愿你拥有比阳光明媚的心情"},{"date":"27","high":"高温 17℃","low":"低温 8℃","ymd":"2023-02-27","week":"星期一","sunrise":"06:45","sunset":"18:19","aqi":49,"fx":"北风","fl":"2级","type":"晴","notice":"愿你拥有比阳光明媚的心情"},{"date":"28","high":"高温 21℃","low":"低温 9℃","ymd":"2023-02-28","week":"星期二","sunrise":"06:44","sunset":"18:20","aqi":57,"fx":"北风","fl":"2级","type":"多云","notice":"阴晴之间,谨防紫外线侵扰"},{"date":"01","high":"高温 21℃","low":"低温 10℃","ymd":"2023-03-01","week":"星期三","sunrise":"06:43","sunset":"18:20","aqi":59,"fx":"北风","fl":"3级","type":"阴","notice":"不要被阴云遮挡住好心情"},{"date":"02","high":"高温 22℃","low":"低温 14℃","ymd":"2023-03-02","week":"星期四","sunrise":"06:42","sunset":"18:21","aqi":53,"fx":"东北风","fl":"2级","type":"多云","notice":"阴晴之间,谨防紫外线侵扰"},{"date":"03","high":"高温 22℃","low":"低温 10℃","ymd":"2023-03-03","week":"星期五","sunrise":"06:41","sunset":"18:21","aqi":65,"fx":"东北风","fl":"2级","type":"阴","notice":"不要被阴云遮挡住好心情"},{"date":"04","high":"高温 22℃","low":"低温 11℃","ymd":"2023-03-04","week":"星期六","sunrise":"06:40","sunset":"18:22","aqi":52,"fx":"北风","fl":"2级","type":"阴","notice":"不要被阴云遮挡住好心情"},{"date":"05","high":"高温 16℃","low":"低温 10℃","ymd":"2023-03-05","week":"星期日","sunrise":"06:39","sunset":"18:22","aqi":36,"fx":"北风","fl":"2级","type":"多云","notice":"阴晴之间,谨防紫外线侵扰"},{"date":"06","high":"高温 21℃","low":"低温 10℃","ymd":"2023-03-06","week":"星期一","sunrise":"06:38","sunset":"18:23","aqi":39,"fx":"东北风","fl":"2级","type":"晴","notice":"愿你拥有比阳光明媚的心情"},{"date":"07","high":"高温 25℃","low":"低温 13℃","ymd":"2023-03-07","week":"星期二","sunrise":"06:37","sunset":"18:24","aqi":54,"fx":"南风","fl":"2级","type":"晴","notice":"愿你拥有比阳光明媚的心情"},{"date":"08","high":"高温 27℃","low":"低温 15℃","ymd":"2023-03-08","week":"星期三","sunrise":"06:36","sunset":"18:24","aqi":61,"fx":"西南风","fl":"2级","type":"多云","notice":"阴晴之间,谨防紫外线侵扰"},{"date":"09","high":"高温 30℃","low":"低温 19℃","ymd":"2023-03-09","week":"星期四","sunrise":"06:35","sunset":"18:25","aqi":58,"fx":"北风","fl":"2级","type":"晴","notice":"愿你拥有比阳光明媚的心情"},{"date":"10","high":"高温 30℃","low":"低温 21℃","ymd":"2023-03-10","week":"星期五","sunrise":"06:34","sunset":"18:25","aqi":53,"fx":"西南风","fl":"2级","type":"多云","notice":"阴晴之间,谨防紫外线侵扰"}],"yesterday":{"date":"23","high":"高温 14℃","low":"低温 8℃","ymd":"2023-02-23","week":"星期四","sunrise":"06:49","sunset":"18:16","aqi":55,"fx":"北风","fl":"2级","type":"多云","notice":"阴晴之间,谨防紫外线侵扰"}}]}

Example

返回参数

返回参数类型说明
code Int 状态码
msg String 返回说明
data[0].city String 城市名
data[0].time String 更新时间
data[0].total String 天气总数
data[0].weather[n].date String
data[0].weather[n].high String 最高温度
data[0].weather[n].low String 最低温度
data[0].weather[n].ymd String 日期
data[0].weather[n].week String 星期
data[0].weather[n].sunrise String 日出时间
data[0].weather[n].sunset String 日落时间
data[0].weather[n].aqi String 空气质量指数
data[0].weather[n].fx String 风向
data[0].weather[n].fl String 风度
data[0].weather[n].type String 天气类型
data[0].weather[n].notice String 提醒
data[0].yesterday.date String
data[0].yesterday.high String 最高温度
data[0].yesterday.low String 最低温度
data[0].yesterday.ymd String 日期
data[0].yesterday.week String 星期
data[0].yesterday.sunrise String 日出时间
data[0].yesterday.sunset String 日落时间
data[0].yesterday.aqi String 空气质量指数
data[0].yesterday.fx String 风向
data[0].yesterday.fl String 风度
data[0].yesterday.type String 天气类型
data[0].yesterday.notice String 提醒

						<br><br>
<table class="mdui-table"><thead><tr>
<th>返回参数</th><th>类型</th><th>说明</th></tr></thead><tbody>
<tr><td><code>code</code></td>
<td>Int</td>
<td>状态码</tr>
<tr><td><code>msg</code></td>
<td>String</td>
<td>返回说明</tr>
<tr><td><code>data[0].city</code></td>
<td>String</td>
<td>城市名</tr>
<tr><td><code>data[0].time</code></td>
<td>String</td>
<td>更新时间</tr>
<tr><td><code>data[0].total</code></td>
<td>String</td>
<td>天气总数</tr>
<tr><td><code>data[0].weather[n].date</code></td>
<td>String</td>
<td>日</tr>
<tr><td><code>data[0].weather[n].high</code></td>
<td>String</td>
<td>最高温度</tr>
<tr><td><code>data[0].weather[n].low</code></td>
<td>String</td>
<td>最低温度</tr>
<tr><td><code>data[0].weather[n].ymd</code></td>
<td>String</td>
<td>日期</tr>
<tr><td><code>data[0].weather[n].week</code></td>
<td>String</td>
<td>星期</tr>
<tr><td><code>data[0].weather[n].sunrise</code></td>
<td>String</td>
<td>日出时间</tr>
<tr><td><code>data[0].weather[n].sunset</code></td>
<td>String</td>
<td>日落时间</tr>
<tr><td><code>data[0].weather[n].aqi</code></td>
<td>String</td>
<td>空气质量指数</tr>
<tr><td><code>data[0].weather[n].fx</code></td>
<td>String</td>
<td>风向</tr>
<tr><td><code>data[0].weather[n].fl</code></td>
<td>String</td>
<td>风度</tr>
<tr><td><code>data[0].weather[n].type</code></td>
<td>String</td>
<td>天气类型</tr>
<tr><td><code>data[0].weather[n].notice</code></td>
<td>String</td>
<td>提醒</tr>
<tr><td><code>data[0].yesterday.date</code></td>
<td>String</td>
<td>日</tr>
<tr><td><code>data[0].yesterday.high</code></td>
<td>String</td>
<td>最高温度</tr>
<tr><td><code>data[0].yesterday.low</code></td>
<td>String</td>
<td>最低温度</tr>
<tr><td><code>data[0].yesterday.ymd</code></td>
<td>String</td>
<td>日期</tr>
<tr><td><code>data[0].yesterday.week</code></td>
<td>String</td>
<td>星期</tr>
<tr><td><code>data[0].yesterday.sunrise</code></td>
<td>String</td>
<td>日出时间</tr>
<tr><td><code>data[0].yesterday.sunset</code></td>
<td>String</td>
<td>日落时间</tr>
<tr><td><code>data[0].yesterday.aqi</code></td>
<td>String</td>
<td>空气质量指数</tr>
<tr><td><code>data[0].yesterday.fx</code></td>
<td>String</td>
<td>风向</tr>
<tr><td><code>data[0].yesterday.fl</code></td>
<td>String</td>
<td>风度</tr>
<tr><td><code>data[0].yesterday.type</code></td>
<td>String</td>
<td>天气类型</tr>
<tr><td><code>data[0].yesterday.notice</code></td>
<td>String</td>
<td>提醒</tr>
</tbody></table>
					

请求参数

请求参数必填类型说明
api String 接口id
key String 你的key
city String 城市名