TechnologiesFoundation, System & Concurrency

WeatherKit

iOSmacOStvOSwatchOSvisionOS

WeatherKit fetches current, hourly, daily, and historical weather forecasts and statistics for a location through WeatherService. You request a Weather value to read CurrentWeather, MinuteWeather, HourWeather, and DayWeather, or run queries such as DailyWeatherStatisticsQuery and MonthlyWeatherStatisticsQuery to obtain summaries and statistics including DayTemperatureStatistics, DayPrecipitationStatistics, and HistoricalComparisons. Individual measurements are modeled by types like UVIndex, Precipitation, PressureTrend, SunEvents, and MoonEvents, and apps surface active conditions with WeatherAlert while crediting data sources through WeatherAttribution.

Essentials 6

Request weather data and read the assembled forecast for a location.

  • Cl
    WeatherServiceiOS 16.0+
    Provides an interface for obtaining weather data.
  • St
    WeatheriOS 16.0+
    A model representing the aggregate weather data the caller requests.
  • St
    WeatherQueryiOS 16.0+
    A structure that encapsulates a generic weather dataset request.
  • St
    WeatherAvailabilityiOS 16.0+
    A structure that indicates the availability of data at the requested location.
  • St
    WeatherMetadataiOS 16.0+
    A structure that provides additional weather information.
  • St
    WeatherAttributioniOS 16.0+
    A structure that defines the necessary information for attributing a weather data provider.

Current and Forecast Weather 6

Time-based forecast values describing conditions now and over coming minutes, hours, and days.

  • St
    CurrentWeatheriOS 16.0+
    A structure that describes the current conditions observed at a location.
  • St
    MinuteWeatheriOS 16.0+
    A structure that represents the next hour minute forecasts.
  • St
    HourWeatheriOS 16.0+
    A structure that represents the weather conditions for the hour.
  • St
    DayWeatheriOS 16.0+
    A structure that represents the weather conditions for the day.
  • St
    DayPartForecastiOS 18.0+
    A structure that represents the weather forecast for part of the day.
  • St
    ForecastiOS 16.0+
    A forecast collection for minute, hourly, and daily forecasts.

Weather Measurements 10

Individual atmospheric measurements and condition values that make up a forecast.

  • St
    UVIndexiOS 16.0+
    The expected intensity of ultraviolet radiation from the sun.
  • En
    PrecipitationiOS 16.0+
    The form of precipitation.
  • St
    PrecipitationAmountByTypeiOS 18.0+
    A structure that provides a breakdown of amounts of all forms of precipitation that is expected to occur over a period of time.
  • St
    SnowfallAmountiOS 18.0+
    A structure that describes the snowfall amount over a period of time.
  • St
    CloudCoverByAltitudeiOS 18.0+
    Contains the percentage of sky covered by low, medium and high altitude cloud.
  • St
    WindiOS 16.0+
    Contains wind data of speed, direction, and gust.
  • En
    PressureTrendiOS 16.0+
    The atmospheric pressure change over time.
  • En
    WeatherConditioniOS 16.0+
    A description of the current weather condition.
  • St
    SunEventsiOS 16.0+
    An enumeration that represents dates of solar events, including sunrise, sunset, dawn, and dusk.
  • St
    MoonEventsiOS 16.0+
    A structure that represents lunar events.

Weather Alerts 2

Active severe-weather advisories and their severity for a location.

  • St
    WeatherAlertiOS 16.0+
    A weather alert issued for the requested location by a governmental authority.
  • En
    WeatherSeverityiOS 16.0+
    A description of the severity of the severe weather event.

Statistics Queries 4

Queries that summarize historical and statistical weather data over days, hours, and months.

  • St
    DailyWeatherStatisticsQueryiOS 18.0+
    A structure that encapsulates a generic daily weather statistics dataset request.
  • St
    HourlyWeatherStatisticsQueryiOS 18.0+
    A structure that encapsulates a generic hourly weather statistics dataset request.
  • St
    MonthlyWeatherStatisticsQueryiOS 18.0+
    A structure that encapsulates a generic monthly weather statistics dataset request.
  • St
    DailyWeatherSummaryQueryiOS 18.0+
    A structure that encapsulates a generic daily weather summary dataset request.

Statistics and Summaries 11

Result types holding statistical summaries of temperature and precipitation across time periods.

  • St
    DailyWeatherStatisticsiOS 18.0+
    A structure that holds a collection of day weather statistics data.
  • St
    HourlyWeatherStatisticsiOS 18.0+
    A structure that holds a collection of hour weather statistics data.
  • St
    MonthlyWeatherStatisticsiOS 18.0+
    A structure that holds a collection of month weather statistics data.
  • St
    DailyWeatherSummaryiOS 18.0+
    A structure that holds a collection of day weather summaries.
  • St
    DayTemperatureStatisticsiOS 18.0+
    A structure that describes temperature statistics for a day.
  • St
    HourTemperatureStatisticsiOS 18.0+
    A structure that describes temperature statistics for a specific hour.
  • St
    MonthTemperatureStatisticsiOS 18.0+
    A structure that describes temperature statistics for a specific month.
  • St
    DayPrecipitationStatisticsiOS 18.0+
    A structure that describes precipitation statistics for a day.
  • St
    MonthPrecipitationStatisticsiOS 18.0+
    A structure that describes precipitation statistics for a specific month.
  • St
    DayTemperatureSummaryiOS 18.0+
    A structure that describes the temperature summary for a day.
  • St
    DayPrecipitationSummaryiOS 18.0+
    A structure that describes the precipitation summary for a day.

Trends and Comparisons 8

Types that express how measurements deviate from or compare against historical baselines.

  • St
    TrendiOS 18.0+
    A structure describing an observed pattern in the data for weather at a location for a specific condition.
  • St
    TrendBaselineiOS 18.0+
    A type encapsulating everything there is to know about what a trend baseline is.
  • St
    PercentilesiOS 18.0+
    A structure that describes probability distributions for a measurable weather condition.
  • St
    HistoricalComparisonsiOS 18.0+
    A structure that represents the weather condition comparisons for a specific location.
  • En
    HistoricalComparisoniOS 18.0+
    An enum that represents a recognized comparison in the statistical analysis of a location's historical weather data.
  • St
    WeatherChangeiOS 18.0+
    A structure that informs how certain measurable weather aspects are expected to change relative to before.
  • St
    WeatherChangesiOS 18.0+
    A structure that represents the Weather Change forecast. It provides a qualitative assessment of whether
  • En
    DeviationiOS 18.0+
    Describes a comparison between two values in a trend.

Errors 1

Errors reported when a weather request cannot be completed.

  • En
    WeatherErroriOS 16.0+
    An error WeatherKit returns.

Enumerations 1

  • En
    MoonPhaseiOS 16.0+
    An enumeration that specifies the moon phase kind.
← Foundation, System & Concurrency