Skip to content
DocumentationAPI Reference

Set Repeat Mode

me.player.set_repeat_mode(PlayerSetRepeatModeParams**kwargs)
PUT/me/player/repeat

Set the repeat mode for the user's playback. 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
state: str

track, context or off.
track will repeat the current track.
context will repeat the current context.
off will turn repeat off.

device_id: Optional[str]

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

Set Repeat Mode

import os
from spotted import Spotted

client = Spotted(
    access_token=os.environ.get("SPOTIFY_ACCESS_TOKEN"),  # This is the default and can be omitted
)
client.me.player.set_repeat_mode(
    state="context",
)
Returns Examples