In this article, we will show you how to easily download forecast weather data as a standard CSV file that can be imported into thousands of data analysis and storage applications such as business intelligence systems, visualization tools, statistical analysis packages, and databases.
If you would like to download weather history data as a CSV, see the companion article.
The estimated time to complete this exercise is less than 5 minutes.
Step 1 – Sign-up/Sign-in
Start by visiting the Visual Crossing home page: www.visualcrossing.com and signing up for an account or simply sign in to your existing account if you have already created an account. Visual Crossing offers many different levels of subscriptions including a Free option. Visit www.visualcrossing.com to get started and follow the appropriate links to get into your account.
Step 2 – Open the Query Builder
The Visual Crossing Query Builder is designed for both simple users as well as advanced API users to either download data or build a URL query string that can be used to access our RESTful API weather service and retrieve data dynamically through virtually any scripting language, ETL, Excel, PowerBI or other data tools. In this exercise we will focus on retrieving a CSV (comma separated values) dataset for you to directly download to your device as a standalone file. Let’s start by choosing the ‘Query Builder’ link from the home page we started with above. Here is a shortcut: Visual Crossing Weather Data Query Builder
When you visit the query builder page for the first time, the system will request that you provide a starting location for your query.
To get started you can provide the Query Builder with the location you wish to find weather for. This can be as simple as a Zip Code (60633), A latitude/longitude pair in DD format and comma separated, city name with either state or country (Chicago, IL) for completeness or a full street address of any global location. This value that you enter will be converted to a specific point on the globe so that the system can find the weather data for that exact location.
NOTE: Visual Crossing does not snap your location to the nearest weather station but rather it uses multiple nearby stations to interpolate more exact weather for your detailed, custom location. The more accurate your location you give, the more accurate your weather will be.
Once entered, hit the search icon to move to the next step.
Step 3 – Building the Weather Query
After entering our first location we can now see our Query Builder and it has already started a query for you. Here is a quick anatomy of the page for your reference:
We will not cover the entire feature usage of the Query Builder in this tutorial but we will refer to these different sections. The simple steps we will take are: 1) provide location (done!), 2) provide historical time window & finally 3) download the data which has a few options for us.
Step 4 – Choose a Forecast Time Period
The first thing to understand is that Visual Crossing’s Query Builder uses the Timeline API. This powerful API allows us to choose any dates we wish even if they go from the past into the future. In this exercise we will only include dates in the future as we are looking to get our forecast data in CSV format. In the image above you can click on the title of the Time Period section which currently shows “Next 15 days”. This default query is for a 15-day forecast. When we click on this section we can see all of our time period options:
By keeping our selection of “Next 15 days” we are telling the Query Builder that we want to see a full 15-day forecast for this query. No other date selections are necessary but if we wanted only certain dates in the future we can choose “Date range” and select our own dates of forecast.
We now have finished are Location and our Forecast Time Period for our query.
Step 5 – Preview Results & Download
Every time we make a change to the query sections, the Data Preview Window automatically updates with a sample of our data. By default our view is “Grid” and our Data Result Section is set to “daily” to show us daily results for our time period on a formatted grid:
Please note that the Results Preview Window is just a view of many possible data sets that this query can bring back. The actual query brings back more data for different sections including daily weather data, hourly, station info, query information, and can bring back Current Weather, Events and Alerts. If you are retrieving results in JSON you can get all of these in the same result. However, for a simple table format such as CSV we have to choose the one we want and we will do that during the Download option. This tutorial focuses on the most common Weather Data section as either daily or hourly granularity.
The Viewer Mode buttons can show you more than just the Grid we see above, it can show the JSON results in raw form, Charts of summary data and even a copy/paste URL query string that you can paste into a browser or a script for dynamic queries.
Back to our task at hand…. Let’s download.
Start by clicking on the “Download” button at the right side of the Query Builder.
Step 6 – Download Options
As we can see in the image below, after clicking the “Download” button, Query Builder asks us for the format type (we choose ‘CSV’) and we choose the ‘Daily’ dataset that we want to output at CSV. (we can easily choose to get hourly data here instead for 24x greater results by hour of day)
NOTE: If you are a JSON user you can get all of these sets in a single result set, but remember that JSON is not easily read in a table format or importable into Excel. This is for users that are set up to parse JSON results through a script or application. CSV is a perfectly simple, human readable format that can import virtually anywhere.
Now we can click our “Submit” button and you will have your CSV weather results automatically downloaded via your browser as a file.
If the automatic download to your system occurred via the browser, you will see it in the file download section of your browser. For more secure systems they will require that you click the blue, manual download button to complete the download to your device.
NOTE: If later you want to download this exact file again you can visit the “My Datasets” link from the main Query Builder page.
You can now open your CSV file in notepad, Excel or any other system that supports this format and begin your weather analysis!
Additional Thoughts
There many, many settings for you to explore in Query Builder and here a few common requests that our users have:
Cost: In Query Builder it will show you the “Metered” cost for the data you are about to download. The metered cost is currently $.0001 per result row of weather data. Limiting columns or other features do not affect the cost. Also, note that our single, 15-day forecast counts as 1 row of result data even though there are 15 rows.
NOTE: Please use caution with your changes and re-downloads in Query Builder. You are charged for every download of a unique dataset. Any slight changes and re-download are billed in full. Only file datasets found in “My Datasets” are free to re-download.
Element Choice: If you select “Weather Elements” you can choose a specific set of weather elements to bring back in your dataset:
Units of Measure:
Depending on your usage and your geographic location you may prefer to have your results in a different data unit which is easily selectable from the Query Builder:
Additional Data
If you would like to learn more about using Visual Crossing Weather options such as weather history, multiple location import, and use within other analysis tools please see our other tutorials.
Questions or need help?
If you have a question or need help, please post on our actively monitored forum for the fastest replies. You can also contact us via our support site or drop us an email at support@visualcrossing.com.
Comments are closed.