QWeather Astronomy Sunrise Sunset

1 credits/call
ae_qweather_astronomy_sunrise_sunset

Get sunrise and sunset times for a location and date. Use `yyyyMMdd` for the date parameter.

Weather
1 credits/call

Pricing

1 credits/call
ConditionCharge
Each call1 credits/call

Parameters

Optional parameters use the platform defaults when omitted.

ParameterTypeRequiredDescriptionDefault
datestringYesSet the date, up to 60 days in the future (including today). The date format is yyyyMMdd. Example: `date=20200531`—
locationstringYesThe location to be queried, support [LocationID](https://dev.qweather.com/en/docs/resource/glossary/#locationid) or comma-separated [longitude and latitude](https://dev.qweather.com/en/docs/resource/glossary/#coordinate) (decimal, up to 2 decimal places), LocationID can be obtained by [GeoAPI](https://dev.qweather.com/en/docs/api/geoapi/). Example: `location=101010100` or `location=116.41,39.92`—

Invocation example

Copy the request and explore its response example.

POST/agent-api/v1/tool/executeX-Api-Key
Request coderequest.sh
curl --request POST \
  --url 'https://agentearth.ai/agent-api/v1/tool/execute?tool_name=ae_qweather_astronomy_sunrise_sunset' \
  --header "X-Api-Key: $AGENTEARTH_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "params": {
    "date": "20261026",
    "location": "120.14,30.26"
  }
}'
Response exampleresponse.json
JSON
{
  "code": "200",
  "fxLink": "https://www.qweather.com/weather/xihu-101210113.html",
  "refer": {
    "license": [
      "QWeather Developers License"
    ],
    "sources": [
      "QWeather"
    ]
  },
  "sunrise": "2026-10-26T06:08+08:00",
  "sunset": "2026-10-26T17:17+08:00",
  "updateTime": "2026-10-25T20:00+08:00"
}