jdemaeyer / brightsky

JSON API for DWD's open weather data.
https://brightsky.dev/
MIT License
287 stars 18 forks source link

Retrieve historical measurements? #120

Closed timmkrause closed 2 years ago

timmkrause commented 3 years ago

I saw on a FAQ page that the DWD also provides historical measurement data, is this integrated into brightsky?

jdemaeyer commented 3 years ago

Heyho @timmkrause

Bright Sky's public instance (i.e. the one at api.brightsky.dev) includes historical weather records back through 2010, is that what you're looking for?

timmkrause commented 3 years ago

Hi @jdemaeyer, thanks helping.

Kind of, just for shorter time periods. I'd like to know/query, if it has actually rained yesterday or the past few days based on weather station measurement data (!= past forecast data).

timmkrause commented 3 years ago

Does observation_type of historical imply, that it's measurement data taken from weather stations?

If so, I would assume that I would have to take a look into the sources section first, filter for a station nearby with observation_type: "historical" and then filter weather records with that specific source_id? Then do whatever custom logic based on the precipitation.

jdemaeyer commented 3 years ago

Heyho @timmkrause

Kind of, just for shorter time periods. I'd like to know/query, if it has actually rained yesterday or the past few days based on weather station measurement data (!= past forecast data).

You can just use a standard request to the /weather endpoint. If you query https://api.brightsky.dev/weather?lat=52&lon=7.6&date=2021-07-13 it will give you yesterday's weather in Münster as measured by the Münster/Osnabrück weather station (i.e. the returned data is not some outdated forecast). Bright Sky will automatically return real measurements instead of forecasts as soon as they are published by the DWD (usually about 45 minutes after the measurement was taken).

Does observation_type of historical imply, that it's measurement data taken from weather stations?

Yup, observation types historical and current refer to actual measurements, observation type forecast refers to forecasts :)

May I ask what made you think that Bright Sky would return past forecast data instead of actual measurements (when querying past dates)? I'll need to clarify the landing page / docs if that is somehow suggested :sweat_smile:

timmkrause commented 3 years ago

A little more RTFM would have helped me already in regards to what historical actually means and that it's measured data.

I think the confusion also comes from the separation/disconnection of the sources and that observation_type is not directly part of the weather records.

And to be 100% sure that it is measured data, I need to join it (or filter for weather records with historical sources only) as there might be a small time window, where I could otherwise look at past, but forecast data.