Skip to content
DocumentationAPI Reference

Seek To Position

client.Me.Player.SeekToPosition(ctx, body) error
PUT/me/player/seek

Seeks to the given position in the user’s currently playing track. This API only works for users who have Spotify Premium. The order of execution is not guaranteed when you use this API with other Player API endpoints.

ParametersExpand Collapse
body MePlayerSeekToPositionParams
PositionMs param.Field[int64]

The position in milliseconds to seek to. Must be a positive number. Passing in a position that is greater than the length of the track will cause the player to start playing the next song.

DeviceID param.Field[string]optional

The id of the device this command is targeting. If not supplied, the user's currently active device is the target.

Seek To Position

package main

import (
  "context"

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

func main() {
  client := spotted.NewClient(
    option.WithAccessToken("My Access Token"),
  )
  err := client.Me.Player.SeekToPosition(context.TODO(), spotted.MePlayerSeekToPositionParams{
    PositionMs: 25000,
  })
  if err != nil {
    panic(err.Error())
  }
}
Returns Examples