Mercurial
Mercurial

Reputation: 2165

NWS - Temperature per hour

I'm looking into the National Weather Service's API and trying to get the temperature per hour for the certain location in the next 24 hours.

I'm using the test client to generate the requests:

http://graphical.weather.gov/xml/SOAP_server/ndfdXML.htm

Input

From: 2015-06-29T15:00:00

To: 2015-06-30T15:00:00

Product: Time series

Variables: Hourly temperatures, Dewpoint temperature, Apparent temperature

Unit: US standard

<time-layout time-coordinate="local" summarization="none">
<layout-key>k-p3h-n9-1</layout-key>
<start-valid-time>2015-06-29T17:00:00-04:00</start-valid-time>
<start-valid-time>2015-06-29T20:00:00-04:00</start-valid-time>
<start-valid-time>2015-06-29T23:00:00-04:00</start-valid-time>
<start-valid-time>2015-06-30T02:00:00-04:00</start-valid-time>
<start-valid-time>2015-06-30T05:00:00-04:00</start-valid-time>
<start-valid-time>2015-06-30T08:00:00-04:00</start-valid-time>
<start-valid-time>2015-06-30T11:00:00-04:00</start-valid-time>
<start-valid-time>2015-06-30T14:00:00-04:00</start-valid-time>
<start-valid-time>2015-06-30T17:00:00-04:00</start-valid-time>
</time-layout>
<parameters applicable-location="point1">
<temperature type="hourly" units="Fahrenheit" time-layout="k-p3h-n9-1">
<name>Temperature</name>
<value>83</value>
<value>79</value>
<value>72</value>
<value>70</value>
<value>69</value>
<value>74</value>
<value>82</value>
<value>87</value>
<value>87</value>
</temperature>
<temperature type="dew point" units="Fahrenheit" time-layout="k-p3h-n9-1">
<name>Dew Point Temperature</name>
<value>56</value>
<value>59</value>
<value>61</value>
<value>63</value>
<value>64</value>
<value>67</value>
<value>68</value>
<value>68</value>
<value>67</value>
</temperature>
<temperature type="apparent" units="Fahrenheit" time-layout="k-p3h-n9-1">
<name>Apparent Temperature</name>
<value>82</value>
<value>79</value>
<value>72</value>
<value>70</value>
<value>69</value>
<value>74</value>
<value>85</value>
<value>91</value>
<value>90</value>
</temperature>

The temperatures displayed are in 3hour periods. I figured to change the period parameter to 'Weather at a glance'. Indeed I got a time period of 24 hours, but the only parameter displayed in that period was 'Hazards'.

Obviously, each parameter is tied to a time period, but is it possible to get temperature in a 1hour time period instead of 3hour somehow?

Upvotes: 1

Views: 382

Answers (2)

Mercurial
Mercurial

Reputation: 2165

Indeed there is a NWS web service that displays data per hour. Just took some time to find it.

http://forecast.weather.gov/MapClick.php?lat=42.357700&lon=-71.060500&FcstType=digitalDWML

Upvotes: 1

Abtahm
Abtahm

Reputation: 21

If you are open for json then there are plenty of ways to do it.

I would recommend one service named apixu.com. They offer hour by hour weather and they also have a libraries in different programming languages.

https://github.com/apixu?tab=repositories

Upvotes: 1

Related Questions