I ant to download weather data for a specific location and specific time as in the example https://www.visualcrossing.com/resources/documentation/weather-api/how-to-use-python-and-pandas-to-join-historical-weather-data-to-road-accident-data/ However it insists on down loading 24 hours of data spaced out hourly rather than what the example gives. I have signed up for a metered plan which should give me subhourly data. But it doesn't ! I' want to use python to control and deal with the data. Thanks for your help
6 comments
-
info Official comment As described in our documentation (https://www.visualcrossing.com/resources/documentation/weather-api/timeline-weather-api/), you can directly request the data for a single hour. This is the key portion of the documentation:
You can also request the information for a specific time for a single date by including time into the date1 field using the format yyyy-MM-ddTHH:mm:ss. For example 2020-10-19T13:00:00.
The results are returned in the ‘currentConditions’ field and are truncated to the hour requested (i.e. 2020-10-19T13:59:00 will return data at 2020-10-19T13:00:00).
-
Steve Tilley It doesn't seem too. I have raised it as a support issue. Can you confirm that it does?
-
info I'm afraid that I don't fully understand your response. I can confirm that this technique is a way to obtain a single hour of data. Simply follow the date/time format above (as described in the documentation), and you will be able to query a single hour's weather data. Please note that you will find this single hour's result data in the currentConditions field of the response as explained in the documentation.
-
Steve Tilley So what I am trying to get it to do is to draw down a range of hours,. This it will not do. May I suggest you make this explicit in your documentation.
-
Steve Tilley So the code you give on your website doesn't seem to do what you say it does. For example your article on https://www.visualcrossing.com/resources/documentation/weather-api/how-to-use-python-and-pandas-to-join-historical-weather-data-to-road-accident-data/
gives this code to get a single time
https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/weatherdata/history?&contentType=json&aggregateMinutes=15&unitGroup=us&includeAstronomy=true&collectStationContributions=true&key=API_KEY&startDateTime=2020-01-16T00:11:00&endDateTime=2020-01-16T00:11:00&locations=38.94800,-77.30635
Note that both start and end date times are given.
Rather than just saying it is explained in the documentation, can you confirm that the documentation is correct? Can you also show a piece of code that actually does return a historical weather report for just 1 hour.
-
info Thank you for your feedback. Our documentation team have updated the document at https://www.visualcrossing.com/resources/documentation/weather-api/how-to-use-python-and-pandas-to-join-historical-weather-data-to-road-accident-data/
The article now uses the "Specific time request' approach documented in the Timeline Weather API docs (https://www.visualcrossing.com/resources/documentation/weather-api/timeline-weather-api/) to retrieve the weather data for the closest hour to the accident location and time.
We have also added the sample code to our GitHub repository at https://github.com/visualcrossing/WeatherApi/tree/master/python_samples
Regards
Visual Crossing Support