GitHunt
LE

LeoSM-07/OpenMeteoSwift

Client SDK for Open-Meteo, the free weather forecast API for non-commercial use

OpenMeteo Swift

Swift Test Badge
Deploy DocC

A swift package that enables swifty communication with the free Open-Meteo API. Please note that this package is still under development and may have several bugs.

Please refer to the full documentation that has additional guides and other supporting documentation.

Current Features & Todo:

Current Features

  • Weather Forecast Calls
  • Marine Forecast Calls
  • Geocoding API Calls

Todo:

  • Clean up return data for marine forecast
  • Add historical forecast
  • Add air quality forecast
  • Maybe more? Submit an issue for requests :)

Weather Forecast Request

See the full API explorer on the official Open-Meteo website

An example forecast request could look like the following:

let result = await OpenMeteo().forecast(
    lat: 34.03,
    long: -118.49,
    hourly: [
        .temperature2m,
        .apparentTemperature,
    ],
    currentWeather: true,
    timezone: "America/Los_Angeles",
    pastDays: 2,
    forecastDays: 5,
    temperatureUnit: .fahrenheit,
    windSpeedUnit: .mph,
    precipitationUnit: .inch
)


if let error = result.error {
    // Handle Error
} else if let data = result.data {
    // Handle Data
}

Languages

Swift100.0%

Contributors

MIT License
Created March 19, 2023
Updated February 5, 2026