Skip to content

spotify-api/spotify-api.go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Note

This pacakge is currently under developement so there might be some functions not working or not complete. Thank You!



spotify-api.go

A spotify-api wrapper in golang

Installation

go get github.com/spotify-api/spotify-api.go

Client

To get the client simply import the module and call the New function

import (
 "github.com/spotify-api/spotify-api.go"
)
client := spotify.Client("token") //the oauth token

Search

Searching artists or tracks

import (
 "fmt"
 "github.com/spotify-api/spotify-api.go"
)
client := spotify.Client("token") //the oauth token
tracks,err := client.SearchTracks("oh my god by alec benjamin")
if err != nil {
 fmt.Println("ERROR: " + err) //incase if there is an Error
 return
} 
fmt.Println(tracks.Tracks.Items[0].Name) // Prints : Oh My God

//Searching for artists
artists ,err2 := client.SearchArtists("Alec Benjamin")
if err2 != nil {
 fmt.Println("ERROR: " + err) //incase if there is an Error
 return
} 
fmt.Println(artists.Artists.Items[0].Name) // Prints : Alec Benjamin

About

[WIP] A spotify-api wrapper in golang.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages