Skip to content

Latest commit

 

History

History
43 lines (31 loc) · 771 Bytes

README.md

File metadata and controls

43 lines (31 loc) · 771 Bytes

Spotify Go Library

Description

A Go library for the Spotify Web API and Accounts service.

  • Authorize an application, with or without PKCE
  • Get currently playing music or podcast
  • Search for specific songs by name
  • Save music to user's library

Download

go get github.com/brianstrauch/spotify

Usage

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)
}