A Julia wrapper for the Dark Sky weather data API.

Build Status

Coverage Statuscodecov


This package is a wrapper for the Dark Sky API.

The Dark Sky API requires an API key. See the Dark Sky Developer Documentation to request one.


# Install the latest stable version:
 Or the the development version from GitHub:

DarkSky.jl expects your API key to be stored as an environment variable named DARKSKY_API_KEY.


The basic usage is to request the current weather forecast (a Forecast Request) or the observed or forecast weather conditions for a datetime in the past or future (a Time Machine Request).

using DarkSky
# Make a "Forecast Request", returns the current weather forecast for the next week.
response = forecast(42.3601, -71.0589);
# Make a "Time Machine Request", returns the observed or forecast weather conditions for a date in
# the past or future.
response = forecast(42.3601, -71.0589, DateTime(2018, 3, 7, 14, 19, 57));

The Dark Sky response contains the following properties (and can be accessed by functions with the same name):

  • latitude - The requested latitude.
  • longitude - The requested longitude.
  • timezone - The IANA timezone name for the requested location.
  • currently - A data point containing the current weather conditions at the requested location. (optional)
  • minutely - A data block containing the weather conditions minute-by-minute for the next hour. (optional)
  • hourly - A data block containing the weather conditions hour-by-hour for the next two days. (optional)
  • daily - A data block containing the weather conditions day-by-day for the next week. (optional)
  • alerts - An alerts array, which, if present, contains any severe weather alerts pertinent to the requested location. (optional)
  • flags - A flags object containing miscellaneous metadata about the request. (optional)
# Extract the requested latitude
# Extract the "daily" data block
# Extract the "alerts" data block

Note that optional properties may not contain data (e.g. there may be no alerts).


See the CONTRIBUTING file.


We adhere to the Julia community standards.


The code is available under the MIT License.