{"id":1921,"url":"https://github.com/sxg/ForecastIO","last_synced_at":"2025-08-02T05:33:09.638Z","repository":{"id":35115919,"uuid":"39305568","full_name":"sxg/ForecastIO","owner":"sxg","description":"A Swift library for the Forecast.io Dark Sky API","archived":false,"fork":false,"pushed_at":"2019-09-20T00:31:52.000Z","size":3469,"stargazers_count":159,"open_issues_count":1,"forks_count":27,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-06-06T06:17:31.311Z","etag":null,"topics":["carthage","cocoadocs","cocoapods","darksky","forecastio","swift","weather"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sxg.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-18T16:52:28.000Z","updated_at":"2024-06-10T02:04:13.000Z","dependencies_parsed_at":"2022-08-29T05:01:34.671Z","dependency_job_id":null,"html_url":"https://github.com/sxg/ForecastIO","commit_stats":null,"previous_names":[],"tags_count":43,"template":false,"template_full_name":null,"purl":"pkg:github/sxg/ForecastIO","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sxg%2FForecastIO","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sxg%2FForecastIO/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sxg%2FForecastIO/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sxg%2FForecastIO/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sxg","download_url":"https://codeload.github.com/sxg/ForecastIO/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sxg%2FForecastIO/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268339405,"owners_count":24234544,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["carthage","cocoadocs","cocoapods","darksky","forecastio","swift","weather"],"created_at":"2024-01-05T20:15:59.039Z","updated_at":"2025-08-02T05:33:09.246Z","avatar_url":"https://github.com/sxg.png","language":"Swift","readme":"![ForecastIO](header.png)\n\n![Swift](https://img.shields.io/badge/Swift-5.0-brightgreen.svg)\n[![CI Status](http://img.shields.io/travis/sxg/ForecastIO.svg?style=flat)](https://travis-ci.org/sxg/ForecastIO)\n[![Documentation](https://img.shields.io/cocoapods/metrics/doc-percent/ForecastIO.svg)](http://cocoadocs.org/docsets/ForecastIO/)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![Version](https://img.shields.io/cocoapods/v/ForecastIO.svg?style=flat)](http://cocoapods.org/pods/ForecastIO)\n[![License](https://img.shields.io/cocoapods/l/ForecastIO.svg?style=flat)](http://cocoapods.org/pods/ForecastIO)\n[![Platform](https://img.shields.io/cocoapods/p/ForecastIO.svg?style=flat)](http://cocoapods.org/pods/ForecastIO)\n\n## Requirements\n\nTo use ForecastIO, all you need is an API key for the [Dark Sky API](https://darksky.net/dev/). ForecastIO supports iOS (≥9.0), macOS (≥10.10), watchOS (≥2.0), and tvOS (≥9.0).\n\n## Installation\n\nForecastIO is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your `Podfile`:\n\n```ruby\npod \"ForecastIO\"\n```\n\nTo integrate using [Carthage](https://github.com/Carthage/Carthage), specify it in your `Cartfile`:\n\n```ogdl\ngithub \"sxg/ForecastIO\"\n```\n\n### Swift 2.3\n\nA Swift 2.3 compatible version of ForecastIO is available on the [swift2.3](https://github.com/sxg/ForecastIO/tree/swift2.3) branch. This version is frozen at the [ForecastIO 2.1.1 API](http://cocoadocs.org/docsets/ForecastIO/2.1.1/) and no longer supported. To install the Swift 2.3 compatible version of ForecastIO, simply add the following line to your `Podfile`:\n\n```ruby\npod \"ForecastIO\", :git =\u003e \"https://github.com/sxg/ForecastIO.git\", :branch =\u003e \"swift2.3\"\n```\n\nTo integrate the Swift 2.3 compatible version using Carthage, specify it in your `Cartfile`:\n\n```ogdl\ngithub \"sxg/ForecastIO\" \"swift2.3\"\n```\n\n## Documentation \u0026 Unit Tests\n\nThe full documentation for ForecastIO is available on [CocoaDocs](http://cocoadocs.org/docsets/ForecastIO).\n\nForecastIO includes a full suite of unit tests with 100% code coverage.\n\n## Usage\n\nFirst, create a `DarkSkyClient` with your API key:\n\n```swift\nimport ForecastIO\n...\nlet client = DarkSkyClient(apiKey: \"YOUR_API_KEY_HERE\")\n```\n\nYou can choose units that you want `Forecast` responses to use:\n\n```swift\nclient.units = .si\n```\n\nThe following units are supported:\n- SI\n- US (default)\n- Canadian\n- UK\n- Auto (uses the local units for the location for which you are requesting weather data)\n\nMore details about the units of each property are available [in the Dark Sky API docs](https://darksky.net/dev/docs/forecast).\n\nYou can also choose the language that you want `Forecast` responses to use:\n\n```swift\nclient.language = .english\n```\n\nMany languages are supported (a full list is available [here](https://darksky.net/dev/docs/forecast)). If no language is specified, English is used as the default.\n\nWith the `DarkSkyClient`, you can make two kinds of requests. The first will get the current `Forecast` for a particular location:\n\n```swift\nlet myLoc = CLLocationCoordinate2D(latitude: myLat, longitude: myLon)\nclient.getForecast(location: myLoc) { result in\n    switch result {\n    case .success(let currentForecast, let requestMetadata):\n        // We got the current forecast!\n    case .failure(let error):\n        // Uh-oh. We have an error!\n    }\n}\n```\n\nThe second kind of request is called a time machine request, and it will get a `Forecast` for a particular location at a particular time:\n\n```swift\nlet myLoc = CLLocationCoordinate2D(latitude: myLat, longitude: myLon)\nclient.getForecast(location: myLoc, time: myTime) { result in\n    switch result {\n    case .success(let forecast, let requestMetadata):\n        // We got the forecast!\n    case .failure(let error):\n        // Uh-oh. We have an error!\n    }\n}\n```\n\nThe `Forecast` you receive will have metadata as well as `DataPoint`s and `DataBlock`s associated with it. A `DataPoint` such as the `currently` property on `Forecast` represents various weather phenomena occurring at a specific instant in time. A `DataBlock` such as the `minutely`, `hourly`, and `daily` properties on `Forecast` represent the various weather phenomena occurring over a period of time and are represented by an array of `DataPoint`s.\n\n`DataPoint`s and `DataBlock`s contain a large amount of information, and any of these fields can be excluded from the API response through the `excludeFields` parameter of the `getForecast` methods. `excludeFields` is optional and defaults to an empty array, meaning no data will be excluded from the API response. Alternatively, if you need more data, you can set the `extendHourly` parameter of the `getForecast` method to `true` to make the `hourly` property on `Forecast` return hourly data for a full week instead of 24 hours. `extendHourly` is an optional parameter and defaults to `false`. `extendHourly` is not supported on time machine requests.\n\nFor a full list of properties defined on all models, consult the [full documentation on CocoaDocs](http://cocoadocs.org/docsets/ForecastIO).\n\n## Author\n\nSatyam Ghodasara, sghodas@gmail.com, [@\\_Satyam\\_](https://twitter.com/_satyam_)\n\n## License\n\nForecastIO is available under the MIT license. See the `LICENSE` file for more info.\n","funding_links":[],"categories":["SDK"],"sub_categories":["Unofficial","Other free courses"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsxg%2FForecastIO","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsxg%2FForecastIO","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsxg%2FForecastIO/lists"}