Skip to content

mr-joshcrane/weather_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example import:

import "github.com/mr-joshcrane/weather_api"

Example of Library Usage

conditions, err := weather_api.Get(location, API_KEY)
if err != nil {
   //handle error appropriately
}
fmt.Println(conditions)

Example of CLI usage (bash)

go build -o weather src/main.go
./weather Perth,AU

What is it and why would I use it?

A simple, easy to use library that creates a client that leverages the OpenWeatherMap API (https://openweathermap.org/api). If you want basic weather information about a location, this might do the job for you!

OpenWeatherMap API Key

To use the OpenWeatherMap API, you need an API Key, see instructions at their FAQ on how to obtain one (https://openweathermap.org/faq).

Once you have the key, you should set it as the OPENWEATHERMAP_API_KEY environment variable.

Mac/Unix

export OPENWEATHERMAP_API_KEY=yourAPIKeyhere 

Windows

set OPENWEATHERMAP_API_KEY=yourAPIKeyhere

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages