/weatherapi-go

Primary LanguageGoApache License 2.0Apache-2.0

Go library for weatherapi.com

Easy-to-use api weather.com

Installing

go get github.com/Bogdan-Torkhov/weatherapi-go

Using

package main
import (
	"fmt"
	"github.com/Bogdan-Torkhov/weatherapi-go/weather"
)
func main() {
	const yourAPIkey = "apiKeyHere"
	w, err := weather.GetWeather(yourAPIkey, "London") // Api key, location
	if err != nil {
		panic(err)
	}
	fmt.Println(w) // All weather
	fmt.Println(w.GetMain()) // Only main weather
	fmt.Println(w.Current.Condition.Text) // Output: sunny
}