Contents

GET /api/v1/weather/{language}/{latitude}/{longitude}

Obtain weather data for the specified location.

URL

GET https://weatherkit.apple.com/api/v1/weather/{language}/{latitude}/{longitude}

Path Parameters

NameTypeDescription
language Requiredstring

The language tag to use for localizing responses.

latitude RequiredLatitude

The latitude of the desired location.

longitude RequiredLongitude

The longitude of the desired location.

Query Parameters

NameTypeDescription
countryCode Optionalstring

The ISO Alpha-2 country code for the requested location. This parameter is necessary for weather alerts.

currentAsOf Optionaldate-time

The time to obtain current conditions. Defaults to now.

dailyEnd Optionaldate-time

The time to end the daily forecast. If this parameter is absent, daily forecasts run for 10 days.

dailyStart Optionaldate-time

The time to start the daily forecast. If this parameter is absent, daily forecasts start on the current day.

dataSets Optional[DataSet]

A comma-delimited list of data sets to include in the response.

hourlyEnd Optionaldate-time

The time to end the hourly forecast. If this parameter is absent, hourly forecasts run 24 hours or the length of the daily forecast, whichever is longer.

hourlyStart Optionaldate-time

The time to start the hourly forecast. If this parameter is absent, hourly forecasts start on the current hour.

timezone Requiredstring

The name of the timezone to use for rolling up weather forecasts into daily forecasts.

Response Codes

StatusReasonTypeDescription
200OK
Content-Type: application/json
Weather

The request is successful. The weather alert is in the response.

400Bad Request

The server is unable to process the request due to an invalid parameter value.

401Unauthorized

The request isn’t authorized or doesn’t include the correct authentication information.

See Also

Obtaining weather information for a location