Replies: 6 comments 1 reply
-
No they don't. I was looking for this some time ago when I was putting together my app. I was working in Javascript so I used https://github.com/mourner/suncalc to get that data. It's a fairly easy integration since you're either searching by Lat/Lon, or can get the Lat/Lon from one of the API calls and then pass that to the suncalc library to get sunrise and sunset. |
Beta Was this translation helpful? Give feedback.
-
Correct, it's not something we currently expose. We do actually calculate it internally, because it's needed for some metadata bits on the forecast and observation endpoints, but we don't output the actual times anywhere. I'm honestly not really sure where it would fit. Maybe a whole new endpoint. Suggestions welcome. |
Beta Was this translation helpful? Give feedback.
-
Perhaps in the daily forecast endpoint? Seems like it might make sense there. |
Beta Was this translation helpful? Give feedback.
-
Maybe, but the forecast isn't actually daily, it's semi-daily (12-hour periods, 6-6), and sunrise/sunset don't always fit neatly into those boxes, especially as we get around the solstices. And don't even get me started on Alaska. Still, it's something we'll try to think about. |
Beta Was this translation helpful? Give feedback.
-
Has this been turned into a formal feature request? I'd like to see this additional functionality as well. Where ever it goes it would be nice to have the sunrise/sunset for the days available in the forecast. |
Beta Was this translation helpful? Give feedback.
-
Hi there, So I take it that this has not been added/exposed yet? I think this could easily be included in the It already includes all kinds of other info/data. It includes an {
"properties": {
"validTimes": "2025-02-01T14:00:00+00:00/P7DT11H",
"sunData": {
"0": {
"sunrise": "2025-02-01T06:46:00",
"sunset": "2025-02-01T17:22:00",
"validDate": "2025-02-01"
},
"1": {
"sunrise": "2025-02-01T06:50:00",
"sunset": "2025-02-01T17:26:00",
"validDate": "2025-02-02"
}
}
}
} I think this is the best place for it since there is all sorts of other data there, and this would be similar to how all the other data is exposed. Just an idea. UPDATE: I was just thinking that {
"properties": {
"validTimes": "2025-02-01T14:00:00+00:00/P7DT11H",
"astronomicalData": {
"0": {
"sunrise": "2025-02-01T06:46:00",
"sunset": "2025-02-01T17:22:00",
"validDate": "2025-02-01",
"moonrise": "2025-02-01T08:52:00",
"moonset": "2025-02-01T21:13:00"
},
"1": {
"sunrise": "2025-02-01T06:50:00",
"sunset": "2025-02-01T17:26:00",
"validDate": "2025-02-02",
"moonrise": "2025-02-01T09:21:00",
"moonset": "2025-02-01T22:21:00"
}
}
}
} |
Beta Was this translation helpful? Give feedback.
-
Do any of the API endpoints provide the Sunset and Sunrise time for that day?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions