Skip to content
DocumentationAPI Reference

Check User's Saved Audiobooks

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

Check if one or more audiobooks are already saved in the current Spotify user's library.

ParametersExpand Collapse
query MeAudiobookCheckParams
IDs param.Field[string]

A comma-separated list of the Spotify IDs. For example: ids=18yVqkdbdRvS24c0Ilj2ci,1HGw3J3NxZO1TP1BTtVhpZ. Maximum: 50 IDs.

ReturnsExpand Collapse
type MeAudiobookCheckResponse []bool

Check User's Saved Audiobooks

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.Audiobooks.Check(context.TODO(), spotted.MeAudiobookCheckParams{
    IDs: "18yVqkdbdRvS24c0Ilj2ci,1HGw3J3NxZO1TP1BTtVhpZ,7iHfbu1YPACw6oZPAFJtqe",
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response)
}
[
  false,
  true
]
Returns Examples
[
  false,
  true
]