wttr.in
wttr.in copied to clipboard
Query 24hr dusk/dawn in JSON format
I'm building a
- "sun sets in X minutes / at XX:XX"
- "it will be dark in y minutes / at YY:YY" status bar entry.
For this i need the advanced astronomy data from v2 I'm using JSON as the format which doesn't have dusk and dawn, just sunset and sunrise. And, those fields are in AM/PM format.
Is there a way to get 24hr dusk and dawn info in JSON format? I haven't found it in the docs yet.
@alexd2580 Sascha hi! Maybe you could use the one-line output format instead?
$ curl wttr.in/Munich?format="%C+\nFeels+like:+%f+\nActually+is:+%t+\nSunrise:+%S+\nSunset:+%s\n"
Sunny
Feels like: +16°C
Actually is: +16°C
Sunrise: 06:57:44
Sunset: 16:56:08
If this is still relevant - technically yes, but no. My conflict here is between:
-
Using just one json query for all the data that i need: Temp / Sunrise / Sunset / WeatherDesc / WeatherCode and having to parse AM/PM into 24hr format
-
Using two queries: Astronomical data in 24hr format + Other params via regular JSON I can't use only the custom format query, because the weather-code can't be selected in custom format