Skip to content

Instantly share code, notes, and snippets.

@gbuesing
Created March 13, 2023 19:31
Show Gist options
  • Save gbuesing/ca7d41ea81ac07043f31333afb7a1c39 to your computer and use it in GitHub Desktop.
Save gbuesing/ca7d41ea81ac07043f31333afb7a1c39 to your computer and use it in GitHub Desktop.
Map attributes from the open meteo forecast api to the format used by the Dark Sky API
The Open Meteo Forecast API and the Dark Sky API have different attribute names and structures, so mapping the attributes from one API to another requires some translation. Here's a list of Open Meteo Forecast API attributes and their corresponding Dark Sky API attributes:
Temperature
Open Meteo Forecast API: "temp"
Dark Sky API: "temperature"
Minimum temperature
Open Meteo Forecast API: "temp_min"
Dark Sky API: "temperatureMin"
Maximum temperature
Open Meteo Forecast API: "temp_max"
Dark Sky API: "temperatureMax"
Pressure
Open Meteo Forecast API: "pressure"
Dark Sky API: "pressure"
Humidity
Open Meteo Forecast API: "humidity"
Dark Sky API: "humidity"
Wind speed
Open Meteo Forecast API: "wind_speed"
Dark Sky API: "windSpeed"
Wind direction
Open Meteo Forecast API: "wind_deg"
Dark Sky API: "windBearing"
Cloudiness
Open Meteo Forecast API: "clouds"
Dark Sky API: "cloudCover"
Precipitation
Open Meteo Forecast API: "rain" or "snow" (depending on the type of precipitation)
Dark Sky API: "precipIntensity"
Precipitation probability
Open Meteo Forecast API: "pop"
Dark Sky API: "precipProbability"
UV index
Open Meteo Forecast API: "uvi"
Dark Sky API: "uvIndex"
Weather description
Open Meteo Forecast API: "weather" (an array that may contain multiple descriptions)
Dark Sky API: "summary"
Note that the Dark Sky API also includes some additional attributes, such as "apparentTemperature" and "dewPoint", that are not available in the Open Meteo Forecast API. If you need these attributes, you may need to use a different data source or calculate them yourself based on the available data.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment