Skip to content
DocumentationAPI Reference

Set Playback Volume

me().player().setVolume(PlayerSetVolumeParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
PUT/me/player/volume

Set the volume for the user’s current playback device. 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
PlayerSetVolumeParams params
long volumePercent

The volume to set. Must be a value from 0 to 100 inclusive.

Optional<String> deviceId

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

Set Playback Volume

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.PlayerSetVolumeParams;

public final class Main {
    private Main() {}

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

        PlayerSetVolumeParams params = PlayerSetVolumeParams.builder()
            .volumePercent(50L)
            .build();
        client.me().player().setVolume(params);
    }
}
Returns Examples