日出日落
获取未来60天全球任意地点日出日落时间。
在逐天预报API中,也会返回对应天数的日出日落、月升月落和月相数据
请求路径#
GET /v7/astronomy/sun参数#
查询参数
-
location(必选) 需要查询地区的LocationID或以英文逗号分隔的经度,纬度坐标(十进制,最多支持小数点后两位),LocationID可通过GeoAPI获取。例如location=101010100或location=116.41,39.92 -
date(必选) 选择日期,最多可选择未来60天(包含今天)的数据。日期格式为yyyyMMdd,例如date=20200531
请求示例#
curl -X GET --compressed \
-H 'Authorization: Bearer your_token' \
'https://your-api-host/v7/astronomy/sun?location=116.41%2C39.92&date=20200531'
请将your_token替换为你的JWT身份认证,将your_api_host替换为你的API Host
返回数据#
{
"code": "200",
"updateTime": "2021-02-17T11:00+08:00",
"fxLink": "https://www.qweather.com",
"sunrise": "2021-02-20T06:58+08:00",
"sunset": "2021-02-20T17:57+08:00",
"refer": {
"sources": [
"https://developer.qweather.com/attribution.html"
],
"license": [
"QWeather Developers License"
]
}
}
-
fxLinkuri 当前数据的响应式页面,便于嵌入网站或应用 -
referobject 数据来源和许可信息-
sourcesarray 原始数据来源,或数据源说明,可能为空 -
licensearray 数据许可或版权声明,可能为空
-