A Go library for the Spotify Web API and Accounts service.
go get github.com/brianstrauch/spotify
import (
"fmt"
"github.com/brianstrauch/spotify"
)
const token = "<YOUR API TOKEN>"
func main() {
api := spotify.NewAPI(token)
if err := api.Play(); err != nil {
panic(err)
}
playback, err := api.GetPlayback()
if err != nil {
panic(err)
}
fmt.Printf("Playing %s\n", playback.Item.Name)
}