Skip to content
DocumentationAPI Reference

Check If User Follows Artists or Users

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

Check to see if the current user is following one or more artists or other Spotify users.

ParametersExpand Collapse
query MeFollowingCheckParams
IDs param.Field[string]

A comma-separated list of the artist or the user Spotify IDs to check. For example: ids=74ASZWbe4lXaubB36ztrGX,08td7MxkoHQkXnWAYD8d6Q. A maximum of 50 IDs can be sent in one request.

Type param.Field[MeFollowingCheckParamsType]

The ID type: either artist or user.

const MeFollowingCheckParamsTypeArtist MeFollowingCheckParamsType = "artist"
const MeFollowingCheckParamsTypeUser MeFollowingCheckParamsType = "user"
ReturnsExpand Collapse
type MeFollowingCheckResponse []bool

Check If User Follows Artists or Users

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.Following.Check(context.TODO(), spotted.MeFollowingCheckParams{
    IDs: "2CIMQHirSU0MQqyYHq0eOx,57dN52uHvrHOxijzpIgu3E,1vCWHaC5f2uS3yhpwWbIA6",
    Type: spotted.MeFollowingCheckParamsTypeArtist,
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response)
}
[
  false,
  true
]
Returns Examples
[
  false,
  true
]