Skip to content
DocumentationAPI Reference

Check User's Saved Tracks

client.Me.Tracks.Check(ctx, query) (*[]bool, error)
GET/me/tracks/contains

Check if one or more tracks is already saved in the current Spotify user's 'Your Music' library.

ParametersExpand Collapse
query MeTrackCheckParams
IDs param.Field[string]

A comma-separated list of the Spotify IDs. For example: ids=4iV5W9uYEdYUVa79Axb7Rh,1301WleyT98MSxVHPZCA6M. Maximum: 50 IDs.

ReturnsExpand Collapse
type MeTrackCheckResponse []bool

Check User's Saved Tracks

package main

import (
  "context"
  "fmt"

  "github.com/cjavdev/spotted-go"
  "github.com/cjavdev/spotted-go/option"
)

func main() {
  client := spotted.NewClient(
    option.WithAccessToken("My Access Token"),
  )
  response, err := client.Me.Tracks.Check(context.TODO(), spotted.MeTrackCheckParams{
    IDs: "7ouMYWpwJ422jRcDASZB7P,4VqPOruhp5EdPBeR92t6lQ,2takcwOaAZWiXQijPHIx7B",
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response)
}
[
  false,
  true
]
Returns Examples
[
  false,
  true
]