Latest 0.0.6
License MIT
Platforms ios 9.0, osx 10.11, tvos 9.0, watchos 2.0
Dependencies Alamofire

DarkSkyKit: DarkSkyKit API Client in Swift

Build Status
CocoaPods Compatible
codecov API client written in Swift.


import DarkSkyKit


Basic Configuration

Init the DarkSkyKit client using only the api token.

let forecastClient = DarkSkyKit(apiToken: "AAA")

Extended Configuration

Init the DarkSkyKit client using a custom configuration. Check out the documentation to know more about these properties (units, exclude, extend & language).

let c = Configuration(token: "AAA", units: .si, exclude: .alerts, lang: "ES")
let forecastClient = DarkSkyKit(configuration: c)

Fetch API provides 2 ways of fetch weather data: current and time machine.


Fetch current weather conditions based on a given location.

forecastClient.current(latitude: 0.34565, longitude: 1.64559) { result in
  switch result {
    case .Success(let forecast):
      // Manage weather data using the Forecast model. Ex:
      if let current = forecast.currently {
        let t = current.temperature
    case .Failure(let error):
      // Manage error case

Time Machine

Fetch weather conditions based on a given date and location.

let d = NSDate(timeIntervalSinceNow: timestamp)
forecastClient.current(latitude: 0.34565, longitude: 1.64559, date: d) { result in
  // Manage result


  • iOS 8.0+ / Mac OS X 10.9+ / tvOS 9.0+ / watchOS 2.0+
  • Xcode 7.3+


To install it, simply add the following line to your Podfile:

pod "DarkSkyKit"



This project is funded and maintained by Caramba. We 💛 open source software!

Check out our other open source projects, read our blog or say :wave: on twitter @carambalabs.


Contributions are welcome :metal: We encourage developers like you to help us improve the projects we’ve shared with the community. Please see the Contributing Guide and the Code of Conduct.


DarkSkyKit is available under the MIT license. See the LICENSE file for more info.

Latest podspec

    "name": "DarkSkyKit",
    "version": "0.0.6",
    "summary": "Client for API",
    "description": "Swift client for API",
    "homepage": "",
    "social_media_url": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "": "[email protected]"
    "source": {
        "git": "",
        "tag": "0.0.6"
    "source_files": "DarkSkyKit/**/*",
    "dependencies": {
        "Alamofire": [
            "~> 4.0"
    "platforms": {
        "ios": "9.0",
        "osx": "10.11",
        "tvos": "9.0",
        "watchos": "2.0"
    "pushed_with_swift_version": "3.0"

Pin It on Pinterest

Share This