

{"id":13494,"date":"2022-07-07T08:22:13","date_gmt":"2022-07-07T13:22:13","guid":{"rendered":"https:\/\/rud.is\/b\/?p=13494"},"modified":"2022-07-07T08:22:13","modified_gmt":"2022-07-07T13:22:13","slug":"introducing-weatherkit-the-eventual-replacement-r-package-for-darksky","status":"publish","type":"post","link":"https:\/\/rud.is\/b\/2022\/07\/07\/introducing-weatherkit-the-eventual-replacement-r-package-for-darksky\/","title":{"rendered":"Introducing {weatherkit}: The Eventual Replacement R Package for {darksky}"},"content":{"rendered":"<p>My {<a href=\"https:\/\/github.com\/hrbrmstr\/darksky\">darksky<\/a>} package has been around for years, now, and the service that powers it was purchased by Apple before the pandemic. The DarkSky API is slated to be shuttered in December of this year and is being replaced by Apple&#8217;s <a href=\"https:\/\/developer.apple.com\/weatherkit\/\">WeatherKit<\/a> xOS Framework and REST API.<\/p>\n<p>I&#8217;ve started work on a {<a href=\"https:\/\/github.com\/hrbrmstr\/weatherkit\">weatherkit<\/a>} package which uses the WeatherKit REST API. You&#8217;ll need an Apple Developer account and will also need to <a href=\"https:\/\/github.com\/hrbrmstr\/weatherkit\/blob\/batman\/authorization.md\">setup some items in said account, and locally<\/a> so you can authenticate to the API. Once all the authentication bits are setup, it&#8217;s pretty easy to get the weather data:<\/p>\n<pre><code class=\"language-r\">wx &lt;- wxkit_weather(43.2683199, -70.8635506)\nwx &lt;- wx_tidy(wx)\nstr(wx)\n## List of 4\n##  $ currentWeather  :List of 18\n##   ..$ name                  : chr \"CurrentWeather\"\n##   ..$ metadata              :List of 8\n##   .. ..$ attributionURL: chr \"https:\/\/weather-data.apple.com\/legal-attribution.html\"\n##   .. ..$ expireTime    : POSIXct[1:1], format: \"2022-07-07 12:28:07\"\n##   .. ..$ latitude      : num 43.3\n##   .. ..$ longitude     : num -70.9\n##   .. ..$ readTime      : POSIXct[1:1], format: \"2022-07-07 12:23:07\"\n##   .. ..$ reportedTime  : POSIXct[1:1], format: \"2022-07-07 10:48:55\"\n##   .. ..$ units         : chr \"m\"\n##   .. ..$ version       : int 1\n##   ..$ asOf                  : POSIXct[1:1], format: \"2022-07-07 12:23:07\"\n##   ..$ cloudCover            : num 0.29\n##   ..$ conditionCode         : chr \"MostlyClear\"\n##   ..$ daylight              : logi TRUE\n##   ..$ humidity              : num 0.68\n##   ..$ precipitationIntensity: num 0\n##   ..$ pressure              : num 1018\n##   ..$ pressureTrend         : chr \"rising\"\n##   ..$ temperature           : num 19.5\n##   ..$ temperatureApparent   : num 19.4\n##   ..$ temperatureDewPoint   : num 13.5\n##   ..$ uvIndex               : int 2\n##   ..$ visibility            : num 29413\n##   ..$ windDirection         : int 50\n##   ..$ windGust              : num 12\n##   ..$ windSpeed             : num 4.42\n##  $ forecastDaily   :List of 3\n##   ..$ name    : chr \"DailyForecast\"\n##   ..$ metadata:List of 8\n##   .. ..$ attributionURL: chr \"https:\/\/weather-data.apple.com\/legal-attribution.html\"\n##   .. ..$ expireTime    : POSIXct[1:1], format: \"2022-07-07 13:23:07\"\n##   .. ..$ latitude      : num 43.3\n##   .. ..$ longitude     : num -70.9\n##   .. ..$ readTime      : POSIXct[1:1], format: \"2022-07-07 12:23:07\"\n##   .. ..$ reportedTime  : POSIXct[1:1], format: \"2022-07-07 10:48:55\"\n##   .. ..$ units         : chr \"m\"\n##   .. ..$ version       : int 1\n##   ..$ days    :'data.frame': 10 obs. of  26 variables:\n##   .. ..$ forecastStart      : POSIXct[1:10], format: \"2022-07-07 04:00:00\" \"2022-07-08 04:00:00\" \"2022-07-09 04:00:00\" \"2022-07-10 04:00:00\" ...\n##   .. ..$ forecastEnd        : POSIXct[1:10], format: \"2022-07-08 04:00:00\" \"2022-07-09 04:00:00\" \"2022-07-10 04:00:00\" \"2022-07-11 04:00:00\" ...\n##   .. ..$ conditionCode      : chr [1:10] \"PartlyCloudy\" \"PartlyCloudy\" \"MostlyClear\" \"MostlyClear\" ...\n##   .. ..$ maxUvIndex         : int [1:10] 7 7 7 8 7 6 7 4 5 4\n##   .. ..$ moonPhase          : chr [1:10] \"firstQuarter\" \"firstQuarter\" \"waxingGibbous\" \"waxingGibbous\" ...\n##   .. ..$ moonrise           : POSIXct[1:10], format: \"2022-07-07 17:38:12\" \"2022-07-08 18:50:47\" \"2022-07-09 20:07:35\" \"2022-07-10 21:27:35\" ...\n##   .. ..$ moonset            : POSIXct[1:10], format: \"2022-07-07 04:32:48\" \"2022-07-08 04:54:51\" \"2022-07-09 05:20:27\" \"2022-07-10 05:51:50\" ...\n##   .. ..$ precipitationAmount: num [1:10] 0 0.49 0 0 0 1.32 0.24 3.44 5.07 8.35\n##   .. ..$ precipitationChance: num [1:10] 0.01 0.15 0.07 0 0.07 0.39 0.37 0.4 0.47 0.44\n##   .. ..$ precipitationType  : chr [1:10] \"clear\" \"rain\" \"clear\" \"clear\" ...\n##   .. ..$ snowfallAmount     : num [1:10] 0 0 0 0 0 0 0 0 0 0\n##   .. ..$ solarMidnight      : POSIXct[1:10], format: \"2022-07-07 04:48:29\" \"2022-07-08 04:48:39\" \"2022-07-09 04:48:49\" \"2022-07-10 04:48:58\" ...\n##   .. ..$ solarNoon          : POSIXct[1:10], format: \"2022-07-07 16:48:26\" \"2022-07-08 16:48:35\" \"2022-07-09 16:48:44\" \"2022-07-10 16:48:53\" ...\n##   .. ..$ sunrise            : POSIXct[1:10], format: \"2022-07-07 09:10:59\" \"2022-07-08 09:11:42\" \"2022-07-09 09:12:26\" \"2022-07-10 09:13:11\" ...\n##   .. ..$ sunriseCivil       : POSIXct[1:10], format: \"2022-07-07 08:36:06\" \"2022-07-08 08:36:53\" \"2022-07-09 08:37:41\" \"2022-07-10 08:38:31\" ...\n##   .. ..$ sunriseNautical    : POSIXct[1:10], format: \"2022-07-07 07:50:45\" \"2022-07-08 07:51:39\" \"2022-07-09 07:52:36\" \"2022-07-10 07:53:34\" ...\n##   .. ..$ sunriseAstronomical: POSIXct[1:10], format: \"2022-07-07 06:55:17\" \"2022-07-08 06:56:30\" \"2022-07-09 06:57:46\" \"2022-07-10 06:59:04\" ...\n##   .. ..$ sunset             : POSIXct[1:10], format: \"2022-07-08 00:25:50\" \"2022-07-09 00:25:26\" \"2022-07-10 00:24:59\" \"2022-07-11 00:24:30\" ...\n##   .. ..$ sunsetCivil        : POSIXct[1:10], format: \"2022-07-08 01:00:39\" \"2022-07-09 01:00:10\" \"2022-07-10 00:59:38\" \"2022-07-11 00:59:04\" ...\n##   .. ..$ sunsetNautical     : POSIXct[1:10], format: \"2022-07-08 01:46:01\" \"2022-07-09 01:45:23\" \"2022-07-10 01:44:42\" \"2022-07-11 01:43:58\" ...\n##   .. ..$ sunsetAstronomical : POSIXct[1:10], format: \"2022-07-08 02:41:14\" \"2022-07-09 02:40:16\" \"2022-07-10 02:39:14\" \"2022-07-11 02:38:09\" ...\n##   .. ..$ temperatureMax     : num [1:10] 25.8 28.7 24.9 25.4 28.9 ...\n##   .. ..$ temperatureMin     : num [1:10] 13.7 16.3 14.8 12.2 12.4 ...\n##   .. ..$ daytimeForecast    :'data.frame':   10 obs. of  11 variables:\n##   .. .. ..$ forecastStart      : POSIXct[1:10], format: \"2022-07-07 11:00:00\" \"2022-07-08 11:00:00\" \"2022-07-09 11:00:00\" \"2022-07-10 11:00:00\" ...\n##   .. .. ..$ forecastEnd        : POSIXct[1:10], format: \"2022-07-07 23:00:00\" \"2022-07-08 23:00:00\" \"2022-07-09 23:00:00\" \"2022-07-10 23:00:00\" ...\n##   .. .. ..$ cloudCover         : num [1:10] 0.39 0.45 0.33 0.11 0.42 0.69 0.39 0.95 0.87 0.88\n##   .. .. ..$ conditionCode      : chr [1:10] \"PartlyCloudy\" \"PartlyCloudy\" \"MostlyClear\" \"Clear\" ...\n##   .. .. ..$ humidity           : num [1:10] 0.57 0.58 0.54 0.47 0.49 0.63 0.64 0.71 0.7 0.66\n##   .. .. ..$ precipitationAmount: num [1:10] 0 0.31 0 0 0 0.26 0.17 3.15 0.22 1.37\n##   .. .. ..$ precipitationChance: num [1:10] 0 0.09 0.04 0 0.02 0.29 0.16 0.31 0.33 0.3\n##   .. .. ..$ precipitationType  : chr [1:10] \"clear\" \"rain\" \"clear\" \"clear\" ...\n##   .. .. ..$ snowfallAmount     : num [1:10] 0 0 0 0 0 0 0 0 0 0\n##   .. .. ..$ windDirection      : int [1:10] 155 263 122 237 231 228 219 98 39 62\n##   .. .. ..$ windSpeed          : num [1:10] 8.73 9.42 7.42 6.23 9.75 ...\n##   .. ..$ overnightForecast  :'data.frame':   10 obs. of  11 variables:\n##   .. .. ..$ forecastStart      : POSIXct[1:10], format: \"2022-07-07 23:00:00\" \"2022-07-08 23:00:00\" \"2022-07-09 23:00:00\" \"2022-07-10 23:00:00\" ...\n##   .. .. ..$ forecastEnd        : POSIXct[1:10], format: \"2022-07-08 11:00:00\" \"2022-07-09 11:00:00\" \"2022-07-10 11:00:00\" \"2022-07-11 11:00:00\" ...\n##   .. .. ..$ cloudCover         : num [1:10] 0.49 0.5 0.15 0.37 0.46 0.4 0.88 0.91 0.8 NA\n##   .. .. ..$ conditionCode      : chr [1:10] \"PartlyCloudy\" \"PartlyCloudy\" \"MostlyClear\" \"MostlyClear\" ...\n##   .. .. ..$ humidity           : num [1:10] 0.78 0.78 0.71 0.73 0.69 0.81 0.83 0.85 0.84 NA\n##   .. .. ..$ precipitationAmount: num [1:10] 0.06 0.11 0 0 0 1.11 0.04 2.26 6.47 NA\n##   .. .. ..$ precipitationChance: num [1:10] 0.05 0.07 0.01 0.02 0.1 0.27 0.24 0.31 0.31 NA\n##   .. .. ..$ precipitationType  : chr [1:10] \"rain\" \"rain\" \"clear\" \"clear\" ...\n##   .. .. ..$ snowfallAmount     : num [1:10] 0 0 0 0 0 0 0 0 0 NA\n##   .. .. ..$ windDirection      : int [1:10] 192 341 347 223 218 242 276 13 49 NA\n##   .. .. ..$ windSpeed          : num [1:10] 9.92 7.15 6.59 5.52 10.95 ...\n##   .. ..$ restOfDayForecast  :'data.frame':   10 obs. of  11 variables:\n##   .. .. ..$ forecastStart      : POSIXct[1:10], format: \"2022-07-07 12:23:07\" NA NA NA ...\n##   .. .. ..$ forecastEnd        : POSIXct[1:10], format: \"2022-07-08 04:00:00\" NA NA NA ...\n##   .. .. ..$ cloudCover         : num [1:10] 0.47 NA NA NA NA NA NA NA NA NA\n##   .. .. ..$ conditionCode      : chr [1:10] \"PartlyCloudy\" NA NA NA ...\n##   .. .. ..$ humidity           : num [1:10] 0.6 NA NA NA NA NA NA NA NA NA\n##   .. .. ..$ precipitationAmount: num [1:10] 0 NA NA NA NA NA NA NA NA NA\n##   .. .. ..$ precipitationChance: num [1:10] 0.01 NA NA NA NA NA NA NA NA NA\n##   .. .. ..$ precipitationType  : chr [1:10] \"clear\" NA NA NA ...\n##   .. .. ..$ snowfallAmount     : num [1:10] 0 NA NA NA NA NA NA NA NA NA\n##   .. .. ..$ windDirection      : int [1:10] 163 NA NA NA NA NA NA NA NA NA\n##   .. .. ..$ windSpeed          : num [1:10] 9.7 NA NA NA NA NA NA NA NA NA\n##  $ forecastHourly  :List of 3\n##   ..$ name    : chr \"HourlyForecast\"\n##   ..$ metadata:List of 8\n##   .. ..$ attributionURL: chr \"https:\/\/weather-data.apple.com\/legal-attribution.html\"\n##   .. ..$ expireTime    : POSIXct[1:1], format: \"2022-07-07 13:23:07\"\n##   .. ..$ latitude      : num 43.3\n##   .. ..$ longitude     : num -70.9\n##   .. ..$ readTime      : POSIXct[1:1], format: \"2022-07-07 12:23:07\"\n##   .. ..$ reportedTime  : POSIXct[1:1], format: \"2022-07-07 10:48:55\"\n##   .. ..$ units         : chr \"m\"\n##   .. ..$ version       : int 1\n##   ..$ hours   :'data.frame': 243 obs. of  20 variables:\n##   .. ..$ forecastStart         : POSIXct[1:243], format: \"2022-07-07 02:00:00\" \"2022-07-07 03:00:00\" \"2022-07-07 04:00:00\" \"2022-07-07 05:00:00\" ...\n##   .. ..$ cloudCover            : num [1:243] 0.02 0.01 0.02 0.31 0.44 0.74 0.3 1 0.96 0.32 ...\n##   .. ..$ conditionCode         : chr [1:243] \"Clear\" \"Clear\" \"Clear\" \"MostlyClear\" ...\n##   .. ..$ daylight              : logi [1:243] FALSE FALSE FALSE FALSE FALSE FALSE ...\n##   .. ..$ humidity              : num [1:243] 0.74 0.78 0.81 0.83 0.86 0.88 0.9 0.92 0.88 0.83 ...\n##   .. ..$ precipitationAmount   : num [1:243] 0 0 0 0 0 0 0 0 0 0 ...\n##   .. ..$ precipitationIntensity: num [1:243] 0 0 0 0 0 0 0 0 0 0 ...\n##   .. ..$ precipitationChance   : num [1:243] 0 0 0 0 0 0 0 0 0 0 ...\n##   .. ..$ precipitationType     : chr [1:243] \"clear\" \"clear\" \"clear\" \"clear\" ...\n##   .. ..$ pressure              : num [1:243] 1014 1015 1016 1016 1016 ...\n##   .. ..$ pressureTrend         : chr [1:243] \"rising\" \"rising\" \"rising\" \"rising\" ...\n##   .. ..$ snowfallIntensity     : num [1:243] 0 0 0 0 0 0 0 0 0 0 ...\n##   .. ..$ temperature           : num [1:243] 18.3 17 16.3 15.7 14.9 ...\n##   .. ..$ temperatureApparent   : num [1:243] 18.2 16.9 16.1 15.5 14.7 ...\n##   .. ..$ temperatureDewPoint   : num [1:243] 13.6 13.1 12.9 12.8 12.6 ...\n##   .. ..$ uvIndex               : int [1:243] 0 0 0 0 0 0 0 0 0 1 ...\n##   .. ..$ visibility            : num [1:243] 28105 26514 24730 23883 23669 ...\n##   .. ..$ windDirection         : int [1:243] 315 302 315 308 310 298 307 316 319 6 ...\n##   .. ..$ windGust              : num [1:243] 2.93 2.56 2.92 3.25 3.35 ...\n##   .. ..$ windSpeed             : num [1:243] 2.93 2.56 2.92 3.25 3.35 3.09 3.51 2.91 2.36 4.55 ...\n##  $ forecastNextHour:List of 6\n##   ..$ name         : chr \"NextHourForecast\"\n##   ..$ metadata     :List of 9\n##   .. ..$ attributionURL: chr \"https:\/\/weather-data.apple.com\/legal-attribution.html\"\n##   .. ..$ expireTime    : POSIXct[1:1], format: \"2022-07-07 13:23:07\"\n##   .. ..$ language      : chr \"en-US\"\n##   .. ..$ latitude      : num 43.3\n##   .. ..$ longitude     : num -70.9\n##   .. ..$ providerName  : chr \"US National Weather Service\"\n##   .. ..$ readTime      : POSIXct[1:1], format: \"2022-07-07 12:23:07\"\n##   .. ..$ units         : chr \"m\"\n##   .. ..$ version       : int 1\n##   ..$ summary      :'data.frame':    1 obs. of  4 variables:\n##   .. ..$ startTime             : POSIXct[1:1], format: \"2022-07-07 12:24:00\"\n##   .. ..$ condition             : chr \"clear\"\n##   .. ..$ precipitationChance   : num 0\n##   .. ..$ precipitationIntensity: num 0\n##   ..$ forecastStart: POSIXct[1:1], format: \"2022-07-07 12:24:00\"\n##   ..$ forecastEnd  : POSIXct[1:1], format: \"2022-07-07 13:45:00\"\n##   ..$ minutes      :'data.frame':    81 obs. of  3 variables:\n##   .. ..$ startTime             : POSIXct[1:81], format: \"2022-07-07 12:24:00\" \"2022-07-07 12:25:00\" \"2022-07-07 12:26:00\" \"2022-07-07 12:27:00\" ...\n##   .. ..$ precipitationChance   : num [1:81] 0 0 0 0 0 0 0 0 0 0 ...\n##   .. ..$ precipitationIntensity: num [1:81] 0 0 0 0 0 0 0 0 0 0 ...\n<\/code><\/pre>\n<p>The <code>wx_tidy()<\/code> function, for now, only does date-time string conversion to <code>POSIXct<\/code> objects, but it may do more in the future.<\/p>\n<p>It doesn&#8217;t appear that historical weather data is available, yet, so you&#8217;re limited to using the API to get daily and hourly conditions and forecasts for the present plus some days. As such, I&#8217;ve focused a bit on some helper functions to show current conditions and forecasts in the R console\/stdout:<\/p>\n<pre><code class=\"language-r\">current_conditions(wx)\n<\/code><\/pre>\n<pre><code>## \uf8ff Weather for (43.268, -70.864) as of 2022-07-07 08:23:07\n## \n##  Conditions: Mostly Clear\n## Temperature: 67.08\u00b0F\n##  Feels like: 66.92\u00b0F\n##   Dew Point: 56.28\u00b0F\n##        Wind: 2.7 mph (NE)\n##    Pressure: 1017.68 mb (rising)\n##  Visibility: 18 miles\n##    UV Index: ? 2 (Low)\n## \n## https:\/\/weather-data.apple.com\/legal-attribution.html\n<\/code><\/pre>\n<pre><code class=\"language-r\">hourly_forecast(wx)\n<\/code><\/pre>\n<pre><code>## \uf8ff Weather forecast for (43.268, -70.864) as of 2022-07-07 08:23:07\n## \n## Today @ 09:00 \u2502 ? 69\u00b0F \u2502 ? 63% \u2502 1018 mb \u2014 \u2502 ? \u2502 Mostly Clear  \u2502 ?\n##       @ 10:00 \u2502 ? 71\u00b0F \u2502 ? 58% \u2502 1018 mb \u2014 \u2502 ? \u2502 Mostly Clear  \u2502 ?\n##       @ 11:00 \u2502 ? 74\u00b0F \u2502 ? 55% \u2502 1018 mb \u2014 \u2502 ? \u2502 Mostly Clear  \u2502 ?\n##       @ 12:00 \u2502 ? 75\u00b0F \u2502 ? 53% \u2502 1017 mb \u2014 \u2502 ? \u2502 Partly Cloudy \u2502 ?\n##       @ 13:00 \u2502 ? 77\u00b0F \u2502 ? 51% \u2502 1017 mb \u2193 \u2502 ? \u2502 Partly Cloudy \u2502 ?\n##       @ 14:00 \u2502 ? 78\u00b0F \u2502 ? 50% \u2502 1016 mb \u2193 \u2502 ? \u2502 Partly Cloudy \u2502 ?\n##       @ 15:00 \u2502 ? 78\u00b0F \u2502 ? 50% \u2502 1016 mb \u2193 \u2502 ? \u2502 Partly Cloudy \u2502 ?\n##       @ 16:00 \u2502 ? 77\u00b0F \u2502 ? 52% \u2502 1016 mb \u2193 \u2502 ? \u2502 Partly Cloudy \u2502 ?\n##       @ 17:00 \u2502 ? 76\u00b0F \u2502 ? 55% \u2502 1015 mb \u2193 \u2502 ? \u2502 Partly Cloudy \u2502 ?\n##       @ 18:00 \u2502 ? 75\u00b0F \u2502 ? 58% \u2502 1015 mb \u2014 \u2502 ? \u2502 Partly Cloudy \u2502 ?\n##       @ 19:00 \u2502 ? 73\u00b0F \u2502 ? 62% \u2502 1015 mb \u2014 \u2502 ? \u2502 Mostly Clear  \u2502 ?\n##       @ 20:00 \u2502 ? 70\u00b0F \u2502 ? 67% \u2502 1015 mb \u2014 \u2502 ? \u2502 Partly Cloudy \u2502 ?\n##       @ 21:00 \u2502 ? 68\u00b0F \u2502 ? 71% \u2502 1015 mb \u2014 \u2502 ? \u2502 Mostly Cloudy \u2502 ?\n##       @ 22:00 \u2502 ? 67\u00b0F \u2502 ? 74% \u2502 1015 mb \u2014 \u2502 ? \u2502 Mostly Cloudy \u2502 ?\n##       @ 23:00 \u2502 ? 67\u00b0F \u2502 ? 74% \u2502 1015 mb \u2014 \u2502 ? \u2502 Mostly Cloudy \u2502 ?\n##   Fri @ 00:00 \u2502 ? 66\u00b0F \u2502 ? 74% \u2502 1015 mb \u2014 \u2502 ? \u2502 Partly Cloudy \u2502 ?\n##       @ 01:00 \u2502 ? 65\u00b0F \u2502 ? 78% \u2502 1015 mb \u2014 \u2502 ? \u2502 Partly Cloudy \u2502 ?\n##       @ 02:00 \u2502 ? 64\u00b0F \u2502 ? 81% \u2502 1015 mb \u2014 \u2502 ? \u2502 Mostly Clear  \u2502 ?\n##       @ 03:00 \u2502 ? 63\u00b0F \u2502 ? 83% \u2502 1015 mb \u2014 \u2502 ? \u2502 Partly Cloudy \u2502 ?\n##       @ 04:00 \u2502 ? 62\u00b0F \u2502 ? 85% \u2502 1015 mb \u2014 \u2502 ? \u2502 Partly Cloudy \u2502 ?\n## \n## https:\/\/weather-data.apple.com\/legal-attribution.html\n<\/code><\/pre>\n<p>Note that the attribution is required by Apple.<\/p>\n<p>I&#8217;ll likely add a daily forecast console printer soon.<\/p>\n<p>There are a few helper functions in the package for value conversion between unit systems, iconifying some values, and working with time zones. {weatherkit} uses <code>lutz::tz_lookup_coords()<\/code> in places to auto-determine the time zone from lat\/lng pairs, and also includes a function to intuit lat\/lng from an IP address using <a href=\"ipapi.co\">ipapi<\/a> (they have a generous free tier).<\/p>\n<p>As of the timestamp on this blog post, Apple\u2019s WeatherKit provides up to 500,000 API calls a month per Apple Developer Program membership. If you need additional API calls, monthly subscription plans will be available for purchase sometime after the beta is officially over. This is the expected pricing:<\/p>\n<ul>\n<li>500,000 calls\/month: Included with membership<\/li>\n<li>1 million calls\/month: US$ 49.99<\/li>\n<li>2 million calls\/month: US$ 99.99<\/li>\n<li>5 million calls\/month: US$ 249.99<\/li>\n<li>10 million calls\/month: US$ 499.99<\/li>\n<li>20 million calls\/month: US$ 999.99<\/li>\n<\/ul>\n<p>Apple&#8217;s WeatherKit documentation consistently says &#8220;Apple Developer Program membership&#8221;, which seems to indicate you need to give them money every year to use the REST API. We&#8217;ll see if that&#8217;s truly the case after the service leaves beta status.<\/p>\n<h3>FIN<\/h3>\n<p>Kick the tyres &amp; drop issues\/PRs as one may be wont to do.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>My {darksky} package has been around for years, now, and the service that powers it was purchased by Apple before the pandemic. The DarkSky API is slated to be shuttered in December of this year and is being replaced by Apple&#8217;s WeatherKit xOS Framework and REST API. I&#8217;ve started work on a {weatherkit} package which [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[663,91,680],"tags":[],"class_list":["post-13494","post","type-post","status-publish","format-standard","hentry","category-apple","category-r","category-weather"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Introducing {weatherkit}: The Eventual Replacement R Package for {darksky} - rud.is<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/rud.is\/b\/2022\/07\/07\/introducing-weatherkit-the-eventual-replacement-r-package-for-darksky\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Introducing {weatherkit}: The Eventual Replacement R Package for {darksky} - rud.is\" \/>\n<meta property=\"og:description\" content=\"My {darksky} package has been around for years, now, and the service that powers it was purchased by Apple before the pandemic. The DarkSky API is slated to be shuttered in December of this year and is being replaced by Apple&#8217;s WeatherKit xOS Framework and REST API. I&#8217;ve started work on a {weatherkit} package which [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/rud.is\/b\/2022\/07\/07\/introducing-weatherkit-the-eventual-replacement-r-package-for-darksky\/\" \/>\n<meta property=\"og:site_name\" content=\"rud.is\" \/>\n<meta property=\"article:published_time\" content=\"2022-07-07T13:22:13+00:00\" \/>\n<meta name=\"author\" content=\"hrbrmstr\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"hrbrmstr\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2022\\\/07\\\/07\\\/introducing-weatherkit-the-eventual-replacement-r-package-for-darksky\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2022\\\/07\\\/07\\\/introducing-weatherkit-the-eventual-replacement-r-package-for-darksky\\\/\"},\"author\":{\"name\":\"hrbrmstr\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"headline\":\"Introducing {weatherkit}: The Eventual Replacement R Package for {darksky}\",\"datePublished\":\"2022-07-07T13:22:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2022\\\/07\\\/07\\\/introducing-weatherkit-the-eventual-replacement-r-package-for-darksky\\\/\"},\"wordCount\":394,\"commentCount\":5,\"publisher\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"articleSection\":[\"Apple\",\"R\",\"Weather\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/rud.is\\\/b\\\/2022\\\/07\\\/07\\\/introducing-weatherkit-the-eventual-replacement-r-package-for-darksky\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2022\\\/07\\\/07\\\/introducing-weatherkit-the-eventual-replacement-r-package-for-darksky\\\/\",\"url\":\"https:\\\/\\\/rud.is\\\/b\\\/2022\\\/07\\\/07\\\/introducing-weatherkit-the-eventual-replacement-r-package-for-darksky\\\/\",\"name\":\"Introducing {weatherkit}: The Eventual Replacement R Package for {darksky} - rud.is\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#website\"},\"datePublished\":\"2022-07-07T13:22:13+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2022\\\/07\\\/07\\\/introducing-weatherkit-the-eventual-replacement-r-package-for-darksky\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/rud.is\\\/b\\\/2022\\\/07\\\/07\\\/introducing-weatherkit-the-eventual-replacement-r-package-for-darksky\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2022\\\/07\\\/07\\\/introducing-weatherkit-the-eventual-replacement-r-package-for-darksky\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/rud.is\\\/b\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Introducing {weatherkit}: The Eventual Replacement R Package for {darksky}\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#website\",\"url\":\"https:\\\/\\\/rud.is\\\/b\\\/\",\"name\":\"rud.is\",\"description\":\"&quot;In God we trust. All others must bring data&quot;\",\"publisher\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/rud.is\\\/b\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\",\"name\":\"hrbrmstr\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/ukr-shield.png?fit=460%2C460&ssl=1\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/ukr-shield.png?fit=460%2C460&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/ukr-shield.png?fit=460%2C460&ssl=1\",\"width\":460,\"height\":460,\"caption\":\"hrbrmstr\"},\"logo\":{\"@id\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/ukr-shield.png?fit=460%2C460&ssl=1\"},\"description\":\"Don't look at me\u2026I do what he does \u2014 just slower. #rstats avuncular \u2022 ?Resistance Fighter \u2022 Cook \u2022 Christian \u2022 [Master] Chef des Donn\u00e9es de S\u00e9curit\u00e9 @ @rapid7\",\"sameAs\":[\"http:\\\/\\\/rud.is\"],\"url\":\"https:\\\/\\\/rud.is\\\/b\\\/author\\\/hrbrmstr\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Introducing {weatherkit}: The Eventual Replacement R Package for {darksky} - rud.is","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/rud.is\/b\/2022\/07\/07\/introducing-weatherkit-the-eventual-replacement-r-package-for-darksky\/","og_locale":"en_US","og_type":"article","og_title":"Introducing {weatherkit}: The Eventual Replacement R Package for {darksky} - rud.is","og_description":"My {darksky} package has been around for years, now, and the service that powers it was purchased by Apple before the pandemic. The DarkSky API is slated to be shuttered in December of this year and is being replaced by Apple&#8217;s WeatherKit xOS Framework and REST API. I&#8217;ve started work on a {weatherkit} package which [&hellip;]","og_url":"https:\/\/rud.is\/b\/2022\/07\/07\/introducing-weatherkit-the-eventual-replacement-r-package-for-darksky\/","og_site_name":"rud.is","article_published_time":"2022-07-07T13:22:13+00:00","author":"hrbrmstr","twitter_card":"summary_large_image","twitter_misc":{"Written by":"hrbrmstr","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/rud.is\/b\/2022\/07\/07\/introducing-weatherkit-the-eventual-replacement-r-package-for-darksky\/#article","isPartOf":{"@id":"https:\/\/rud.is\/b\/2022\/07\/07\/introducing-weatherkit-the-eventual-replacement-r-package-for-darksky\/"},"author":{"name":"hrbrmstr","@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"headline":"Introducing {weatherkit}: The Eventual Replacement R Package for {darksky}","datePublished":"2022-07-07T13:22:13+00:00","mainEntityOfPage":{"@id":"https:\/\/rud.is\/b\/2022\/07\/07\/introducing-weatherkit-the-eventual-replacement-r-package-for-darksky\/"},"wordCount":394,"commentCount":5,"publisher":{"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"articleSection":["Apple","R","Weather"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/rud.is\/b\/2022\/07\/07\/introducing-weatherkit-the-eventual-replacement-r-package-for-darksky\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/rud.is\/b\/2022\/07\/07\/introducing-weatherkit-the-eventual-replacement-r-package-for-darksky\/","url":"https:\/\/rud.is\/b\/2022\/07\/07\/introducing-weatherkit-the-eventual-replacement-r-package-for-darksky\/","name":"Introducing {weatherkit}: The Eventual Replacement R Package for {darksky} - rud.is","isPartOf":{"@id":"https:\/\/rud.is\/b\/#website"},"datePublished":"2022-07-07T13:22:13+00:00","breadcrumb":{"@id":"https:\/\/rud.is\/b\/2022\/07\/07\/introducing-weatherkit-the-eventual-replacement-r-package-for-darksky\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/rud.is\/b\/2022\/07\/07\/introducing-weatherkit-the-eventual-replacement-r-package-for-darksky\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/rud.is\/b\/2022\/07\/07\/introducing-weatherkit-the-eventual-replacement-r-package-for-darksky\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/rud.is\/b\/"},{"@type":"ListItem","position":2,"name":"Introducing {weatherkit}: The Eventual Replacement R Package for {darksky}"}]},{"@type":"WebSite","@id":"https:\/\/rud.is\/b\/#website","url":"https:\/\/rud.is\/b\/","name":"rud.is","description":"&quot;In God we trust. All others must bring data&quot;","publisher":{"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/rud.is\/b\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886","name":"hrbrmstr","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1","url":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1","contentUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1","width":460,"height":460,"caption":"hrbrmstr"},"logo":{"@id":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1"},"description":"Don't look at me\u2026I do what he does \u2014 just slower. #rstats avuncular \u2022 ?Resistance Fighter \u2022 Cook \u2022 Christian \u2022 [Master] Chef des Donn\u00e9es de S\u00e9curit\u00e9 @ @rapid7","sameAs":["http:\/\/rud.is"],"url":"https:\/\/rud.is\/b\/author\/hrbrmstr\/"}]}},"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p23idr-3vE","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":2637,"url":"https:\/\/rud.is\/b\/2013\/09\/08\/rforecastio-simple-r-package-to-access-forecast-io-weather-data\/","url_meta":{"origin":13494,"position":0},"title":"Rforecastio &#8211; Simple R Package To Access forecast.io Weather Data","author":"hrbrmstr","date":"2013-09-08","format":false,"excerpt":"It doesn't get much better for me than when I can combine R and weather data in new ways. I've got something brewing with my Nest thermostat and needed to get some current wx readings plus forecast data. I could have chosen a number of different sources or API's but\u2026","rel":"","context":"In &quot;Development&quot;","block_context":{"text":"Development","link":"https:\/\/rud.is\/b\/category\/development\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":13498,"url":"https:\/\/rud.is\/b\/2022\/07\/10\/rust-cli-for-apples-weatherkit-rest-api\/","url_meta":{"origin":13494,"position":1},"title":"Rust CLI For Apple&#8217;s WeatherKit REST API","author":"hrbrmstr","date":"2022-07-10","format":false,"excerpt":"Apple is in the final stages of shuttering the DarkSky service\/API. They've replaced it with WeatherKit, which has both an xOS framework version as well as a REST API. To use either, you need to be a member of the Apple Developer Program (ADP) \u2014 $99.00\/USD per-year \u2014 and calls\u2026","rel":"","context":"In &quot;Apple&quot;","block_context":{"text":"Apple","link":"https:\/\/rud.is\/b\/category\/apple\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1722,"url":"https:\/\/rud.is\/b\/2012\/10\/22\/get-an-r-data-frame-from-a-mongodb-query\/","url_meta":{"origin":13494,"position":2},"title":"Get an R Data Frame from a MongoDB Query","author":"hrbrmstr","date":"2012-10-22","format":false,"excerpt":"There's a good FAQ on how to do the MongoDB query -> R data frame but I wanted to post a more complete example that included the database connection and query setup since I suspect there are folks new to Mongo who would appreciate the end-to-end view. The code is\u2026","rel":"","context":"In &quot;Development&quot;","block_context":{"text":"Development","link":"https:\/\/rud.is\/b\/category\/development\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3672,"url":"https:\/\/rud.is\/b\/2015\/09\/10\/a-better-way-to-read-nest-data-into-r\/","url_meta":{"origin":13494,"position":3},"title":"A Better Way To Read Nest Data Into R","author":"hrbrmstr","date":"2015-09-10","format":false,"excerpt":"I glimpsed a [post](http:\/\/blagrants.blogspot.com\/2015\/09\/nest-thermostat-and-r-creating-shiny.html) in the RSS feeds today on how to connect Nest data with a Shiny dashboard and was compelled to post a less brute-force way to get data from the Nest API. The authors of the Shiny+Nest post used `system` calls to `curl` and regular expression character\u2026","rel":"","context":"In &quot;APIs&quot;","block_context":{"text":"APIs","link":"https:\/\/rud.is\/b\/category\/apis\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":6491,"url":"https:\/\/rud.is\/b\/2017\/09\/28\/sodd-stackoverflow-driven-development\/","url_meta":{"origin":13494,"position":4},"title":"SODD \u2014 StackOverflow Driven-Development","author":"hrbrmstr","date":"2017-09-28","format":false,"excerpt":"I occasionally hang out on StackOverflow and often use an answer as an opportunity to fill a package void for a particular need. docxtractr and qrencoder are two (of many) packages that were birthed from SO answers. I usually try to answer with inline code first then expand the functionality\u2026","rel":"","context":"In &quot;R&quot;","block_context":{"text":"R","link":"https:\/\/rud.is\/b\/category\/r\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4490,"url":"https:\/\/rud.is\/b\/2016\/07\/05\/a-simple-prediction-web-service-using-the-new-firery-package\/","url_meta":{"origin":13494,"position":5},"title":"A Simple Prediction Web Service Using the New fiery Package","author":"hrbrmstr","date":"2016-07-05","format":false,"excerpt":"[`fiery`](https:\/\/github.com\/thomasp85\/fiery) is a new `Rook`\/`httuv`-based R web server in town created by @thomasp85 that aims to fill the gap between raw http & websockets and Shiny with a flexible framework for handling requests and serving up responses. The intent of this post is to provide a quick-start to using it\u2026","rel":"","context":"In &quot;R&quot;","block_context":{"text":"R","link":"https:\/\/rud.is\/b\/category\/r\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/13494","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/comments?post=13494"}],"version-history":[{"count":0,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/13494\/revisions"}],"wp:attachment":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/media?parent=13494"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/categories?post=13494"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/tags?post=13494"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}