日出日落
请求路径#
GET /v7/astronomy/sun参数#
查询参数
-
location 必选string需要查询地区的LocationID或以英文逗号分隔的经度,纬度坐标(十进制,最多支持小数点后两位),LocationID可通过GeoAPI获取。例如
location=101010100或location=116.41,39.92 -
date 必选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"
]
}
}