Weather Provider API

We cannot keep it from raining. What we can do, however, is change how we do things when it rains. There is a lot of meteorological information available, information we can use to forecast the weather, determine the historical effects of the weather on what we do, and even create models that can predict the best steps for us to take when it starts to rain.

In short, there is a lot of information that can help us get the best out of the weather.

Meteorological information at your fingertips
The Weather Provider API has been developed to make meteorological information easily and uniformly available. Users can request this information via a simple query and receive it in a format that is most practical for them, regardless of the complexity and formats of the original source.

The purpose of the Weather Provider API is to provide easy-to-consume access to a large number of weather data sets. You can choose how you receive the output in terms of file format and the systems of units.

  • Why was this Weather Provider API developed? Because obtaining necessary meteorological information is key to controlling the effects the weather can have on our operations. That is why it is very important to have this meteorological information more easily accessible.

    Unfortunately, accessibility is by nature quite a problem: there is a lot of information available, and not all of it in the same output format. Even a single institution can often have multiple output formats, with different names, for the same content. Some are directly accessible from a URL, while others require a complete API with authorisation rules. Some use a standardised GRIB file format, while others use their own NetCDF format. Other information could even be a CSV file or a table on a webpage.

    And once you get all this information together, you will probably still have to format and parse everything to arrive at something you can use. That is a lot of time and effort that you need to put in before you can even get started.

    The purpose of the Weather Provider API is to provide a single, fixed form of access to a large number of data sets, output in a standardised format in the file format and system of units you need.

    This means less time and less effort to get the information you need and more time to get to the results you want. And if we benefit from this, why not other people too?

  • As the name suggests, the Weather Provider API is an Application Programming Interface. This means that you only need to send a simple HTTP request to get all the information you want from a source in the format you want, regardless of the programming language or system you are committed to for a project.

    The Weather Provider API has implemented a number of models, which, at the moment, are the following:

    • KNMI (Royal Netherlands Meteorological Institute) Historical data per day/hour
      Invoked with ‘daggegevens’ and ‘uurgegevens’
    • KNMI Forecasting data (14-day forecast, per 6-hour block)
      Invoked with ‘pluim’
    • KNMI Forecasting data (48-hour forecast, per hour)
      Invoked with ‘arome’
    • KNMI Current weather data
      Invoked with ‘waarnemingen’
    • CDS (Climate Data Store) ERA5 hourly data from 1979 to present – Single Levels
      Invoked with ‘era5sl’

    For more information about these models, please see the README.md document in the actual project.

  • To use the API correctly, the following parameters apply:

    • source_id: The code for the source belonging to the model for which the data must be requested. Currently this is either the KNMI (‘knmi’) or the CDS (‘cds’).
    • model_id: The code for the model for which the data must be requested.
      For the currently supported models, please see the list above.
    • begin: A date-time combination that indicates the start of the time series for which you want to request information.
    • end: A date-time combination that indicates the end of the time series for which you want to request information.
    • lat: A WGS84 latitudinal value associated with the location for which you want to request data.
      This field can also process the Dutch national triangulation system (Rijksdriehoeksmeting) coordinate-x components, provided that the lon field is also filled with this triangulation system’s coordinate-y component.
    • lon: A WGS84 longitudinal value associated with the location for which you want to request data.
      This field can also process the national triangulation system coordinate-y components, provided that the lat field is also filled with this triangulation system’s coordinate-x component.
    • weather_factors:
      An optional field with which a list can be entered containing the aspects of the weather that you want to request for the chosen model. This can be filled with the names used within the respective model itself, if applicable, or the standardised names used in the Weather Provider API. If this field is left blank, the Weather Provider API will return the full dataset as implemented.
    • units: A value that indicates the system of units to be used for the delivered output. ‘Si’ (scientific notation), ‘human’ (human readable notation), and ‘original’ (the original notation) are supported.
    • response_format: A value that specifies which file format to use for the output. The following are supported: NetCDF4, NetCDF3, JSON, JSON dataset and CSV.
    • accept: A rarely used optional field, which can be filled with specialist settings that may apply to certain models.

How can you contribute?
By making this project open source, we hope to be able to count on your contribution to make it as successful as possible. Your contribution does not have to be big: even reporting a spelling error in our documentation is appreciated. But also adding more models and new features or refining the functionalities offer this project the potential to become the go-to method for anyone who wants to collect weather information without having to deal with all those little details. You might consider, for example, converting/parsing and perhaps even collecting the various datasets. This way we help each other have easier access to weather information while co-creating a means to share our knowledge.

Would you like to know more about the Weather Provider API? On the 7th of July last we organized a webinar. You missed it? And you are curious about the contents? Then do read here ór watch the footage.

 

Would you like to contribute to the Weather Provider API?