- text based location lookup
- geo position location lookup via lat lon
- daily forecast
- hourly forecast
- current conditions (not historic)
package main
import (
"fmt"
"net/http"
accuweather "github.com/AustinMCrane/go-accuweather"
)
func main() {
client := accuweather.NewClient("APIKEY", &http.Client{})
locations, err := client.CitySearch("LOCATION NAME")
if err != nil {
panic(err)
}
if len(locations) == 0 {
fmt.Println(fmt.Sprintf("no locations found for %s", *location))
return
}
locationKey := locations[0].Key
conditions, err := client.GetCurrentConditions(locationKey)
if err != nil {
panic(err)
}
}