Need to pull in weather data into Alteryx? Weather data can be helpful context in many situations - sports predictions, supply chain analysis, flight scheduling, maintenance on parts that can't be outside in extreme weather, and many other situations.
Workflow overview:
This workflow pulls weather data/forecasts from the National Weather Service and transforms it into usable data. This should be considered a starting file for weather data, which can be transformed into a format that is most helpful to you, such as an analytic app or a macro.
Workflow instructions:
If you selected 62 or 63 in the record select tool, your data will be cleaned and provided in the "clean up hourly forecast or forecast" container. If you selected 64 or 65 in the record select tool, your data will be provided in the "true" anchor of the filter tool up top.
Workflow details for configuration and editing:
The National Weather Service's API has to be called twice in order to get the data you want. The first API call tells the website which location you want to pull weather data for. The second API call tells the website what kind of weather data you're looking for (step 2 of the workflow instructions).
The first download tool pulls information for the specified location. If you look at the output of the "text to columns" tool after the first API call, scroll down to record 62-65 to see each URL option that needs to be fed back into a 2nd API call to get the weather data. Screenshot of output shown below:
The next few tools pull out the desired record and strips the data down to just the URL. Screenshot of output shown below:
The 2nd Download tool calls the desired URL to pull down the actual data. The next 3 tools clean up the received data and filters out the nulls. Screenshot:
This is as far as I bothered to clean up the data for options 64 and 65 (forecast grid data and observation stations). However, if 62 or 63 were selected, I continued the data cleanup process in the "clean up hourly forecast or forecast" container.
The top filter tool in this container contains the timestamp of when the data was generated. This is helpful to ensure your data is up to date.
The bottom filter tool, along with everything after, cleans out all the metadata included with the data pull, and cleans up the titles to a more usable format.
Troubleshooting:
weather.gov FAQ and API guide: https://weather-gov.github.io/api/general-faqs#how-to-get-forecast
Wow that's a very good workflow!
Can I make a Macro out of it?
Absolutely! My hope for this workflow is that it's easily adaptable to fit wherever it needs to fit, whether that be a macro or any other format.
Nice work @christina-billman!
User | Count |
---|---|
19 | |
15 | |
13 | |
9 | |
8 |