{"id":20908673,"url":"https://github.com/anverbogatov/openweathermapkit","last_synced_at":"2025-05-13T06:34:04.954Z","repository":{"id":62449646,"uuid":"115435553","full_name":"anverbogatov/OpenWeatherMapKit","owner":"anverbogatov","description":"🌦 OpenWeatherMapKit is a small and simple framework written in Swift that gives you access to all features of the OpenWeatherMap service's APIs right in your iOS / macOS / watchOS/ tvOS application. ☔️","archived":false,"fork":false,"pushed_at":"2020-12-05T16:30:31.000Z","size":610,"stargazers_count":20,"open_issues_count":0,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-27T00:32:26.628Z","etag":null,"topics":["ios","openweathermap","swift"],"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/anverbogatov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-26T15:55:32.000Z","updated_at":"2024-08-31T17:54:45.000Z","dependencies_parsed_at":"2022-11-01T23:30:33.182Z","dependency_job_id":null,"html_url":"https://github.com/anverbogatov/OpenWeatherMapKit","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anverbogatov%2FOpenWeatherMapKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anverbogatov%2FOpenWeatherMapKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anverbogatov%2FOpenWeatherMapKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anverbogatov%2FOpenWeatherMapKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anverbogatov","download_url":"https://codeload.github.com/anverbogatov/OpenWeatherMapKit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253889865,"owners_count":21979709,"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","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":["ios","openweathermap","swift"],"created_at":"2024-11-18T14:08:23.699Z","updated_at":"2025-05-13T06:34:04.468Z","avatar_url":"https://github.com/anverbogatov.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/anverbogatov/OpenWeatherMapKit.svg?branch=master)](https://travis-ci.org/anverbogatov/OpenWeatherMapKit)\n[![codecov](https://codecov.io/gh/anverbogatov/OpenWeatherMapKit/branch/master/graph/badge.svg)](https://codecov.io/gh/anverbogatov/OpenWeatherMapKit)\n[![Badge w/ Version](https://cocoapod-badges.herokuapp.com/v/OpenWeatherMapKit/badge.png)](https://cocoadocs.org/docsets/OpenWeatherMapKit)\n||\n[![Swift](https://img.shields.io/badge/swift-4.2-orange.svg)](https://img.shields.io/badge/swift-4.2-orange.svg)\n[![Badge w/ Platform](https://cocoapod-badges.herokuapp.com/p/OpenWeatherMapKit/badge.svg)](https://cocoadocs.org/docsets/OpenWeatherMapKit)\n\n```\n⚠️ Message from author: ⚠️\n\nGuys thanks for your incredible support of that project. I see that it was useful for somebody and that makes me really happy.\nAnyway, since last years I was mainly working as cloud-native applications developer and was using other technologies, I have no\nplans to update this SDK at all.\n\nSo, feel free to fork it and make your own implementation of it. There is no need to create issues / requests here.\n```\n\n# OpenWeatherMapKit\nOpenWeatherMapKit is a small and simple framework written in Swift that gives you access to all features of the OpenWeatherMap service's APIs right in your iOS / macOS / watchOS/ tvOS application.\n\n## How to install:\n\n#### 🥥 Cocoapods\nJust add following line to your Podfile:\n```ruby\npod 'OpenWeatherMapKit'\n```\nand run following command in your Terminal from project's root folder:\n```shell\npod update\n```\n\n## How to use:\n\n#### Prerequisites\nTo normal working OpenWeatherMapKit must be initialized with your API token.\n\nYou can use following method to initialize OpenWeatherMapKit. Just replace `[YOUR API TOKEN]` by your own API token which can be retrieved from https://home.openweathermap.org/api_keys:\n```swift\n OpenWeatherMapKit.initialize(withAppId: \"[YOUR API TOKEN]\")\n```\n\n#### Usage\nUse `OpenWeatherMapKit` class to retrieve weather data. It is a singleton and access to it's instance can be done through `instance` variable.\n\n##### 🌇 Get weather by City\nYou can retrieve weather data for specific city by it's name:\n```swift\nOpenWeatherMapKit.instance.currentWeather(forCity: \"Samara\") { (forecast, error) in\n    ...\n}\n```\nor event by city name and country code:\n```swift\nOpenWeatherMapKit.instance.currentWeather(forCity: \"Samara\", withCountryCode: \"ru\") { (forecast, error) in\n    ...\n}\n```\n\n##### 🌍 Get weather by geo coordinates\nYou can retrieve weather data for specific geo location by it's coordinates:\n```swift\nOpenWeatherMapKit.instance.currentWeather(forCoordiante: (latitude: 53.2610313, longitude: 50.0579958)) { (forecast, error) in\n    ...\n}\n```\n\n##### 📆 Get weather forecast for next 5 days\nYou can retrieve weather data for next five days for specific city by it's name and country code:\n```swift\nOpenWeatherMapKit.instance.weatherForecastForFiveDays(forCity: \"Samara\", withCountryCode: \"ru\") { (forecast, error) in\n...\n}\n```\nor for specific geo location by it's coordinates:\n```swift\nOpenWeatherMapKit.instance.weatherForecastForFiveDays(forCoordiante: (latitude: 53.2610313, longitude: 50.0579958)) { (forecast, error) in\n...\n}\n```\n\n##### 🌤 WeatherItem\nAll operations for getting current weather data return special object of `WeatherItem` type. `WeatherItem` is a simple struct that contains temperature data on the board. Here are fields you can access on it:\n```swift\n/// Weather item's temperature values in Kelvin\npublic let kelvin: (currentTemp: Double, maxTemp: Double, minTemp: Double)\n/// Weather item's temperature values in Celsius\npublic let celsius: (currentTemp: Double, maxTemp: Double, minTemp: Double)\n/// Weather item's temperature values in Fahrenheit\npublic let fahrenheit: (currentTemp: Double, maxTemp: Double, minTemp: Double)\n```\nFor example, if you want to get information on current weather in celsius you achieve that using following statement:\n```swift\nweatherItem.celsius.currentTemp\n```\n\nWeatherItem can be accessed from instances of `ForecastItem`. Here is example:\n```swift\nforecast.main.celsius.currentTemp\n```\n\n## 🛣 Roadmap\nPlease find project's roadmap below:\n\n| Version | ETA | Feature |\n| ------- | --- | ------- |\n| ✅ v0.1    | January 2018 | Current weather forecast by city \u0026 geo coordinates + support of different units (Celsius, Kelvin, Fahrenheit) |\n| ✅ v0.2 | April 2018 | Weather forecast for 5 days / 3 hour by city \u0026 geo coordinates. |\n| v0.3 | ??? | 16 day daily forecast by city \u0026 geo coordinates. |\n\n\u003chr/\u003e\n\n⚠️ Support of other platforms (like watchOS, macOS \u0026 tvOS) will be introduced later\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanverbogatov%2Fopenweathermapkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanverbogatov%2Fopenweathermapkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanverbogatov%2Fopenweathermapkit/lists"}