Migrating from Dark Sky to Apple's WeatherKit service, I am seeing the API return only celsius temperature values. I am using this URL:
https://weatherkit.apple.com/api/v1/weather/en_US/45.6270162/-122.6808005?countryCode=US&timezone=America%2FLos_Angeles&dataSets=currentWeather
Based upon what I've read around the internet, this seems correctly formatted, so I don't know why I'm having this locale issue. I've read in other places people talking about how they get fahrenheit temperatures when retrieving weather data in America, so I'm not sure where I'm going wrong.
The docs indicate the WeatherKit REST API only returns metric values. Whenever a temperature-related value is described in the docs it explicitly includes " in degrees Celsius" in the description.
Example: https://developer.apple.com/documentation/weatherkitrestapi/currentweather/currentweatherdata
I wrote a little JS helper to convert the data in my apps:
const metricToImperial = {
cToF: (value) => value * 1.8 + 32,
mToMi: (value) => value / 1609.344,
kmToMi: (value) => value / 1.609344,
mmToIn: (value) => value / 25.4,
};
// example usage
const tempInF = metricToImperial.cToF(yourCelciusTemp);
console.log(tempInF);