Sunrise and Sunset
Endpoint#
GET /v7/astronomy/sunParameters#
Query parameters
-
location(required) The location to be queried, support LocationID or comma-separated longitude and latitude (decimal, up to 2 decimal places), LocationID can be obtained by GeoAPI. Example:location=101010100orlocation=116.41,39.92 -
date(required) Set the date, up to 60 days in the future (including today). The date format is yyyyMMdd. Example:date=20200531
Request example#
curl -X GET --compressed \
-H 'Authorization: Bearer your_token' \
'https://your-api-host/v7/astronomy/sun?location=116.41%2C39.92&date=20200531'
Replace your_token and your_api_host with your JWT Authentication and API Host
Response#
{
"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 Responsive web page of this data, for embedded in website or APP -
referobject Data sources and licensing information-
sourcesarray Data source and other statements, may be null -
licensearray Data license, may be null
-