v38

OpenAPI 3.0.3AGPL-3.0raw.githubusercontent.com2026-08-022461333.9 MB
Streaming and Downloads

Pick a random song, podcast episode or video and redirect (302) to its stream url

Picks a random song, podcast episode or video from the whole library and redirects (302) to its stream url. Ampache 8.0.0+

get/random

Query parameters

type'album' | 'album_artist' | 'album_disk' | 'artist' | 'catalog' | 'favorite' | 'genre' | 'label' | 'playlist' | 'podcast_episode' | 'rating' | 'search' | 'song' | 'song_artist' | 'video'

Object type to pick a random item from (default: song). artist accepts either artist credit; song_artist and album_artist narrow it to one

filterstring

Parent object id to pick from. It is read against the table named by type, and those id spaces overlap, so an album id and an album_disk id of the same number are different objects. favorite reads it as 1 (or omitted) for flagged and 0 for not flagged; rating as 1-5 for that many stars or more, 0 for unrated, omitted for any rated song

bitrateinteger

Max bitrate for transcoding in bits per second (e.g 192000 = 192Kb). Song only

formatstring

Target stream format e.g. 'mp3', 'ogg'; use 'raw' to skip transcoding. Song only

offsetinteger

Return results starting from this index position

stats0 | 1

If 0, disable stat recording when playing the object (default: 1)