1010class API extends Request
1111{
1212 /**
13- * Retrieves weather data by a (API internal) "city ID".
13+ * Retrieves weather data by a weather station ID.
14+ * See https://www.wunderground.com/wundermap/ for more information
1415 *
1516 * @param string $id
1617 * @return array
18+ * @throws \ErrorException
1719 */
1820 public function getByPWSId ($ id )
1921 {
@@ -22,10 +24,11 @@ public function getByPWSId ($id)
2224
2325
2426 /**
25- * Retrieves weather data by a (API internal) "city ID" .
27+ * Retrieves weather data by a airport code .
2628 *
2729 * @param string $code
2830 * @return array
31+ * @throws \ErrorException
2932 */
3033 public function getByAirportCode ($ code )
3134 {
@@ -34,11 +37,12 @@ public function getByAirportCode ($code)
3437
3538
3639 /**
37- * Retrieves weather data by given coordinates.
40+ * Retrieves weather data by geo coordinates.
3841 *
3942 * @param float $lat
4043 * @param float $lng
4144 * @return array
45+ * @throws \ErrorException
4246 */
4347 public function getByCoordinates ($ lat , $ lng )
4448 {
@@ -47,14 +51,28 @@ public function getByCoordinates ($lat, $lng)
4751
4852
4953 /**
50- * Retrieves weather data by given coordinates .
54+ * Retrieves weather data by a given country and city name .
5155 *
52- * @param string $city
5356 * @param string $country
57+ * @param string $city
5458 * @return array
59+ * @throws \ErrorException
5560 */
56- public function getByLocation ($ city , $ country )
61+ public function getByLocation ($ country , $ city )
5762 {
5863 return $ this ->fetch (['query ' => $ country . '/ ' . $ city ])->getResponseArray ();
5964 } // function
65+
66+
67+ /**
68+ * Retrieves weather data by a given country and city name.
69+ *
70+ * @param string $zipcode
71+ * @return array
72+ * @throws \ErrorException
73+ */
74+ public function getByUSZipcode ($ zipcode )
75+ {
76+ return $ this ->fetch (['query ' => $ zipcode ])->getResponseArray ();
77+ } // function
6078} // class
0 commit comments