Dark Sky API wrapper in Elixir.
Clone or download
Hugo Vega
Latest commit ce6c18b Mar 12, 2017
Type Name Latest commit message Commit time
Failed to load latest commit information.
config dependencies Oct 2, 2016
lib Update darksky.ex Oct 6, 2016
test tests Oct 13, 2016
.gitignore dependencies Oct 2, 2016
README.md Update README.md Oct 6, 2016
mix.exs dependencies Oct 2, 2016
mix.lock dependencies Oct 2, 2016
output_examples.md Correct params order in main calls. Mar 12, 2017



Dark Sky API wrapper in Elixir

Quoting Dark Sky API documentation:

The Dark Sky API allows you to look up the weather anywhere on the globe, returning (where available):

Current conditions Minute-by-minute forecasts out to one hour Hour-by-hour and day-by-day forecasts out to seven days Hour-by-hour and day-by-day observations going back decades`

There are two functions available:

  • forecast/4
  • timemachine/5

They need the API key, latitude, longitude, and time only for timemachine function.

Both have optional parameters, you have to put them in a map, for example:

forecast("YOUR-API-KEY", 12,1234, -5,4321, %{lang: "es", units: "si"})

You can check the full list of options here:

Both functions returns a nested map, you can see samples of the output in the file output_examples.md.


Darksky.forecast("YOUR-API-KEY", 43.545, -5.6626, %{lang: "es", units: "si"})

Darksky.timemachine("YOUR-API-KEY", 43.545, -5.6626, 1475430147, %{units: "si", lang: "es"})