Streaming and Downloads

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

Changed on

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

Request

  • Base URL
    https://develop.ampache.dev/rest/8/json
  • URL
    https://develop.ampache.dev/rest/8/json/random
  • Auth
    • HTTP bearer
    • or API key in header auth
    • or API key in query parameter auth

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)

Changes

    • info

      added the new enum value album_artist to the query request parameter type

    • info

      added the new enum value album_disk to the query request parameter type

    • info

      added the new enum value catalog to the query request parameter type

    • info

      added the new enum value favorite to the query request parameter type

    • info

      added the new enum value genre to the query request parameter type

    • info

      added the new enum value label to the query request parameter type

    • info

      added the new enum value rating to the query request parameter type

    • info

      added the new enum value song_artist to the query request parameter type

    • info

      api operation id random was added

    • info

      added the non-success response with the status

    • info

      removed the non-success response with the status