Skip to content
DocumentationAPI Reference

Seek To Position

me().player().seekToPosition(PlayerSeekToPositionParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
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
PlayerSeekToPositionParams params
long positionMs

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.

Optional<String> deviceId

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 dev.cjav.spotted.example;

import dev.cjav.spotted.client.SpottedClient;
import dev.cjav.spotted.client.okhttp.SpottedOkHttpClient;
import dev.cjav.spotted.models.me.player.PlayerSeekToPositionParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        SpottedClient client = SpottedOkHttpClient.fromEnv();

        PlayerSeekToPositionParams params = PlayerSeekToPositionParams.builder()
            .positionMs(25000L)
            .build();
        client.me().player().seekToPosition(params);
    }
}
Returns Examples