Bogdan-Torkhov / weatherapi-go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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
}

About

License:Apache License 2.0


Languages

Language:Go 100.0%