Skip to main content

API XML Methods

API XML Methods

Let's go through come calls and examples that you can do for each XML method.

Parameters may be sent as a query string, or (for POST/PUT/PATCH/DELETE) as a form-encoded or application/json request body. See API for details.

Valid responses will always return a HTTP 200 response.

Error responses return codes based on the error type:

  • HTTP 400
    • Error '4710': BAD_REQUEST
    • Error '4705': MISSING
  • HTTP 401
    • Error '4701': INVALID_HANDSHAKE
  • HTTP 403
    • Error '4700': ACCESS_CONTROL_NOT_ENABLED
    • Error '4703': ACCESS_DENIED
    • Error '4742': FAILED_ACCESS_CHECK
  • HTTP 404
    • Error '4704': NOT_FOUND
  • HTTP 410
    • Error '4706': DEPRECATED
  • HTTP 500
    • Error '4702': GENERIC_ERROR

Binary data methods will not return JSON; just the file/data you have requested.

Binary methods will also return:

  • HTTP 400 responses for a bad or incomplete request
  • HTTP 404 responses where the requests data was not found
  • HTTP 416 responses where the stream is unable to return the requested content-range

For information about about how playback works and what a client can expect from Ampache check out API Media Methods

Auth Methods

Auth methods are used for authenticating or checking the status of your session in an Ampache server.

Remember that the auth parameter does not need to be sent as a parameter in the URL.

HTTP header authentication is supported for the auth parameter where present.

handshake

This is the function that handles verifying a new handshake Takes a timestamp, auth key, and username.

InputTypeDescriptionOptional
'auth'string$passphrase (Timestamp . Password SHA hash) OR (API Key)NO
'user'string$username (Required if login/password authentication)YES
'timestamp'integerUNIXTIME() The timestamp used in seed of password hashYES
(Required if login/password authentication)
'version'string$version (API Version that the application understands)YES

NOTE For privacy, send auth in a request body or the Authorization: Bearer header rather than the query string. Query-string support for auth is deprecated but still accepted for backward compatibility.

  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a single object.

FieldTypeNullableOptionalNotes
authstringYESNO
streamtokenstringYESNO
apistringNONO
session_expireinteger | stringNONO
updatestringNONO
addstringNONO
cleanstringNONO
max_songintegerNONO
max_albumintegerNONO
max_artistintegerNONO
max_videointegerNONO
max_podcastintegerNONO
max_podcast_episodeintegerNONO
songsintegerNONO
albumsintegerNONO
artistsintegerNONO
genresintegerNONO
playlistsintegerNONO
searchesintegerNONO
playlists_searchesintegerNONO
usersintegerNONO
catalogsintegerNONO
videosintegerNONO
podcastsintegerNONO
podcast_episodesintegerNONO
sharesintegerNONO
licensesintegerNONO
live_streamsintegerNONO
labelsintegerNONO
usernamestringNONO
  • throws
<root><error></root>

Example

goodbye

Destroy a session using the auth parameter.

InputTypeDescriptionOptional
'auth'string(Session ID) destroys the session if it existsNO
  • return
<root>
<success>
</root>
  • throws
<root><error></root>

Example

lost_password

Email a new password to the user (if allowed) using a reset token.

$username;
$key = hash('sha256', 'email');
auth = hash('sha256', $username . $key);
InputTypeDescriptionOptional
'auth'stringpassword reset tokenNO
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a single object.

FieldTypeNullableOptionalNotes
successstringNOYES
  • throws
<root><error></root>

ping

This can be called without being authenticated, it is useful for determining if what the status of the server is, and what version it is running/compatible with

InputTypeDescriptionOptional
'auth'string(Session ID) returns version information and extends the session if passedYES
'version'string$version (API Version that the application understands)YES
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

server, version and compatible are always returned. Sending a valid auth extends the session and adds the handshake fields (session_expire, server counts, ...).

FieldTypeNullableOptionalNotes
serverstringNONO
versionstringNONO
compatiblestringNONO
authstringYESYES
streamtokenstringYESYES
apistringNOYES
session_expireinteger | stringNOYES
updatestringNOYES
addstringNOYES
cleanstringNOYES
max_songintegerNOYES
max_albumintegerNOYES
max_artistintegerNOYES
max_videointegerNOYES
max_podcastintegerNOYES
max_podcast_episodeintegerNOYES
songsintegerNOYES
albumsintegerNOYES
artistsintegerNOYES
genresintegerNOYES
playlistsintegerNOYES
searchesintegerNOYES
playlists_searchesintegerNOYES
usersintegerNOYES
catalogsintegerNOYES
videosintegerNOYES
podcastsintegerNOYES
podcast_episodesintegerNOYES
sharesintegerNOYES
licensesintegerNOYES
live_streamsintegerNOYES
labelsintegerNOYES
usernamestringNOYES
  • throws
<root>
<server>
<version>
<compatible>
</root>

Example

register

Register as a new user if allowed. (Requires the username, password and email.)

InputTypeDescriptionOptional
'username'string$usernameNO
'password'stringhash('sha256', $password)NO
'email'stringe.g. user@gmail.comNO
'fullname'stringYES

NOTE For privacy, send password in a form or JSON request body rather than the query string. Query-string support for password is deprecated but still accepted for backward compatibility.

  • return
<root>
<success>
</root>
  • throws
<root><error></root>

Non-Data Methods

These methods take no parameters beyond your auth key to return information

system_update

Check Ampache for updates and run the update if there is one.

ACCESS REQUIRED: 100 (Admin)

  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a single object.

FieldTypeNullableOptionalNotes
successstringNOYES
  • throws
<root><error></root>

Example

system_preferences

Get your server preferences

ACCESS REQUIRED: 100 (Admin)

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a preference list.

FieldTypeNullableOptionalNotes
preferencearray<PreferenceObject>NONOsee PreferenceObject fields

Each preference entry (PreferenceObject):

FieldTypeNullableOptionalNotes
idstringNONO
namestringNONO
valuestringNONO
descriptionstringNONO
levelintegerNONO
typestringNONO
categorystringNONO
subcategorystringYESNO
has_accessbooleanNOYES
valuesarray<string> | array<integer>NOYES
  • throws
<root><error></root>

Example

users

Get ids and usernames for your site

  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a user list.

FieldTypeNullableOptionalNotes
userarray<UserSummaryObject>NONOsee UserSummaryObject fields

Each user entry (UserSummaryObject):

FieldTypeNullableOptionalNotes
idstringNONO
usernamestringYESNO
  • throws
<root><error></root>

Example

user_preferences

Get your user preferences

<root>
<preference>
</root>

Example

Data Methods

Data methods require additional information and parameters to return information

Perform an advanced search given passed rules. This works in a similar way to the web/UI search pages. You can pass multiple rules as well as joins to create in depth search results.

Rules must be sent in groups of 3 using an int (starting from 1) to designate which rules are combined. Use operator ('and', 'or') to choose whether to join or separate each rule when searching.

Refer to the Advanced Search page for details about creating searches.

NOTE the rules part can be confusing but essentially you can include as many 'arrays' of rules as you want. Just add 1 to the rule value to create a new group of rules.

  • Mandatory Rule Values
    • rule_1
    • rule_1_operator
    • rule_1_input
  • Optional (Metadata searches only)
    • rule_1_subtype
InputTypeDescriptionOptional
operatorstringand, or (whether to match one rule or all)NO
rule_*array[rule_1, rule_1_operator, rule_1_input]NO
rule_*array[rule_2, rule_2_operator, rule_2_input], [etc]YES
typestringsong, album, artist, label, playlistNO
podcast, podcast_episode, genre, user, video
randomboolean0, 1 (random order of results; default to 0)YES
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
  • return
<root>
<total_count>
<song>|<album>|<artist>|<playlist>|<label>|<user>|<video>
</root>
  • throws
<root><error></root>

SONG Example

ARTIST Example

ALBUM Example

albums

This returns albums based on the provided search filters

InputTypeDescriptionOptional
'filter'stringFilter results to match this stringYES
'include'stringalbums, songs (include child objects in the response)YES
'exact'boolean0, 1 (if true filter is exact = rather than fuzzy LIKE)YES
'add'set_filterISO 8601 Date Format (2020-09-16) Find objects with an 'add' date newer than the specified dateYES
'update'set_filterISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified dateYES
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
'cond'stringApply additional filters to the browse using ; separated comma string pairsYES
(e.g. 'filter1,value1;filter2,value2')
'sort'stringSort name or comma-separated key pair. (e.g. 'name,order')YES
Default order 'ASC' (e.g. 'name,ASC' == 'name')
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a album list.

FieldTypeNullableOptionalNotes
total_countintegerNONO
md5stringNONO
albumarray<AlbumObject>NONOsee AlbumObject fields

Each album entry (AlbumObject):

FieldTypeNullableOptionalNotes
idstringNONO
namestringYESNO
prefixstringYESNO
basenamestringYESNO
artistobjectYESYES{id, name, prefix, basename}
artistsarray<NamedReference>NOYESsee NamedReference fields
songartistsarray<NamedReference>NOYESsee NamedReference fields
timeintegerNONO
yearintegerNONO
tracksarray<SongObject>NONOsee SongObject fields
songcountintegerNONO
diskcountintegerNONO
typestringYESNO
genrearray<GenreReference>NONOsee GenreReference fields
artstringYESNO
has_artbooleanNONO
flagbooleanNONO
ratingintegerYESNO
averageratingnumberYESNO
mbidstringYESNO
mbid_groupstringYESNO
catalogstringNONO
  • throws
<root><error></root>

Example

album

This returns a single album based on the UID provided

InputTypeDescriptionOptional
'filter'stringUID of Album, returns album XMLNO
'include'stringsongs (include child objects in the response)YES
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a single object.

FieldTypeNullableOptionalNotes
idstringNONO
namestringYESNO
prefixstringYESNO
basenamestringYESNO
artistobjectYESYES{id, name, prefix, basename}
artistsarray<NamedReference>NOYESsee NamedReference fields
songartistsarray<NamedReference>NOYESsee NamedReference fields
timeintegerNONO
yearintegerNONO
tracksarray<SongObject>NONOsee SongObject fields
songcountintegerNONO
diskcountintegerNONO
typestringYESNO
genrearray<GenreReference>NONOsee GenreReference fields
artstringYESNO
has_artbooleanNONO
flagbooleanNONO
ratingintegerYESNO
averageratingnumberYESNO
mbidstringYESNO
mbid_groupstringYESNO
catalogstringNONO
  • throws
<root><error></root>

Example

album_songs

This returns the songs of a specified album

InputTypeDescriptionOptional
'filter'stringUID of Album, returns song XMLNO
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
'cond'stringApply additional filters to the browse using ; separatedYES
comma string pairs (e.g. 'filter1,value1;filter2,value2')
'sort'stringSort name or comma-separated key pair. (e.g. 'name,order')YES
Default order 'ASC' (e.g. 'name,ASC' == 'name')
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a song list.

FieldTypeNullableOptionalNotes
total_countintegerNONO
md5stringNONO
songarray<SongObject>NONOsee SongObject fields

Each song entry (SongObject):

FieldTypeNullableOptionalNotes
idstringNONO
titlestringYESNO
namestringYESNO
artistNamedReferenceNONOsee NamedReference fields
artistsarray<NamedReference>NONOsee NamedReference fields
albumNamedReferenceNONOsee NamedReference fields
albumartistNamedReferenceNOYESsee NamedReference fields
diskintegerNONO
disksubtitlestringYESNO
bpmnumberYESNO
trackintegerNONO
filenamestringYESNO
genrearray<GenreReference>NONOsee GenreReference fields
moodarray<object>NONO{id, name}
playlisttrackintegerNONO
timeintegerNONO
yearintegerNONO
formatstringYESNO
stream_formatstringYESNO
bitrateintegerYESNO
stream_bitrateintegerYESNO
rateintegerNONO
modestringYESNO
mimestringYESNO
stream_mimestringYESNO
urlstringNONO
sizeintegerNONO
mbidstringYESNO
artstringYESNO
has_artbooleanNONO
flagbooleanNONO
ratingintegerYESNO
averageratingnumberYESNO
playcountintegerNONO
last_playedstringYESNO
catalogstringNONO
composerstringYESNO
channelsintegerYESNO
commentstringYESNO
licensestringYESNO
publisherstringYESNO
languagestringYESNO
lyricsstringYESNO
replaygain_album_gainnumberYESNO
replaygain_album_peaknumberYESNO
replaygain_track_gainnumberYESNO
replaygain_track_peaknumberYESNO
r128_album_gainnumberYESNO
r128_track_gainnumberYESNO
metadataobject<string, string>NOYES
  • throws
<root><error></root>

Example

album_disks

This returns the disks of a specified album

Album disks are the browsing unit whenever the album_group preference is disabled. This method is API 8 only; albums and album never change shape based on that preference.

InputTypeDescriptionOptional
'filter'stringUID of Album, returns album_disk JSONNO
'include'stringsongs (include child objects in the response)YES
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
'cond'stringApply additional filters to the browse using ; separatedYES
comma string pairs (e.g. 'filter1,value1;filter2,value2')
'sort'stringSort name or comma-separated key pair. (e.g. 'name,order')YES
Default order 'ASC' (e.g. 'name,ASC' == 'name')
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a album_disk list.

FieldTypeNullableOptionalNotes
total_countintegerNONO
md5stringNONO
album_diskarray<AlbumDiskObject>NONOsee AlbumDiskObject fields

Each album_disk entry (AlbumDiskObject):

FieldTypeNullableOptionalNotes
idstringNONO
namestringNONO
prefixstringYESNO
basenamestringYESNO
albumobjectNONO{id, name, prefix, basename}
artistobjectNOYES{id, name, prefix, basename}
artistsarray<object>NOYES{id, name, prefix, basename}
songartistsarray<object>NOYES{id, name, prefix, basename}
diskintegerNONO
disksubtitlestringYESNO
timeintegerNONO
yearintegerNONO
tracksarray<SongObject>NONOsee SongObject fields
songcountintegerNONO
typestringYESNO
genrearray<GenreReference>NONOsee GenreReference fields
artstringYESNO
has_artbooleanNONO
flagbooleanNONO
ratingintegerYESNO
averageratingnumberYESNO
mbidstringYESNO
mbid_groupstringYESNO
catalogstringNONO
  • throws object
"error": ""

album_disk

This returns a single album disk based on the UID provided

InputTypeDescriptionOptional
'filter'stringUID of AlbumDisk, returns album_disk JSONNO
'include'stringsongs (include child objects in the response)YES
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a single object.

FieldTypeNullableOptionalNotes
idstringNONO
namestringNONO
prefixstringYESNO
basenamestringYESNO
albumobjectNONO{id, name, prefix, basename}
artistobjectNOYES{id, name, prefix, basename}
artistsarray<object>NOYES{id, name, prefix, basename}
songartistsarray<object>NOYES{id, name, prefix, basename}
diskintegerNONO
disksubtitlestringYESNO
timeintegerNONO
yearintegerNONO
tracksarray<SongObject>NONOsee SongObject fields
songcountintegerNONO
typestringYESNO
genrearray<GenreReference>NONOsee GenreReference fields
artstringYESNO
has_artbooleanNONO
flagbooleanNONO
ratingintegerYESNO
averageratingnumberYESNO
mbidstringYESNO
mbid_groupstringYESNO
catalogstringNONO
  • throws object
"error": ""

album_disk_songs

This returns the songs of a specified album disk

InputTypeDescriptionOptional
'filter'stringUID of AlbumDisk, returns song JSONNO
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
'cond'stringApply additional filters to the browse using ; separatedYES
comma string pairs (e.g. 'filter1,value1;filter2,value2')
'sort'stringSort name or comma-separated key pair. (e.g. 'name,order')YES
Default order 'ASC' (e.g. 'name,ASC' == 'name')
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a song list.

FieldTypeNullableOptionalNotes
total_countintegerNONO
md5stringNONO
songarray<SongObject>NONOsee SongObject fields

Each song entry (SongObject):

FieldTypeNullableOptionalNotes
idstringNONO
titlestringYESNO
namestringYESNO
artistNamedReferenceNONOsee NamedReference fields
artistsarray<NamedReference>NONOsee NamedReference fields
albumNamedReferenceNONOsee NamedReference fields
albumartistNamedReferenceNOYESsee NamedReference fields
diskintegerNONO
disksubtitlestringYESNO
bpmnumberYESNO
trackintegerNONO
filenamestringYESNO
genrearray<GenreReference>NONOsee GenreReference fields
moodarray<object>NONO{id, name}
playlisttrackintegerNONO
timeintegerNONO
yearintegerNONO
formatstringYESNO
stream_formatstringYESNO
bitrateintegerYESNO
stream_bitrateintegerYESNO
rateintegerNONO
modestringYESNO
mimestringYESNO
stream_mimestringYESNO
urlstringNONO
sizeintegerNONO
mbidstringYESNO
artstringYESNO
has_artbooleanNONO
flagbooleanNONO
ratingintegerYESNO
averageratingnumberYESNO
playcountintegerNONO
last_playedstringYESNO
catalogstringNONO
composerstringYESNO
channelsintegerYESNO
commentstringYESNO
licensestringYESNO
publisherstringYESNO
languagestringYESNO
lyricsstringYESNO
replaygain_album_gainnumberYESNO
replaygain_album_peaknumberYESNO
replaygain_track_gainnumberYESNO
replaygain_track_peaknumberYESNO
r128_album_gainnumberYESNO
r128_track_gainnumberYESNO
metadataobject<string, string>NOYES
  • throws object
"error": ""

artists

This takes a collection of inputs and returns artist objects.

InputTypeDescriptionOptional
'filter'stringFilter results to match this stringYES
'exact'boolean0, 1 (if true filter is exact = rather than fuzzy LIKE)YES
'add'set_filterISO 8601 Date Format (2020-09-16) Find objects with an 'add' date newer than the specified dateYES
'update'set_filterISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified dateYES
'include'stringalbums, songs (include child objects in the response)YES
'album_artist'boolean0, 1 (if true filter for album artists only)YES
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
'cond'stringApply additional filters to the browse using ; separated comma string pairsYES
(e.g. 'filter1,value1;filter2,value2')
'sort'stringSort name or comma-separated key pair. (e.g. 'name,order')YES
Default order 'ASC' (e.g. 'name,ASC' == 'name')
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a artist list.

FieldTypeNullableOptionalNotes
total_countintegerNONO
md5stringNONO
artistarray<ArtistObject>NONOsee ArtistObject fields

Each artist entry (ArtistObject):

FieldTypeNullableOptionalNotes
idstringNONO
namestringYESNO
prefixstringYESNO
basenamestringYESNO
albumsarray<AlbumObject>NONOsee AlbumObject fields
albumcountintegerNONO
songsarray<SongObject>NONOsee SongObject fields
songcountintegerNONO
genrearray<GenreReference>NONOsee GenreReference fields
artstringYESNO
has_artbooleanNONO
flagbooleanNONO
ratingintegerYESNO
averageratingnumberYESNO
mbidstringYESNO
summarystringYESNO
timeintegerNONO
yearformedintegerNONO
placeformedstringYESNO
  • throws
<root><error></root>

Example

artist

This returns a single artist based on the UID of said artist

InputTypeDescriptionOptional
'filter'stringUID of Artist, returns artist XMLNO
'include'stringalbums, songs (include child objects in the response)YES
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a single object.

FieldTypeNullableOptionalNotes
idstringNONO
namestringYESNO
prefixstringYESNO
basenamestringYESNO
albumsarray<AlbumObject>NONOsee AlbumObject fields
albumcountintegerNONO
songsarray<SongObject>NONOsee SongObject fields
songcountintegerNONO
genrearray<GenreReference>NONOsee GenreReference fields
artstringYESNO
has_artbooleanNONO
flagbooleanNONO
ratingintegerYESNO
averageratingnumberYESNO
mbidstringYESNO
summarystringYESNO
timeintegerNONO
yearformedintegerNONO
placeformedstringYESNO
  • throws
<root><error></root>

Example

artist_albums

This returns the albums of an artist

InputTypeDescriptionOptional
'filter'stringUID of Artist, returns Album XMLNO
'album_artist'boolean0, 1 (if true filter for album artists only)YES
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
'cond'stringApply additional filters to the browse using ; separated comma string pairsYES
(e.g. 'filter1,value1;filter2,value2')
'sort'stringSort name or comma-separated key pair. (e.g. 'name,order')YES
Default order 'ASC' (e.g. 'name,ASC' == 'name')
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a album list.

FieldTypeNullableOptionalNotes
total_countintegerNONO
md5stringNONO
albumarray<AlbumObject>NONOsee AlbumObject fields

Each album entry (AlbumObject):

FieldTypeNullableOptionalNotes
idstringNONO
namestringYESNO
prefixstringYESNO
basenamestringYESNO
artistobjectYESYES{id, name, prefix, basename}
artistsarray<NamedReference>NOYESsee NamedReference fields
songartistsarray<NamedReference>NOYESsee NamedReference fields
timeintegerNONO
yearintegerNONO
tracksarray<SongObject>NONOsee SongObject fields
songcountintegerNONO
diskcountintegerNONO
typestringYESNO
genrearray<GenreReference>NONOsee GenreReference fields
artstringYESNO
has_artbooleanNONO
flagbooleanNONO
ratingintegerYESNO
averageratingnumberYESNO
mbidstringYESNO
mbid_groupstringYESNO
catalogstringNONO
  • throws
<root><error></root>

Example

artist_songs

This returns the songs of the specified artist

InputTypeDescriptionOptional
'filter'stringUID of Artist, returns Song XMLNO
'top50'boolean0, 1 (if true filter to the artist top 50)YES
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
'cond'stringApply additional filters to the browse using ; separated comma string pairsYES
(e.g. 'filter1,value1;filter2,value2')
'sort'stringSort name or comma-separated key pair. (e.g. 'name,order')YES
Default order 'ASC' (e.g. 'name,ASC' == 'name')
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a song list.

FieldTypeNullableOptionalNotes
total_countintegerNONO
md5stringNONO
songarray<SongObject>NONOsee SongObject fields

Each song entry (SongObject):

FieldTypeNullableOptionalNotes
idstringNONO
titlestringYESNO
namestringYESNO
artistNamedReferenceNONOsee NamedReference fields
artistsarray<NamedReference>NONOsee NamedReference fields
albumNamedReferenceNONOsee NamedReference fields
albumartistNamedReferenceNOYESsee NamedReference fields
diskintegerNONO
disksubtitlestringYESNO
bpmnumberYESNO
trackintegerNONO
filenamestringYESNO
genrearray<GenreReference>NONOsee GenreReference fields
moodarray<object>NONO{id, name}
playlisttrackintegerNONO
timeintegerNONO
yearintegerNONO
formatstringYESNO
stream_formatstringYESNO
bitrateintegerYESNO
stream_bitrateintegerYESNO
rateintegerNONO
modestringYESNO
mimestringYESNO
stream_mimestringYESNO
urlstringNONO
sizeintegerNONO
mbidstringYESNO
artstringYESNO
has_artbooleanNONO
flagbooleanNONO
ratingintegerYESNO
averageratingnumberYESNO
playcountintegerNONO
last_playedstringYESNO
catalogstringNONO
composerstringYESNO
channelsintegerYESNO
commentstringYESNO
licensestringYESNO
publisherstringYESNO
languagestringYESNO
lyricsstringYESNO
replaygain_album_gainnumberYESNO
replaygain_album_peaknumberYESNO
replaygain_track_gainnumberYESNO
replaygain_track_peaknumberYESNO
r128_album_gainnumberYESNO
r128_track_gainnumberYESNO
metadataobject<string, string>NOYES
  • throws
<root><error></root>

Example

bookmarks

Get information about bookmarked media this user is allowed to manage.

InputTypeDescriptionOptional
'client'stringfilter by the agent/client nameYES
'include'integer0,1, if true include the object in the bookmarkYES
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a bookmark list.

FieldTypeNullableOptionalNotes
total_countintegerNONO
md5stringNONO
bookmarkarray<BookmarkObject>NONOsee BookmarkObject fields

Each bookmark entry (BookmarkObject):

FieldTypeNullableOptionalNotes
idstringNONO
ownerstringNONO
object_typestringYESNO
object_idstringNONO
positionintegerNONO
clientstringYESNO
creation_dateintegerNONO
update_dateintegerNONO
songarray<SongObject>NOYESsee SongObject fields
podcast_episodearray<PodcastEpisodeObject>NOYESsee PodcastEpisodeObject fields
videoarray<VideoObject>NOYESsee VideoObject fields
  • throws
<root><error></root>

Example Example (with include)

bookmark

Get a single bookmark by bookmark_id

InputTypeDescriptionOptional
'filter'stringbookmark_idYES
'include'integer0,1, if true include the object in the bookmarkYES
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a single object.

FieldTypeNullableOptionalNotes
idstringNONO
ownerstringNONO
object_typestringYESNO
object_idstringNONO
positionintegerNONO
clientstringYESNO
creation_dateintegerNONO
update_dateintegerNONO
songarray<SongObject>NOYESsee SongObject fields
podcast_episodearray<PodcastEpisodeObject>NOYESsee PodcastEpisodeObject fields
videoarray<VideoObject>NOYESsee VideoObject fields
  • throws
<root><error></root>

Example Example (with include)

bookmark_create

Create a placeholder for the current media that you can return to later.

InputTypeDescriptionOptional
'filter'string$object_id to findNO
'type'stringsong, video, podcast_episode (object_type)NO
'position'integercurrent track time in secondsNO
'client'stringAgent string.YES
'date'integerupdate time (Default: UNIXTIME())YES
'include'integer0,1, if true include the object in the bookmarkYES
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a single object.

FieldTypeNullableOptionalNotes
idstringNONO
ownerstringNONO
object_typestringYESNO
object_idstringNONO
positionintegerNONO
clientstringYESNO
creation_dateintegerNONO
update_dateintegerNONO
songarray<SongObject>NOYESsee SongObject fields
podcast_episodearray<PodcastEpisodeObject>NOYESsee PodcastEpisodeObject fields
videoarray<VideoObject>NOYESsee VideoObject fields
  • throws
<root><error></root>

Example

bookmark_delete

Delete an existing bookmark. (if it exists)

InputTypeDescriptionOptional
'filter'string$object_id to deleteNO
'type'stringbookmark, song, video, podcast_episode, default: bookmarkNO
'client'stringAgent string.YES
  • return
<root>
<success>
</root>
  • throws
<root><error></root>

Example

bookmark_edit

Edit a placeholder for the current media that you can return to later.

InputTypeDescriptionOptional
'filter'string$object_id to findNO
'type'stringbookmark, song, video, podcast_episode (object_type)NO
'position'integercurrent track time in secondsNO
'client'stringAgent string.YES
'date'integerupdate time (Default: UNIXTIME())YES
'include'integer0,1, if true include the object in the bookmarkYES
  • return
<root>
<bookmark>
</root>
  • throws
<root><error></root>

Example

browse

Return children of a parent object in a folder traversal/browse style. If you don't send any parameters you'll get a catalog list (the 'root' path)

NOTE From API version 8 the catalog ID is optional on 'album_artist', 'artist', 'album', 'album_disk' and 'podcast'. Send it to restrict the children to a single catalog; omit it to get the children from every catalog you can see. API version 6 still requires it on those types.

InputTypeDescriptionOptional
'filter'stringobject_idYES
'type'string'root', 'catalog', 'album_artist', 'artist', 'album', 'album_disk', 'podcast'YES
'catalog'stringcatalog ID you are browsingYES
'add'set_filterISO 8601 Date Format (2020-09-16) Find objects with an 'add' date newer than the specified dateYES
'update'set_filterISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified dateYES
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
'cond'stringApply additional filters to the browse using ; separated comma string pairsYES
(e.g. 'filter1,value1;filter2,value2')
'sort'stringSort name or comma-separated key pair. (e.g. 'name,order')YES
Default order 'ASC' (e.g. 'name,ASC' == 'name')
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a browse list.

FieldTypeNullableOptionalNotes
total_countintegerNONO
md5stringNONO
catalog_idstringNONO
parent_idstringNONO
parent_typestringNONO
child_typestringNONO
browsearray<BrowseObject>NONOsee BrowseObject fields

Each browse entry (BrowseObject):

FieldTypeNullableOptionalNotes
idstringNONO
namestringNONO
prefixstringYESNO
basenamestringNONO
  • throws
<root><error></root>

Example

Example: music catalog

Example: podcast catalog

Example: video catalog

Example: artist

Example: album

Example: podcast

catalogs

This searches the catalogs and returns... catalogs

InputTypeDescriptionOptional
'filter'stringmusic, clip, tvshow, movie, personal_video, podcast (Catalog type)YES
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
'cond'stringApply additional filters to the browse using ; separated comma string pairsYES
(e.g. 'filter1,value1;filter2,value2')
'sort'stringSort name or comma-separated key pair. (e.g. 'name,order')YES
Default order 'ASC' (e.g. 'name,ASC' == 'name')
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a catalog list.

FieldTypeNullableOptionalNotes
total_countintegerNONO
md5stringNONO
catalogarray<CatalogObject>NONOsee CatalogObject fields

Each catalog entry (CatalogObject):

FieldTypeNullableOptionalNotes
idstringNONO
namestringYESNO
typestringYESNO
gather_typesstringYESNO
enabledbooleanNONO
last_addintegerNONO
last_cleanintegerYESNO
last_updateintegerNONO
pathstringNONO
rename_patternstringYESNO
sort_patternstringYESNO
  • throws
<root><error></root>

Example

catalog

Return catalog by UID

InputTypeDescriptionOptional
'filter'stringUID of CatalogNO
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a single object.

FieldTypeNullableOptionalNotes
idstringNONO
namestringYESNO
typestringYESNO
gather_typesstringYESNO
enabledbooleanNONO
last_addintegerNONO
last_cleanintegerYESNO
last_updateintegerNONO
pathstringNONO
rename_patternstringYESNO
sort_patternstringYESNO
  • throws
<root><error></root>

Example

catalog_action

Kick off a catalog update or clean for the selected catalog

ACCESS REQUIRED: 75 (Catalog Manager)

NOTE filter is available in Ampache 7.9.0 and higher. catalog is deprecated and will be removed in API9.

InputTypeDescriptionOptional
'task'stringadd_to_catalog, clean_catalogNO
'filter'string$catalog_idNO
  • return
<root>
<success>
</root>
  • throws
<root><error></root>

Example: clean_catalog

Example: add_to_catalog

catalog_add

Create a new catalog.

ACCESS REQUIRED: 75 (Catalog Manager)

InputTypeDescriptionOptional
'name'stringName for the catalogNO
'path'stringURL or folder path for your catalogNO
'type'string'local', 'beets', 'remote', 'subsonic', 'seafile', 'beetsremote' Default: localYES
'media_type'string'music', 'podcast', 'clip', 'tvshow', 'movie', 'personal_video' Default: 'music'YES
'file_pattern'stringPattern used identify tags from the file name. Default: '%T - %t'YES
'folder_pattern'stringPattern used identify tags from the folder name. Default: '%a/%A'YES
'username'stringlogin to remote catalog ('remote', 'subsonic', 'seafile', 'beetsremote')YES
'password'stringpassword to remote catalog ('remote', 'subsonic', 'seafile', 'beetsremote')YES

NOTE For privacy, send password in a form or JSON request body rather than the query string. Query-string support for password is deprecated but still accepted for backward compatibility.

  • return
<root>
<total_count>
<catalog>
</root>
  • throws
<root><error></root>

Example

catalog_delete

Delete an existing catalog.

ACCESS REQUIRED: 75 (Catalog Manager)

InputTypeDescriptionOptional
'filter'stringUID of catalog to deleteNO
  • return
<root>
<success>
</root>
  • throws
<root><error></root>

Example

catalog_file

Perform actions on local catalog files. Single file versions of catalog add, clean, verify and remove (delete) Make sure you remember to urlencode those file names!

ACCESS REQUIRED: 50 (Content Manager)

NOTE filter is available in Ampache 7.9.0 and higher. catalog is deprecated and will be removed in API9.

InputTypeDescriptionOptional
'file'stringFULL path to local fileNO
'task'stringadd, clean, verify, remove (can include comma-separated values)NO
'filter'string$catalog_idNO
  • return
<root>
<success>
</root>
  • throws
<root><error></root>

Example

catalog_folder

Perform actions on local catalog folders. Single folder versions of catalog add, clean, verify and remove (delete) Make sure you remember to urlencode those folder names!

ACCESS REQUIRED: 50 (Content Manager)

NOTE filter is available in Ampache 7.9.0 and higher. catalog is deprecated and will be removed in API9.

InputTypeDescriptionOptional
'folder'stringFULL path to local folderNO
'task'stringadd, clean, verify, remove (can include comma-separated values)NO
'filter'string$catalog_idNO
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a single object.

FieldTypeNullableOptionalNotes
successstringNOYES
  • throws
<root><error></root>

Example

collections

A collection is a hand-curated list of objects of any type: the static counterpart to a search, and the non-media counterpart to a playlist. Playing one expands its members, so an album contributes its songs and anything that cannot be streamed is skipped.

This returns every collection you own, plus every public collection on the server.

InputTypeDescriptionOptional
'type'stringOnly return collections pinned to this object_typeYES
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a collection list.

FieldTypeNullableOptionalNotes
collectionarray<CollectionObject>NONOsee CollectionObject fields

Each collection entry (CollectionObject):

FieldTypeNullableOptionalNotes
idstringNONO
namestringNONO
ownerstringYESNO
typestringYESNO
object_typestringYESNO
itemsintegerNONO
has_artbooleanNONO
playlist_folder_idstringNOYES
playlist_folder_sort_orderintegerNOYES
  • throws
<root><error></root>

collection

Return a collection by UID, without its contents.

InputTypeDescriptionOptional
'filter'stringUID of CollectionNO
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a collection list.

FieldTypeNullableOptionalNotes
collectionarray<CollectionObject>NONOsee CollectionObject fields

Each collection entry (CollectionObject):

FieldTypeNullableOptionalNotes
idstringNONO
namestringNONO
ownerstringYESNO
typestringYESNO
object_typestringYESNO
itemsintegerNONO
has_artbooleanNONO
playlist_folder_idstringNOYES
playlist_folder_sort_orderintegerNOYES
  • throws
<root><error></root>

collection_items

A collection's members, in curated order.

The order is the data. A collection records the order its members were curated into, so <contents> holds one <item> per member in that order and a client should render them exactly as they arrive. Each <item> carries track (the 1-based position), track_id (the membership row, which is what identifies one member when the same object appears more than once) and object_type as attributes, and nests that type's own element inside:

<contents>
<item track="1" track_id="7" object_type="album">
<album id="21">...</album>
</item>
<item track="2" track_id="8" object_type="song">
<song id="60">...</song>
</item>
</contents>

Positions are dense and 1-based. They are renumbered whenever a member is added, removed or moved, so a position is only meaningful against the collection as it was when you read it.

offset and limit page the list without disturbing the order. The scalar items on the collection stays the total member count, so it is not reduced by paging.

InputTypeDescriptionOptional
'filter'stringUID of CollectionNO
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a single object.

FieldTypeNullableOptionalNotes
collectionobjectNONO{id, name, owner, type, object_type, items, has_art, playlist_folder_id, playlist_folder_sort_order, contents}
  • throws
<root><error></root>

collection_create

Create a new, empty collection.

Leave object_type out for a mixed collection, or set it to pin the collection to a single type so anything else is refused when it is added.

InputTypeDescriptionOptional
'name'stringCollection nameNO
'type'stringpublic, private (Default: private)YES
'object_type'stringPin the collection to a single object_typeYES
  • return array
  • throws
<root><error></root>

collection_edit

Change a collection's name, visibility, pinned type, collaborators or member order.

Only the values you send are changed. Send an empty object_type to un-pin a collection back to mixed; pinning is refused while the collection still holds a different type.

Reordering

items and tracks reorder the members the same way playlist_edit does: the two lists are paired in order, and each pair puts one member at one position, replacing whatever held that position before. Send only the pairs you want to change for a partial reorder, or every pair for a whole one.

Because a collection is heterogeneous, each entry in items carries its type as object_type:object_id:

items=album:21,song:60,album:44
tracks=1,2,3

The two lists must name the same number of entries or the call is refused. Pairs naming an unknown type, a non-positive id or a non-positive position are skipped rather than failing the whole request. Positions are renumbered afterwards so the order stays dense.

InputTypeDescriptionOptional
'filter'stringUID of CollectionNO
'name'stringCollection nameYES
'type'stringpublic, privateYES
'object_type'stringPinned object_type, or an empty string to un-pinYES
'collaborate'stringComma separated list of user ids allowed to curate the contentsYES
'items'stringComma separated object_type:object_id pairsYES
'tracks'stringComma separated positions matched to items in orderYES
  • return array
  • throws
<root><error></root>

collection_delete

Delete a collection and its membership rows. The objects it referenced are untouched.

ACCESS REQUIRED: collection owner or admin. A collaborator may curate the contents but not destroy the list.

InputTypeDescriptionOptional
'filter'stringUID of CollectionNO
  • return object
<root><success></root>
  • throws
<root><error></root>

collection_add

Add one object to the end of a collection.

The new member takes the next free position, so an add never disturbs the order of what is already there.

Whether a collection may hold the same object twice is the user's unique_playlist preference, the same one that governs duplicates in their playlists. It is off by default, so duplicates are allowed by default; with it on, adding an object that is already a member is refused with an error rather than silently doing nothing.

A pinned collection refuses anything but its own type, and an object that does not exist is refused rather than stored as a dangling id.

InputTypeDescriptionOptional
'filter'stringUID of CollectionNO
'id'stringUID of the object to addNO
'object_type'stringtype of the object to addNO
  • return object
<root><success></root>
  • throws
<root><error></root>

collection_remove

Remove members from a collection. The objects themselves are untouched, and removing something that was never a member is not an error.

Name either a position or an object:

  • track removes exactly the one member holding that position.
  • id with object_type removes every member pointing at that object. With duplicates allowed that can be more than one, which is what naming an object rather than a position means.

Either way the remaining positions close up, so the order stays dense and 1-based. Positions you read before the call are stale afterwards.

InputTypeDescriptionOptional
'filter'stringUID of CollectionNO
'track'integerposition of the member to removeYES
'id'stringUID of the object to removeYES
'object_type'stringtype of the object to removeYES

track takes precedence. Without it, both id and object_type are required.

  • return object
<root><success></root>
  • throws
<root><error></root>

deleted_podcast_episodes

This returns the episodes for a podcast that have been deleted

InputTypeDescriptionOptional
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a deleted_podcast_episode list.

FieldTypeNullableOptionalNotes
total_countintegerNONO
md5stringNONO
deleted_podcast_episodearray<DeletedPodcastEpisodeObject>NONOsee DeletedPodcastEpisodeObject fields

Each deleted_podcast_episode entry (DeletedPodcastEpisodeObject):

FieldTypeNullableOptionalNotes
idstringNONO
addition_timeintegerNONO
delete_timeintegerNONO
titlestringYESNO
filestringNONO
catalogstringNONO
total_countintegerNONO
total_skipintegerNONO
podcaststringNONO
  • throws
<root><error></root>

Example

deleted_songs

Returns songs that have been deleted from the server

InputTypeDescriptionOptional
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a deleted_song list.

FieldTypeNullableOptionalNotes
total_countintegerNONO
md5stringNONO
deleted_songarray<DeletedSongObject>NONOsee DeletedSongObject fields

Each deleted_song entry (DeletedSongObject):

FieldTypeNullableOptionalNotes
idstringNONO
addition_timeintegerNONO
delete_timeintegerNONO
titlestringYESNO
filestringNONO
catalogstringNONO
total_countintegerNONO
total_skipintegerNONO
update_timeintegerNONO
albumstringNONO
artiststringNONO
  • throws
<root><error></root>

Example

deleted_videos

This returns video objects that have been deleted

InputTypeDescriptionOptional
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a deleted_video list.

FieldTypeNullableOptionalNotes
total_countintegerNONO
md5stringNONO
deleted_videoarray<DeletedVideoObject>NONOsee DeletedVideoObject fields

Each deleted_video entry (DeletedVideoObject):

FieldTypeNullableOptionalNotes
idstringNONO
addition_timeintegerNONO
delete_timeintegerNONO
titlestringYESNO
filestringNONO
catalogstringNONO
total_countintegerNONO
total_skipintegerNONO
  • throws
<root><error></root>

Example

flag

This flags a library item as a favorite

  • Setting flag to true (1) will set the flag
  • Setting flag to false (0) will remove the flag

NOTE filter is available in Ampache 7.9.0 and higher. id is deprecated and will be removed in API9.

InputTypeDescriptionOptional
'type'stringsong, album, artist, playlist, podcastNO
podcast_episode, video, tvshow, tvshow_season
'filter'string$object_idNO
'filter'stringAlias of id (Ampache 7.9.0+)YES
'flag'boolean0, 1NO
  • return
<root>
<success>
</root>
  • throws
<root><error></root>

Example

folders

Return children of a parent object in a folder traversal style Ampache 8.0.0+

InputTypeDescriptionOptional
'filter'stringPath name or folder UID filter (Default: '/', the root folder; -1 is also the root)YES
'exact'boolean0, 1 (if true filter is exact rather than fuzzy; default: 1)YES
'add'set_filterISO 8601 Date Format (2020-09-16) Find objects with an 'add' date newer than the specified dateYES
'update'set_filterISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified dateYES
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
'cond'stringApply additional filters to the browse using ; separated comma string pairsYES
(e.g. 'filter1,value1;filter2,value2')
'sort'stringSort name or comma-separated key pair. (e.g. 'name,order')YES
Default order 'ASC' (e.g. 'name,ASC' == 'name')
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a single object.

FieldTypeNullableOptionalNotes
total_countintegerNONO
md5stringNONO
folderFolderBrowseNodeNONOsee FolderBrowseNode fields
  • throws
<root><error></root>

followers

This gets the followers for the requested username

InputTypeDescriptionOptional
'username'stringUsername of the user for who to get followers listNO
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
'cond'stringApply additional filters to the browse using ; separated comma string pairsYES
(e.g. 'filter1,value1;filter2,value2')
'sort'stringSort name or comma-separated key pair. (e.g. 'name,order')YES
Default order 'ASC' (e.g. 'name,ASC' == 'name')
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a user list.

FieldTypeNullableOptionalNotes
userarray<UserSummaryObject>NONOsee UserSummaryObject fields

Each user entry (UserSummaryObject):

FieldTypeNullableOptionalNotes
idstringNONO
usernamestringYESNO
  • throws
<root><error></root>

Example

following

Get a list of people that this user follows

InputTypeDescriptionOptional
'username'string(Username of the user for who to get following listNO
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a user list.

FieldTypeNullableOptionalNotes
userarray<UserSummaryObject>NONOsee UserSummaryObject fields

Each user entry (UserSummaryObject):

FieldTypeNullableOptionalNotes
idstringNONO
usernamestringYESNO
  • throws
<root><error></root>

Example

friends_timeline

This get current user friends timeline

InputTypeDescriptionOptional
'limit'integerMaximum number of results to returnYES
'since'integerUNIXTIME()NO
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a activity list.

FieldTypeNullableOptionalNotes
activityarray<ActivityObject>NONOsee ActivityObject fields

Each activity entry (ActivityObject):

FieldTypeNullableOptionalNotes
idstringNONO
dateintegerNONO
object_typestringYESNO
object_idstringNONO
actionstringNONO
userUserSummaryObjectNONOsee UserSummaryObject fields
  • throws
<root><error></root>

Example

genres

This returns the genres (Tags) based on the specified filter

InputTypeDescriptionOptional
'filter'stringFilter results to match this stringYES
'exact'boolean0, 1 (if true filter is exact = rather than fuzzy LIKE)YES
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
'cond'stringApply additional filters to the browse using ; separated comma string pairsYES
(e.g. 'filter1,value1;filter2,value2')
'sort'stringSort name or comma-separated key pair. (e.g. 'name,order')YES
Default order 'ASC' (e.g. 'name,ASC' == 'name')
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a genre list.

FieldTypeNullableOptionalNotes
total_countintegerNONO
md5stringNONO
genrearray<GenreObject>NONOsee GenreObject fields

Each genre entry (GenreObject):

FieldTypeNullableOptionalNotes
idstringNONO
namestringYESNO
albumsintegerNONO
artistsintegerNONO
songsintegerNONO
videosintegerNONO
playlistsintegerNONO
live_streamsintegerNONO
is_hiddenbooleanNONO
mergearray<GenreReference>NONOsee GenreReference fields
  • throws
<root><error></root>

Example

genre

This returns a single genre based on UID. All XML Documents that have a <genre></genre> element may have 0 or more genre elements associated with them. Each genre element has an attribute "count" that indicates the number of people who have specified this genre.

InputTypeDescriptionOptional
'filter'stringUID of genre, returns genre XMLNO
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a single object.

FieldTypeNullableOptionalNotes
idstringNONO
namestringYESNO
albumsintegerNONO
artistsintegerNONO
songsintegerNONO
videosintegerNONO
playlistsintegerNONO
live_streamsintegerNONO
is_hiddenbooleanNONO
mergearray<GenreReference>NONOsee GenreReference fields
  • throws
<root><error></root>

Example

genre_albums

This returns the albums associated with the genre in question

InputTypeDescriptionOptional
'filter'stringUID of genre, returns album XMLNO
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
'cond'stringApply additional filters to the browse using ; separated comma string pairsYES
(e.g. 'filter1,value1;filter2,value2')
'sort'stringSort name or comma-separated key pair. (e.g. 'name,order')YES
Default order 'ASC' (e.g. 'name,ASC' == 'name')
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a album list.

FieldTypeNullableOptionalNotes
total_countintegerNONO
md5stringNONO
albumarray<AlbumObject>NONOsee AlbumObject fields

Each album entry (AlbumObject):

FieldTypeNullableOptionalNotes
idstringNONO
namestringYESNO
prefixstringYESNO
basenamestringYESNO
artistobjectYESYES{id, name, prefix, basename}
artistsarray<NamedReference>NOYESsee NamedReference fields
songartistsarray<NamedReference>NOYESsee NamedReference fields
timeintegerNONO
yearintegerNONO
tracksarray<SongObject>NONOsee SongObject fields
songcountintegerNONO
diskcountintegerNONO
typestringYESNO
genrearray<GenreReference>NONOsee GenreReference fields
artstringYESNO
has_artbooleanNONO
flagbooleanNONO
ratingintegerYESNO
averageratingnumberYESNO
mbidstringYESNO
mbid_groupstringYESNO
catalogstringNONO
  • throws
<root><error></root>

Example

genre_artists

This returns the artists associated with the genre in question as defined by the UID

InputTypeDescriptionOptional
'filter'stringUID of genre, returns artist XMLNO
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
'cond'stringApply additional filters to the browse using ; separated comma string pairsYES
(e.g. 'filter1,value1;filter2,value2')
'sort'stringSort name or comma-separated key pair. (e.g. 'name,order')YES
Default order 'ASC' (e.g. 'name,ASC' == 'name')
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a artist list.

FieldTypeNullableOptionalNotes
total_countintegerNONO
md5stringNONO
artistarray<ArtistObject>NONOsee ArtistObject fields

Each artist entry (ArtistObject):

FieldTypeNullableOptionalNotes
idstringNONO
namestringYESNO
prefixstringYESNO
basenamestringYESNO
albumsarray<AlbumObject>NONOsee AlbumObject fields
albumcountintegerNONO
songsarray<SongObject>NONOsee SongObject fields
songcountintegerNONO
genrearray<GenreReference>NONOsee GenreReference fields
artstringYESNO
has_artbooleanNONO
flagbooleanNONO
ratingintegerYESNO
averageratingnumberYESNO
mbidstringYESNO
summarystringYESNO
timeintegerNONO
yearformedintegerNONO
placeformedstringYESNO
  • throws
<root><error></root>

Example

genre_songs

returns the songs for this genre

InputTypeDescriptionOptional
'filter'stringUID of genre, returns song XMLNO
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
'cond'stringApply additional filters to the browse using ; separated comma string pairsYES
(e.g. 'filter1,value1;filter2,value2')
'sort'stringSort name or comma-separated key pair. (e.g. 'name,order')YES
Default order 'ASC' (e.g. 'name,ASC' == 'name')
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a song list.

FieldTypeNullableOptionalNotes
total_countintegerNONO
md5stringNONO
songarray<SongObject>NONOsee SongObject fields

Each song entry (SongObject):

FieldTypeNullableOptionalNotes
idstringNONO
titlestringYESNO
namestringYESNO
artistNamedReferenceNONOsee NamedReference fields
artistsarray<NamedReference>NONOsee NamedReference fields
albumNamedReferenceNONOsee NamedReference fields
albumartistNamedReferenceNOYESsee NamedReference fields
diskintegerNONO
disksubtitlestringYESNO
bpmnumberYESNO
trackintegerNONO
filenamestringYESNO
genrearray<GenreReference>NONOsee GenreReference fields
moodarray<object>NONO{id, name}
playlisttrackintegerNONO
timeintegerNONO
yearintegerNONO
formatstringYESNO
stream_formatstringYESNO
bitrateintegerYESNO
stream_bitrateintegerYESNO
rateintegerNONO
modestringYESNO
mimestringYESNO
stream_mimestringYESNO
urlstringNONO
sizeintegerNONO
mbidstringYESNO
artstringYESNO
has_artbooleanNONO
flagbooleanNONO
ratingintegerYESNO
averageratingnumberYESNO
playcountintegerNONO
last_playedstringYESNO
catalogstringNONO
composerstringYESNO
channelsintegerYESNO
commentstringYESNO
licensestringYESNO
publisherstringYESNO
languagestringYESNO
lyricsstringYESNO
replaygain_album_gainnumberYESNO
replaygain_album_peaknumberYESNO
replaygain_track_gainnumberYESNO
replaygain_track_peaknumberYESNO
r128_album_gainnumberYESNO
r128_track_gainnumberYESNO
metadataobject<string, string>NOYES
  • throws
<root><error></root>

Example

get_bookmark

Get the bookmark from it's object_id and object_type. By default; get only the most recent bookmark. Use all to retrieve all media bookmarks for the object.

InputTypeDescriptionOptional
'filter'string$object_id to findNO
'type'stringsong, video, podcast_episode (object_type)NO
'include'integer0,1, if true include the object in the bookmarkYES
'all'integer0,1, if true include every bookmark for the objectYES
  • return
<root>
<bookmark>
</root>
  • throws
<root><error></root>

Example Example (with include)

get_external_metadata

Return External plugin metadata searching by object id and type

InputTypeDescriptionOptional
'filter'string$object_id to findNO
'type'stringsong, album, artist, label (object_type)NO
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns the plugin payloads when at least one metadata plugin answered, and the empty list envelope for the requested type when none did.

ExternalMetadataObject

plugin is keyed by metadata-retriever plugin name; each value is that plugin's payload.

plugin is keyed by metadata-retriever plugin name; each value is that plugin's payload.

FieldTypeNullableOptionalNotes
object_idstringNONO
object_typestringNONO
plugin_PluginMapNONOsee _PluginMap fields

EmptyListResponse

The standard empty envelope, with an empty list keyed by the requested type.

The standard empty envelope, with an empty list keyed by the requested type.

FieldTypeNullableOptionalNotes
total_countintegerNONO
md5stringNONO
  • throws
<root><error></root>

Example

get_indexes

This takes a collection of inputs and returns ID + name for the object type

NOTE This method was removed in API8 (Use list)

InputTypeDescriptionOptional
'type'stringsong, album, artist, album_artist, song_artist, playlist, podcastNO
podcast_episode, live_stream, catalog
'filter'stringValue is Alpha Match for returned results, may be more than one letter/numberYES
'hide_search'integer0, 1 (if true do not include searches/smartlists in the result)YES
'update'set_filterISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified dateYES
'include'boolean0, 1 (include songs in a playlist or episodes in a podcast)YES
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
'cond'stringApply additional filters to the browse using ; separated comma string pairsYES
(e.g. 'filter1,value1;filter2,value2')
'sort'stringSort name or comma-separated key pair. (e.g. 'name,order')YES
Default order 'ASC' (e.g. 'name,ASC' == 'name')
  • return
<root>
<total_count>
<song>|<album>|<artist>|<playlist>|<podcast>
</root>
  • throws
<root><error></root>

SONGS Example

ARTIST Example

ALBUM Example

PLAYLIST Example

PODCAST Example

get_lyrics

Return Database lyrics or search with plugins by Song id

InputTypeDescriptionOptional
'filter'string$song_id to findNO
'plugins'string0, 1, if false disable plugin lookup (default: 1)NO
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

plugin is keyed by lyric source (database plus any lyric-retriever plugin that answered). When nothing answered it is serialised as an empty array, not an empty object.

FieldTypeNullableOptionalNotes
object_idstringNONO
object_typestringNONO
plugin_PluginMapNONOsee _PluginMap fields
  • throws
<root><error></root>

Example

get_similar

Return similar artist id's or similar song ids compared to the input filter

InputTypeDescriptionOptional
'type'stringsong, artistNO
'filter'stringartist id or song idNO
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a song list.

FieldTypeNullableOptionalNotes
total_countintegerNONO
md5stringNONO
songarray<SongObject>NONOsee SongObject fields

Each song entry (SongObject):

FieldTypeNullableOptionalNotes
idstringNONO
titlestringYESNO
namestringYESNO
artistNamedReferenceNONOsee NamedReference fields
artistsarray<NamedReference>NONOsee NamedReference fields
albumNamedReferenceNONOsee NamedReference fields
albumartistNamedReferenceNOYESsee NamedReference fields
diskintegerNONO
disksubtitlestringYESNO
bpmnumberYESNO
trackintegerNONO
filenamestringYESNO
genrearray<GenreReference>NONOsee GenreReference fields
moodarray<object>NONO{id, name}
playlisttrackintegerNONO
timeintegerNONO
yearintegerNONO
formatstringYESNO
stream_formatstringYESNO
bitrateintegerYESNO
stream_bitrateintegerYESNO
rateintegerNONO
modestringYESNO
mimestringYESNO
stream_mimestringYESNO
urlstringNONO
sizeintegerNONO
mbidstringYESNO
artstringYESNO
has_artbooleanNONO
flagbooleanNONO
ratingintegerYESNO
averageratingnumberYESNO
playcountintegerNONO
last_playedstringYESNO
catalogstringNONO
composerstringYESNO
channelsintegerYESNO
commentstringYESNO
licensestringYESNO
publisherstringYESNO
languagestringYESNO
lyricsstringYESNO
replaygain_album_gainnumberYESNO
replaygain_album_peaknumberYESNO
replaygain_track_gainnumberYESNO
replaygain_track_peaknumberYESNO
r128_album_gainnumberYESNO
r128_track_gainnumberYESNO
metadataobject<string, string>NOYES
  • throws
<root><error></root>

Example

index

This takes a collection of inputs and returns ID + name for the object type

InputTypeDescriptionOptional
'type'stringcatalog, song, album, artist, album_artist, song_artistNO
playlist, podcast, podcast_episode, share, video, live_stream
'filter'stringValue is Alpha Match for returned results, may be more than one letter/numberYES
'hide_search'integer0, 1 (if true do not include searches/smartlists in the result)YES
'exact'boolean0, 1 (if true filter is exact = rather than fuzzy LIKE)YES
'add'set_filterISO 8601 Date Format (2020-09-16) Find objects with an 'add' date newer than the specified dateYES
'update'set_filterISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified dateYES
'include'boolean0, 1 (include songs in a playlist or episodes in a podcast)YES
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
'cond'stringApply additional filters to the browse using ; separated comma string pairsYES
(e.g. 'filter1,value1;filter2,value2')
'sort'stringSort name or comma-separated key pair. (e.g. 'name,order')YES
Default order 'ASC' (e.g. 'name,ASC' == 'name')
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Keyed by the requested type (e.g. album, artist, song). Without include the value is an array of object ids; with include it is an array of {id, type} references, or a map of parent id -> reference array for parent types such as playlists.

Open map — each value is: array<string> | array<IndexReferenceObject> | object<string, array<IndexReferenceObject>>.

  • throws
<root><error></root>

SONGS Example

ARTIST Example

ALBUM Example

PLAYLIST Example

PODCAST Example

SONG Example (with include)

ARTIST Example (with include)

ALBUM Example (with include)

PLAYLIST Example (with include)

labels

This returns labels based on the specified filter

InputTypeDescriptionOptional
'filter'stringFilter results to match this stringYES
'exact'boolean0, 1 (if true filter is exact = rather than fuzzy LIKE)YES
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
'cond'stringApply additional filters to the browse using ; separated comma string pairsYES
(e.g. 'filter1,value1;filter2,value2')
'sort'stringSort name or comma-separated key pair. (e.g. 'name,order')YES
Default order 'ASC' (e.g. 'name,ASC' == 'name')
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a label list.

FieldTypeNullableOptionalNotes
total_countintegerNONO
md5stringNONO
labelarray<LabelObject>NONOsee LabelObject fields

Each label entry (LabelObject):

FieldTypeNullableOptionalNotes
idstringNONO
namestringYESNO
artistsintegerNONO
summarystringYESNO
external_linkstringNONO
addressstringYESNO
categorystringYESNO
emailstringYESNO
websitestringYESNO
userstringNONO
  • throws
<root><error></root>

Example

label

This returns a single label

InputTypeDescriptionOptional
'filter'stringUID of label, returns label XMLNO
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a single object.

FieldTypeNullableOptionalNotes
idstringNONO
namestringYESNO
artistsintegerNONO
summarystringYESNO
external_linkstringNONO
addressstringYESNO
categorystringYESNO
emailstringYESNO
websitestringYESNO
userstringNONO
  • throws
<root><error></root>

Example

label_artists

This returns the artists for a label

InputTypeDescriptionOptional
'filter'stringUID of label, returns artist XMLNO
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
'cond'stringApply additional filters to the browse using ; separated comma string pairsYES
(e.g. 'filter1,value1;filter2,value2')
'sort'stringSort name or comma-separated key pair. (e.g. 'name,order')YES
Default order 'ASC' (e.g. 'name,ASC' == 'name')
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a artist list.

FieldTypeNullableOptionalNotes
total_countintegerNONO
md5stringNONO
artistarray<ArtistObject>NONOsee ArtistObject fields

Each artist entry (ArtistObject):

FieldTypeNullableOptionalNotes
idstringNONO
namestringYESNO
prefixstringYESNO
basenamestringYESNO
albumsarray<AlbumObject>NONOsee AlbumObject fields
albumcountintegerNONO
songsarray<SongObject>NONOsee SongObject fields
songcountintegerNONO
genrearray<GenreReference>NONOsee GenreReference fields
artstringYESNO
has_artbooleanNONO
flagbooleanNONO
ratingintegerYESNO
averageratingnumberYESNO
mbidstringYESNO
summarystringYESNO
timeintegerNONO
yearformedintegerNONO
placeformedstringYESNO
  • throws
<root><error></root>

Example

last_shouts

This gets the latest posted shouts

NOTE filter is available in Ampache 7.9.0 and higher. catalog is deprecated and will be removed in API9

InputTypeDescriptionOptional
'filter'stringGet latest shouts for this usernameYES
'limit'integerMaximum number of results (Use popular_threshold when missing; default 10)YES
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a shout list.

FieldTypeNullableOptionalNotes
shoutarray<ShoutObject>NONOsee ShoutObject fields

Each shout entry (ShoutObject):

FieldTypeNullableOptionalNotes
idstringNONO
dateintegerNONO
textstringNONO
object_typestringNONO
object_idstringNONO
userobjectNONO{id, username}
  • throws
<root><error></root>

Example

license

This returns a single license

InputTypeDescriptionOptional
'filter'stringUID of license, returns license XMLNO
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a single object.

FieldTypeNullableOptionalNotes
idstringNONO
namestringNONO
descriptionstringNONO
external_linkstringNONO
  • throws
<root><error></root>

Example

license_songs

This returns the songs for a license

InputTypeDescriptionOptional
'filter'stringUID of license, returns song XMLNO
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
'cond'stringApply additional filters to the browse using ; separated comma string pairsYES
(e.g. 'filter1,value1;filter2,value2')
'sort'stringSort name or comma-separated key pair. (e.g. 'name,order')YES
Default order 'ASC' (e.g. 'name,ASC' == 'name')
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a song list.

FieldTypeNullableOptionalNotes
total_countintegerNONO
md5stringNONO
songarray<SongObject>NONOsee SongObject fields

Each song entry (SongObject):

FieldTypeNullableOptionalNotes
idstringNONO
titlestringYESNO
namestringYESNO
artistNamedReferenceNONOsee NamedReference fields
artistsarray<NamedReference>NONOsee NamedReference fields
albumNamedReferenceNONOsee NamedReference fields
albumartistNamedReferenceNOYESsee NamedReference fields
diskintegerNONO
disksubtitlestringYESNO
bpmnumberYESNO
trackintegerNONO
filenamestringYESNO
genrearray<GenreReference>NONOsee GenreReference fields
moodarray<object>NONO{id, name}
playlisttrackintegerNONO
timeintegerNONO
yearintegerNONO
formatstringYESNO
stream_formatstringYESNO
bitrateintegerYESNO
stream_bitrateintegerYESNO
rateintegerNONO
modestringYESNO
mimestringYESNO
stream_mimestringYESNO
urlstringNONO
sizeintegerNONO
mbidstringYESNO
artstringYESNO
has_artbooleanNONO
flagbooleanNONO
ratingintegerYESNO
averageratingnumberYESNO
playcountintegerNONO
last_playedstringYESNO
catalogstringNONO
composerstringYESNO
channelsintegerYESNO
commentstringYESNO
licensestringYESNO
publisherstringYESNO
languagestringYESNO
lyricsstringYESNO
replaygain_album_gainnumberYESNO
replaygain_album_peaknumberYESNO
replaygain_track_gainnumberYESNO
replaygain_track_peaknumberYESNO
r128_album_gainnumberYESNO
r128_track_gainnumberYESNO
metadataobject<string, string>NOYES
  • throws
<root><error></root>

Example

licenses

This returns licenses based on the specified filter

InputTypeDescriptionOptional
'filter'stringFilter results to match this stringYES
'exact'boolean0, 1 (if true filter is exact = rather than fuzzy LIKE)YES
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
'cond'stringApply additional filters to the browse using ; separated comma string pairsYES
(e.g. 'filter1,value1;filter2,value2')
'sort'stringSort name or comma-separated key pair. (e.g. 'name,order')YES
Default order 'ASC' (e.g. 'name,ASC' == 'name')
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a license list.

FieldTypeNullableOptionalNotes
total_countintegerNONO
md5stringNONO
licensearray<LicenseObject>NONOsee LicenseObject fields

Each license entry (LicenseObject):

FieldTypeNullableOptionalNotes
idstringNONO
namestringNONO
descriptionstringNONO
external_linkstringNONO
  • throws
<root><error></root>

Example

list

This takes a named array of objects and returning id, name, prefix and basename

NOTE This method replaces get_indexes and does not have the include parameter and does not include children in the response.

InputTypeDescriptionOptional
'type'stringsong, album, artist, album_artist, song_artist, playlist, podcastNO
podcast_episode, live_stream, catalog
'filter'stringValue is Alpha Match for returned results, may be more than one letter/numberYES
'hide_search'integer0, 1 (if true do not include searches/smartlists in the result)YES
'update'set_filterISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified dateYES
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
'cond'stringApply additional filters to the browse using ; separated comma string pairsYES
(e.g. 'filter1,value1;filter2,value2')
'sort'stringSort name or comma-separated key pair. (e.g. 'name,order')YES
Default order 'ASC' (e.g. 'name,ASC' == 'name')
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a list list.

FieldTypeNullableOptionalNotes
total_countintegerNONO
md5stringNONO
listarray<ListObject>NONOsee ListObject fields

Each list entry (ListObject):

FieldTypeNullableOptionalNotes
idstringNONO
namestringNONO
prefixstringYESNO
basenamestringNONO
  • throws
<root><error></root>

Example

live_streams

This returns live_streams based on the specified filter

InputTypeDescriptionOptional
'filter'stringFilter results to match this stringYES
'exact'boolean0, 1 (if true filter is exact = rather than fuzzy LIKE)YES
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
'cond'stringApply additional filters to the browse using ; separated comma string pairsYES
(e.g. 'filter1,value1;filter2,value2')
'sort'stringSort name or comma-separated key pair. (e.g. 'name,order')YES
Default order 'ASC' (e.g. 'name,ASC' == 'name')
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a live_stream list.

FieldTypeNullableOptionalNotes
total_countintegerNONO
md5stringNONO
live_streamarray<LiveStreamObject>NONOsee LiveStreamObject fields

Each live_stream entry (LiveStreamObject):

FieldTypeNullableOptionalNotes
idstringNONO
namestringYESNO
urlstringYESNO
codecstringYESNO
catalogstringNONO
site_urlstringYESNO
  • throws
<root><error></root>

Example

live_stream

This returns a single live_stream

InputTypeDescriptionOptional
'filter'stringUID of live_stream, returns live_stream XMLNO
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a single object.

FieldTypeNullableOptionalNotes
idstringNONO
namestringYESNO
urlstringYESNO
codecstringYESNO
catalogstringNONO
site_urlstringYESNO
  • throws
<root><error></root>

Example

live_stream_create

Create a live_stream (radio station) object.

ACCESS REQUIRED: 50 (Content Manager) permission to create and edit live_streams

InputTypeDescriptionOptional
'filter'string$object_id to findNO
'type'stringsong, video, podcast_episode (object_type)NO
'position'integercurrent track time in secondsNO
'client'stringAgent string. (Default: 'AmpacheAPI')YES
'date'integerupdate time (Default: UNIXTIME())YES
  • return
<root>
<live_stream>
</root>
  • throws
<root><error></root>

Example

live_stream_delete

Delete an existing live_stream (radio station). (if it exists)

ACCESS REQUIRED: 50 (Content Manager) permission to create and edit live_streams

InputTypeDescriptionOptional
'filter'string$object_id to deleteNO
'type'stringsong, video, podcast_episode (object_type)NO
'client'stringAgent string. (Default: 'AmpacheAPI')YES
  • return
<root>
<success>
</root>
  • throws
<root><error></root>

Example

live_stream_edit

Edit a live_stream (radio station) object.

ACCESS REQUIRED: 50 (Content Manager) permission to create and edit live_streams

InputTypeDescriptionOptional
'filter'string$object_id to findNO
'type'stringsong, video, podcast_episode (object_type)NO
'position'integercurrent track time in secondsNO
'client'stringAgent string. (Default: 'AmpacheAPI')YES
'date'integerupdate time (Default: UNIXTIME())YES
  • return
<root>
<live_stream>
</root>
  • throws
<root><error></root>

Example

now_playing

Get what is currently being played by all users.

  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a now_playing list.

FieldTypeNullableOptionalNotes
now_playingarray<NowPlayingObject>NONOsee NowPlayingObject fields

Each now_playing entry (NowPlayingObject):

FieldTypeNullableOptionalNotes
idstringNONO
typestringNONO
clientstringNONO
expireintegerNONO
userobjectNONO{id, username}
  • throws
<root><error></root>

Example

player

Inform the server about the state of your client. (Song you are playing, Play/Pause state, etc.)

Return the now_playing state when completed

InputTypeDescriptionOptional
'filter'string$object_id currently playing/stoppingNO
'type'stringsong, video, podcast_episode (Default: song)YES
'state'stringplay, stop (Default: play)YES
'time'integercurrent play time in whole seconds (Default: 0)YES
'client'stringagent/client nameYES
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a now_playing list.

FieldTypeNullableOptionalNotes
now_playingarray<NowPlayingObject>NONOsee NowPlayingObject fields

Each now_playing entry (NowPlayingObject):

FieldTypeNullableOptionalNotes
idstringNONO
typestringNONO
clientstringNONO
expireintegerNONO
userobjectNONO{id, username}
  • throws
<root><error></root>

Example

playlists

This returns playlists based on the specified filter

InputTypeDescriptionOptional
'filter'stringFilter results to match this stringYES
'hide_search'integer0, 1 (if true do not include searches/smartlists in the result)YES
'show_dupes'integer0, 1 (if true if true ignore 'api_hide_dupe_searches' setting)YES
'exact'boolean0, 1 (if true filter is exact = rather than fuzzy LIKE)YES
'add'set_filterISO 8601 Date Format (2020-09-16) Find objects with an 'add' date newer than the specified dateYES
'update'set_filterISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified dateYES
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
'cond'stringApply additional filters to the browse using ; separated comma string pairsYES
(e.g. 'filter1,value1;filter2,value2')
'sort'stringSort name or comma-separated key pair. (e.g. 'name,order')YES
Default order 'ASC' (e.g. 'name,ASC' == 'name')
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a playlist list.

FieldTypeNullableOptionalNotes
total_countintegerNONO
md5stringNONO
playlistarray<PlaylistObject>NONOsee PlaylistObject fields

Each playlist entry (PlaylistObject):

FieldTypeNullableOptionalNotes
idstringNONO
namestringYESNO
ownerstringYESNO
userUserSummaryObjectNONOsee UserSummaryObject fields
itemsarray<object> | integerNONO
typestringYESNO
artstringYESNO
has_accessbooleanNONO
has_collaboratebooleanNONO
has_artbooleanNONO
flagbooleanNONO
ratingintegerYESNO
averageratingnumberYESNO
md5stringYESNO
last_updateintegerYESNO
timeintegerNONO
playlist_folder_idstringNOYES
playlist_folder_sort_orderintegerNOYES
  • throws
<root><error></root>

Example

playlist

This returns a single playlist

InputTypeDescriptionOptional
'filter'stringUID of playlist, returns playlist XMLNO
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a single object.

FieldTypeNullableOptionalNotes
idstringNONO
namestringYESNO
ownerstringYESNO
userUserSummaryObjectNONOsee UserSummaryObject fields
itemsarray<object> | integerNONO
typestringYESNO
artstringYESNO
has_accessbooleanNONO
has_collaboratebooleanNONO
has_artbooleanNONO
flagbooleanNONO
ratingintegerYESNO
averageratingnumberYESNO
md5stringYESNO
last_updateintegerYESNO
timeintegerNONO
playlist_folder_idstringNOYES
playlist_folder_sort_orderintegerNOYES
  • throws
<root><error></root>

Example

playlist_add

This adds a song to a playlist. setting check=1 will not add duplicates to the playlist

NOTE type is optional from Ampache8+

InputTypeDescriptionOptional
'filter'stringUID of PlaylistNO
'id'stringUID of the object to add to playlistNO
'type'string'song', 'album', 'artist', 'playlist' (Default: song)YES
  • return
<root>
<success>
</root>
  • throws
<root><error></root>

Example

playlist_add_song

This adds a song to a playlist. setting check=1 will not add duplicates to the playlist

NOTE This method was removed in API8 (Use playlist_add)

InputTypeDescriptionOptional
'filter'stringUID of PlaylistNO
'song'stringUID of song to add to playlistNO
'check'boolean0, 1 Whether to check and ignore duplicates (default = 0)YES
  • return
<root>
<success>
</root>
  • throws
<root><error></root>

Example

playlist_create

This create a new playlist and return it

InputTypeDescriptionOptional
'name'stringPlaylist nameNO
'type'stringpublic, private (Playlist type)YES
  • return
<root>
<total_count>
<playlist>
</root>
  • throws
<root><error></root>

Example

playlist_delete

This deletes a playlist

InputTypeDescriptionOptional
'filter'stringUID of PlaylistNO
  • return
<root>
<success>
</root>
  • throws
<root><error></root>

Example

playlist_edit

This modifies name and type of a playlist Previously name and type were mandatory while filter wasn't. this has been reversed.

NOTE items and tracks must be sent together and be of equal length

InputTypeDescriptionOptional
'filter'stringUID of PlaylistNO
'name'stringPlaylist nameYES
'type'stringpublic, private (Playlist type)YES
'owner'stringChange playlist owner to the user id (-1 = System playlist)YES
'items'stringcomma-separated song_id's (replaces existing items with a new id)YES
'tracks'stringcomma-separated playlisttrack numbers matched to 'items' in orderYES
  • return
<root>
<success>
</root>
  • throws
<root><error></root>

Example

playlist_generate

Get a list of song XML, indexes or id's based on some simple search criteria 'recent' will search for tracks played after 'Popular Threshold' days 'forgotten' will search for tracks played before 'Popular Threshold' days 'unplayed' added in 400002 for searching unplayed tracks

Note when using the 'id' format total_count is not returned.

InputTypeDescriptionOptional
'mode'stringrecent, forgotten, unplayed, random (default = 'random')YES
'filter'stringstring LIKE matched to song titleYES
'album'string$album_idYES
'artist'string$artist_idYES
'flag'integer0, 1 (get flagged songs only. default = 0)YES
'format'stringsong, index, id (default = 'song')YES
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Depends on the format parameter: song (default) and index return the song list envelope, id returns a bare array of song ids.

SongsResponse

Returns a song list.

FieldTypeNullableOptionalNotes
total_countintegerNONO
md5stringNONO
songarray<SongObject>NONOsee SongObject fields

Each song entry (SongObject):

FieldTypeNullableOptionalNotes
idstringNONO
titlestringYESNO
namestringYESNO
artistNamedReferenceNONOsee NamedReference fields
artistsarray<NamedReference>NONOsee NamedReference fields
albumNamedReferenceNONOsee NamedReference fields
albumartistNamedReferenceNOYESsee NamedReference fields
diskintegerNONO
disksubtitlestringYESNO
bpmnumberYESNO
trackintegerNONO
filenamestringYESNO
genrearray<GenreReference>NONOsee GenreReference fields
moodarray<object>NONO{id, name}
playlisttrackintegerNONO
timeintegerNONO
yearintegerNONO
formatstringYESNO
stream_formatstringYESNO
bitrateintegerYESNO
stream_bitrateintegerYESNO
rateintegerNONO
modestringYESNO
mimestringYESNO
stream_mimestringYESNO
urlstringNONO
sizeintegerNONO
mbidstringYESNO
artstringYESNO
has_artbooleanNONO
flagbooleanNONO
ratingintegerYESNO
averageratingnumberYESNO
playcountintegerNONO
last_playedstringYESNO
catalogstringNONO
composerstringYESNO
channelsintegerYESNO
commentstringYESNO
licensestringYESNO
publisherstringYESNO
languagestringYESNO
lyricsstringYESNO
replaygain_album_gainnumberYESNO
replaygain_album_peaknumberYESNO
replaygain_track_gainnumberYESNO
replaygain_track_peaknumberYESNO
r128_album_gainnumberYESNO
r128_track_gainnumberYESNO
metadataobject<string, string>NOYES

array<string>

Returned by format=id: song ids only, with no envelope.

  • throws
<root><error></root>

SONG Example

INDEX Example

ID Example

playlist_hash

This returns the md5 hash for the songs in a playlist

InputTypeDescriptionOptional
'filter'stringUID of PlaylistNO
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a single object.

FieldTypeNullableOptionalNotes
md5stringYESNO
  • throws
<root><error></root>

Example

playlist_remove

Remove objects from a playlist using track number in the list or object id and type. Using clear will empty the entire list.

NOTE this replaces playlist_remove_song in API8

InputTypeDescriptionOptional
'filter'stringUID of PlaylistNO
'id'stringUID of object to remove from playlistYES
'type'string'song', 'album', 'artist', 'playlist', default = songYES
'track'integerTrack number to remove from playlistYES
'clear'integer0,1 Clear the whole playlistYES
  • return
<root>
<success>
</root>
  • throws
<root><error></root>

Example

playlist_songs

This returns the songs for a playlist

InputTypeDescriptionOptional
'filter'stringUID of Playlist, returns song XMLNO
'random'integer0, 1 (if true get random songs using limit)YES
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a song list.

FieldTypeNullableOptionalNotes
total_countintegerNONO
md5stringNONO
songarray<SongObject>NONOsee SongObject fields

Each song entry (SongObject):

FieldTypeNullableOptionalNotes
idstringNONO
titlestringYESNO
namestringYESNO
artistNamedReferenceNONOsee NamedReference fields
artistsarray<NamedReference>NONOsee NamedReference fields
albumNamedReferenceNONOsee NamedReference fields
albumartistNamedReferenceNOYESsee NamedReference fields
diskintegerNONO
disksubtitlestringYESNO
bpmnumberYESNO
trackintegerNONO
filenamestringYESNO
genrearray<GenreReference>NONOsee GenreReference fields
moodarray<object>NONO{id, name}
playlisttrackintegerNONO
timeintegerNONO
yearintegerNONO
formatstringYESNO
stream_formatstringYESNO
bitrateintegerYESNO
stream_bitrateintegerYESNO
rateintegerNONO
modestringYESNO
mimestringYESNO
stream_mimestringYESNO
urlstringNONO
sizeintegerNONO
mbidstringYESNO
artstringYESNO
has_artbooleanNONO
flagbooleanNONO
ratingintegerYESNO
averageratingnumberYESNO
playcountintegerNONO
last_playedstringYESNO
catalogstringNONO
composerstringYESNO
channelsintegerYESNO
commentstringYESNO
licensestringYESNO
publisherstringYESNO
languagestringYESNO
lyricsstringYESNO
replaygain_album_gainnumberYESNO
replaygain_album_peaknumberYESNO
replaygain_track_gainnumberYESNO
replaygain_track_peaknumberYESNO
r128_album_gainnumberYESNO
r128_track_gainnumberYESNO
metadataobject<string, string>NOYES
  • throws
<root><error></root>

Example

podcast

Get the podcast from it's id.

InputTypeDescriptionOptional
'filter'stringUID of podcast, returns podcast XMLNO
'include'stringepisodes (include podcast_episodes in the response)YES
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a single object.

FieldTypeNullableOptionalNotes
idstringNONO
namestringYESNO
descriptionstringNONO
languagestringNONO
copyrightstringNONO
feed_urlstringNONO
generatorstringNONO
websitestringNONO
build_datestringNONO
sync_datestringNONO
public_urlstringNONO
artstringYESNO
has_artbooleanNONO
flagbooleanNONO
ratingintegerYESNO
averageratingnumberYESNO
catalogstringNONO
podcast_episodearray<PodcastEpisodeObject>NONOsee PodcastEpisodeObject fields
  • throws
<root><error></root>

Example

podcasts

Get information about podcasts

InputTypeDescriptionOptional
'filter'stringValue is Alpha Match for returned results, may be more than one letter/numberYES
'include'stringepisodes (include podcast_episodes in the response)YES
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
'cond'stringApply additional filters to the browse using ; separated comma string pairsYES
(e.g. 'filter1,value1;filter2,value2')
'sort'stringSort name or comma-separated key pair. (e.g. 'name,order')YES
Default order 'ASC' (e.g. 'name,ASC' == 'name')
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a podcast list.

FieldTypeNullableOptionalNotes
total_countintegerNONO
md5stringNONO
podcastarray<PodcastObject>NONOsee PodcastObject fields

Each podcast entry (PodcastObject):

FieldTypeNullableOptionalNotes
idstringNONO
namestringYESNO
descriptionstringNONO
languagestringNONO
copyrightstringNONO
feed_urlstringNONO
generatorstringNONO
websitestringNONO
build_datestringNONO
sync_datestringNONO
public_urlstringNONO
artstringYESNO
has_artbooleanNONO
flagbooleanNONO
ratingintegerYESNO
averageratingnumberYESNO
catalogstringNONO
podcast_episodearray<PodcastEpisodeObject>NONOsee PodcastEpisodeObject fields
  • throws
<root><error></root>

Example

podcast_create

Create a podcast that can be used by anyone to stream media. Takes the url and catalog parameters.

ACCESS REQUIRED: 75 (Catalog Manager)

InputTypeDescriptionOptional
'url'stringrss url for podcastNO
'catalog'stringpodcast catalogNO
  • return
<root>
<total_count>
<podcast>
</root>
  • throws
<root><error></root>

Example

podcast_delete

Delete an existing podcast.

ACCESS REQUIRED: 75 (Catalog Manager)

InputTypeDescriptionOptional
'filter'stringUID of podcast to deleteNO
  • return
<root>
<success>
</root>
  • throws
<root><error></root>

Example

podcast_edit

Update the description and/or expiration date for an existing podcast. Takes the podcast id to update with optional description and expires parameters.

ACCESS REQUIRED: 50 (Content Manager)

InputTypeDescriptionOptional
'filter'stringAlpha-numeric search termNO
'feed'stringfeed rss xml urlYES
'title'stringtitle stringYES
'website'stringsource website urlYES
'description'stringYES
'generator'stringYES
'copyright'stringYES
  • return
<root>
<success>
</root>
  • throws
<root><error></root>

Example

podcast_episodes

This returns the episodes for a podcast

InputTypeDescriptionOptional
'filter'stringUID of podcastNO
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
'cond'stringApply additional filters to the browse using ; separated comma string pairsYES
(e.g. 'filter1,value1;filter2,value2')
'sort'stringSort name or comma-separated key pair. (e.g. 'name,order')YES
Default order 'ASC' (e.g. 'name,ASC' == 'name')
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a podcast_episode list.

FieldTypeNullableOptionalNotes
total_countintegerNONO
md5stringNONO
podcast_episodearray<PodcastEpisodeObject>NONOsee PodcastEpisodeObject fields

Each podcast_episode entry (PodcastEpisodeObject):

FieldTypeNullableOptionalNotes
idstringNONO
titlestringYESNO
namestringYESNO
podcastobjectNONO{id, name}
descriptionstringNONO
categorystringYESNO
authorstringYESNO
author_fullstringYESNO
websitestringNONO
pubdatestringYESNO
statestringNONO
filelengthstringNONO
filesizestringNONO
filenamestringNONO
mimestringYESNO
timeintegerNONO
sizeintegerNONO
bitrateintegerNONO
stream_bitrateintegerNONO
rateintegerNONO
modestringYESNO
channelsintegerYESNO
public_urlstringNONO
urlstringNONO
catalogstringNONO
artstringYESNO
has_artbooleanNONO
flagbooleanNONO
ratingintegerYESNO
averageratingnumberYESNO
playcountintegerNONO
last_playedstringYESNO
playedstringNONO
  • throws
<root><error></root>

Example

podcast_episode

Get the podcast_episode from it's id.

InputTypeDescriptionOptional
'filter'stringpodcast_episode ID numberNO
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a single object.

FieldTypeNullableOptionalNotes
idstringNONO
titlestringYESNO
namestringYESNO
podcastobjectNONO{id, name}
descriptionstringNONO
categorystringYESNO
authorstringYESNO
author_fullstringYESNO
websitestringNONO
pubdatestringYESNO
statestringNONO
filelengthstringNONO
filesizestringNONO
filenamestringNONO
mimestringYESNO
timeintegerNONO
sizeintegerNONO
bitrateintegerNONO
stream_bitrateintegerNONO
rateintegerNONO
modestringYESNO
channelsintegerYESNO
public_urlstringNONO
urlstringNONO
catalogstringNONO
artstringYESNO
has_artbooleanNONO
flagbooleanNONO
ratingintegerYESNO
averageratingnumberYESNO
playcountintegerNONO
last_playedstringYESNO
playedstringNONO
  • throws
<root><error></root>

Example

podcast_episode_delete

Delete an existing podcast_episode.

InputTypeDescriptionOptional
'filter'stringUID of podcast_episode to deleteNO
  • return
<root>
<success>
</root>
  • throws
<root><error></root>

Example

preference_create

Add a new preference to your server

ACCESS REQUIRED: 100 (Admin)

InputTypeDescriptionOptional
'filter'stringPreference name e.g ('notify_email', 'popular_threshold')NO
'type'stringboolean, integer, string, specialNO
'default'mixedstring or integer default valueNO
'category'stringinterface, internal, options, playlist, plugins, streamingNO
'description'stringYES
'subcategory'stringYES
'level'integeraccess level required to change the value (default 100)YES
  • return
<root>
<preference>
</root>
  • throws
<root><error></root>

Example

preference_delete

Delete a non-system preference by name

ACCESS REQUIRED: 100 (Admin)

InputTypeDescriptionOptional
'filter'stringPreference name e.g ('notify_email', 'popular_threshold')NO
  • return
<root>
<success>
</root>
  • throws
<root><error></root>

Example

preference_edit

Edit a preference value and apply to all users if allowed

InputTypeDescriptionOptional
'filter'stringPreference name e.g ('notify_email', 'popular_threshold')NO
'value'mixed(string/integer) Preference valueNO
'all'boolean0, 1 apply to all users ACCESS REQUIRED: 100 (Admin)YES
'default'boolean0, 1 set as system default (New and public users) ACCESS REQUIRED: 100 (Admin)YES
  • return
<root>
<success>
</root>
  • throws
<root><error></root>

Example

rate

This rates a library item

NOTE filter is available in Ampache 7.9.0 and higher. id is deprecated and will be removed in API9.

InputTypeDescriptionOptional
'filter'stringlibrary item idNO
'type'stringsong, album, artist, playlist, podcastNO
podcast_episode, video, tvshow, tvshow_season
'rating'integerrating between 0-5NO
  • return
<root>
<success>
</root>
  • throws
<root><error></root>

Example

record_play

Take a song_id and update the object_count and user_activity table with a play. This allows other sources to record play history to Ampache.

If you don't supply a user id (optional) then just fall back to you.

ACCESS REQUIRED: 100 (Admin) permission to change another user's play history

NOTE filter is available in Ampache 7.9.0 and higher. id is deprecated and will be removed in API9.

InputTypeDescriptionOptional
'filter'string$object_idNO
'user'string$user_idYES
'client'string$agentYES
'date'integerUNIXTIME()YES
  • return
<root>
<success>
</root>
  • throws
<root><error></root>

Example

scrobble

Search for a song using text info and then record a play if found. This allows other sources to record play history to ampache

InputTypeDescriptionOptional
'song'stringHTML encoded stringNO
'artist'stringHTML encoded stringNO
'album'stringHTML encoded stringNO
'songmbid'stringsong_mbid also supportedYES
'artistmbid'stringartist_mbid also supportedYES
'albummbid'stringalbum_mbid also supportedYES
'date'integerUNIXTIME()YES
'client'string$agentYES
  • return
<root>
<success>
</root>
  • throws
<root><error></root>

Example

Perform an advanced search given passed rules. This works in a similar way to the web/UI search pages. Ampache 6.3.0+

This is the current name for the advanced_search method; parameters and results are identical.

Refer to the Advanced Search page for details about creating searches.

InputTypeDescriptionOptional
operatorstringand, or (whether to match one rule or all)NO
rule_*array[rule_1, rule_1_operator, rule_1_input]NO
rule_*array[rule_2, rule_2_operator, rule_2_input], [etc]YES
typestringsong, album, artist, label, playlistNO
podcast, podcast_episode, genre, user, video
randomboolean0, 1 (random order of results; default to 0)YES
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a video list.

FieldTypeNullableOptionalNotes
total_countintegerNONO
md5stringNONO
videoarray<VideoObject>NONOsee VideoObject fields

Each video entry (VideoObject):

FieldTypeNullableOptionalNotes
idstringNONO
titlestringYESNO
mimestringYESNO
resolutionstringYESNO
sizeintegerNONO
genrearray<GenreReference>NONOsee GenreReference fields
timeintegerNONO
urlstringNONO
artstringYESNO
has_artbooleanNONO
flagbooleanNONO
ratingintegerYESNO
averageratingnumberYESNO
playcountintegerNONO
last_playedstringYESNO
catalogstringNONO
  • throws
<root><error></root>

SONG Example

ARTIST Example

ALBUM Example

search_group

Perform a group search given passed rules. This function will return multiple object types if the rule names match the object type. You can pass multiple rules as well as joins to create in depth search results.

Limit and offset are applied per object type. Meaning with a limit of 10 you will return 10 objects of each type not 10 results total.

Rules must be sent in groups of 3 using an int (starting from 1) to designate which rules are combined. Use operator ('and', 'or') to choose whether to join or separate each rule when searching.

Refer to the Advanced Search page for details about creating searches.

NOTE the rules part can be confusing but essentially you can include as many 'arrays' of rules as you want. Just add 1 to the rule value to create a new group of rules.

  • Mandatory Rule Values
    • rule_1
    • rule_1_operator
    • rule_1_input
  • Optional (Metadata searches only)
    • rule_1_subtype

NOTE the type parameter is different from the regular advanced_search method. Each type is a grouping of object types so allow single search calls to be made

  • all

    • song
    • album
    • song_artist
    • album_artist
    • artist
    • label
    • playlist
    • podcast
    • podcast_episode
    • genre
    • user
  • music

    • song
    • album
    • artist
  • song_artist

    • song
    • album
    • song_artist
  • album_artist

    • song
    • album
    • album_artist
  • podcast

    • podcast
    • podcast_episode
  • video

    • video
InputTypeDescriptionOptional
operatorstringand, or (whether to match one rule or all)NO
rule_*array[rule_1, rule_1_operator, rule_1_input]NO
rule_*array[rule_2, rule_2_operator, rule_2_input], [etc]YES
typestringall, music, song_artist, album_artist, podcast, video (all by default)YES
randomboolean0, 1 (random order of results; default to 0)YES
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

search is keyed by object type (album, artist, album_artist, song_artist, song, playlist, podcast, podcast_episode, genre, label, user, video); each value is that type's usual object list. Types with no matches are omitted.

FieldTypeNullableOptionalNotes
searchobject<string, array<object>>NONO
  • throws
<root><error></root>

ALL Example

MUSIC Example

PODCAST Example

search_rules

Print a list of valid search rules for your search type

InputTypeDescriptionOptional
'filter'string'song', 'album', 'song_artist', 'album_artist',NO
'artist', 'label', 'playlist', 'podcast',
'podcast_episode', 'genre', 'user', 'video'
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a rule list.

FieldTypeNullableOptionalNotes
rulearray<SearchRuleObject>NONOsee SearchRuleObject fields

Each rule entry (SearchRuleObject):

FieldTypeNullableOptionalNotes
namestringNONO
labelstringNONO
typestringNONO
widgetarray<string | object<string, string>>NONO
titlestringNONO
  • throws
<root><error></root>

Artist Example

Album Example

Song Example

search_songs

This searches the songs and returns... songs

NOTE filter has an alias rule_1_input to match other search methods

InputTypeDescriptionOptional
'filter'stringFilter results to match this stringNO
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
  • return
<root>
<total_count>
<song>
</root>
  • throws
<root><error></root>

Example

shares

This searches the shares and returns... shares

InputTypeDescriptionOptional
'filter'stringFilter results to match this stringYES
'exact'boolean0, 1 boolean to match the exact filter stringYES
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
'cond'stringApply additional filters to the browse using ; separated comma string pairsYES
(e.g. 'filter1,value1;filter2,value2')
'sort'stringSort name or comma-separated key pair. (e.g. 'name,order')YES
Default order 'ASC' (e.g. 'name,ASC' == 'name')
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a share list.

FieldTypeNullableOptionalNotes
total_countintegerNONO
md5stringNONO
sharearray<ShareObject>NONOsee ShareObject fields

Each share entry (ShareObject):

FieldTypeNullableOptionalNotes
idstringNONO
namestringNONO
ownerstringNONO
allow_streambooleanNONO
allow_downloadbooleanNONO
creation_dateintegerNONO
lastvisit_dateintegerNONO
object_typestringYESNO
object_idstringNONO
expire_daysintegerNONO
max_counterintegerNONO
counterintegerNONO
secretstringYESNO
public_urlstringYESNO
descriptionstringYESNO
  • throws
<root><error></root>

Example

share

Return shares by UID

InputTypeDescriptionOptional
'filter'stringUID of Share, returns song XMLNO
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a single object.

FieldTypeNullableOptionalNotes
idstringNONO
namestringNONO
ownerstringNONO
allow_streambooleanNONO
allow_downloadbooleanNONO
creation_dateintegerNONO
lastvisit_dateintegerNONO
object_typestringYESNO
object_idstringNONO
expire_daysintegerNONO
max_counterintegerNONO
counterintegerNONO
secretstringYESNO
public_urlstringYESNO
descriptionstringYESNO
  • throws
<root><error></root>

Example

share_create

Create a public url that can be used by anyone to stream media. Takes the file id with optional description and expires parameters.

InputTypeDescriptionOptional
'filter'stringUID of object you are sharingNO
'type'stringobject_typeNO
'description'stringdescription (will be filled for you if empty)YES
'expires'integerdays to keep activeYES
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a single object.

FieldTypeNullableOptionalNotes
idstringNONO
namestringNONO
ownerstringNONO
allow_streambooleanNONO
allow_downloadbooleanNONO
creation_dateintegerNONO
lastvisit_dateintegerNONO
object_typestringYESNO
object_idstringNONO
expire_daysintegerNONO
max_counterintegerNONO
counterintegerNONO
secretstringYESNO
public_urlstringYESNO
descriptionstringYESNO
  • throws
<root><error></root>

Example

share_delete

Delete an existing share.

InputTypeDescriptionOptional
'filter'stringUID of Share to deleteNO
  • return
<root>
<success>
</root>
  • throws
<root><error></root>

Example

share_edit

Update the description and/or expiration date for an existing share. Takes the share id to update with optional description and expires parameters.

InputTypeDescriptionOptional
'filter'stringAlpha-numeric search termNO
'stream'boolean0, 1 Allow streamingYES
'download'boolean0, 1 Allow DownloadingYES
'expires'integernumber of whole days before expiryYES
'description'stringupdate descriptionYES
  • return
<root>
<success>
</root>
  • throws
<root><error></root>

Example

smartlists

This returns smartlists based on the specified filter

InputTypeDescriptionOptional
'filter'stringFilter results to match this stringYES
'exact'boolean0, 1 (if true filter is exact = rather than fuzzy LIKE)YES
'add'set_filterISO 8601 Date Format (2020-09-16) Find objects with an 'add' date newer than the specified dateYES
'update'set_filterISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified dateYES
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
'cond'stringApply additional filters to the browse using ; separated comma string pairsYES
(e.g. 'filter1,value1;filter2,value2')
'sort'stringSort name or comma-separated key pair. (e.g. 'name,order')YES
Default order 'ASC' (e.g. 'name,ASC' == 'name')
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a playlist list.

FieldTypeNullableOptionalNotes
total_countintegerNONO
md5stringNONO
playlistarray<PlaylistObject>NONOsee PlaylistObject fields

Each playlist entry (PlaylistObject):

FieldTypeNullableOptionalNotes
idstringNONO
namestringYESNO
ownerstringYESNO
userUserSummaryObjectNONOsee UserSummaryObject fields
itemsarray<object> | integerNONO
typestringYESNO
artstringYESNO
has_accessbooleanNONO
has_collaboratebooleanNONO
has_artbooleanNONO
flagbooleanNONO
ratingintegerYESNO
averageratingnumberYESNO
md5stringYESNO
last_updateintegerYESNO
timeintegerNONO
playlist_folder_idstringNOYES
playlist_folder_sort_orderintegerNOYES
  • throws
<root><error></root>

Example

smartlist

This returns a single smartlist

InputTypeDescriptionOptional
'filter'stringUID of smartlist, returns smartlist XMLNO
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a single object.

FieldTypeNullableOptionalNotes
idstringNONO
namestringYESNO
ownerstringYESNO
userUserSummaryObjectNONOsee UserSummaryObject fields
itemsarray<object> | integerNONO
typestringYESNO
artstringYESNO
has_accessbooleanNONO
has_collaboratebooleanNONO
has_artbooleanNONO
flagbooleanNONO
ratingintegerYESNO
averageratingnumberYESNO
md5stringYESNO
last_updateintegerYESNO
timeintegerNONO
playlist_folder_idstringNOYES
playlist_folder_sort_orderintegerNOYES
  • throws
<root><error></root>

Example

smartlist_songs

This returns the songs for a smartlist

InputTypeDescriptionOptional
'filter'stringUID of smartlist, returns song XMLNO
'random'integer0, 1 (if true get random songs using limit)YES
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a song list.

FieldTypeNullableOptionalNotes
total_countintegerNONO
md5stringNONO
songarray<SongObject>NONOsee SongObject fields

Each song entry (SongObject):

FieldTypeNullableOptionalNotes
idstringNONO
titlestringYESNO
namestringYESNO
artistNamedReferenceNONOsee NamedReference fields
artistsarray<NamedReference>NONOsee NamedReference fields
albumNamedReferenceNONOsee NamedReference fields
albumartistNamedReferenceNOYESsee NamedReference fields
diskintegerNONO
disksubtitlestringYESNO
bpmnumberYESNO
trackintegerNONO
filenamestringYESNO
genrearray<GenreReference>NONOsee GenreReference fields
moodarray<object>NONO{id, name}
playlisttrackintegerNONO
timeintegerNONO
yearintegerNONO
formatstringYESNO
stream_formatstringYESNO
bitrateintegerYESNO
stream_bitrateintegerYESNO
rateintegerNONO
modestringYESNO
mimestringYESNO
stream_mimestringYESNO
urlstringNONO
sizeintegerNONO
mbidstringYESNO
artstringYESNO
has_artbooleanNONO
flagbooleanNONO
ratingintegerYESNO
averageratingnumberYESNO
playcountintegerNONO
last_playedstringYESNO
catalogstringNONO
composerstringYESNO
channelsintegerYESNO
commentstringYESNO
licensestringYESNO
publisherstringYESNO
languagestringYESNO
lyricsstringYESNO
replaygain_album_gainnumberYESNO
replaygain_album_peaknumberYESNO
replaygain_track_gainnumberYESNO
replaygain_track_peaknumberYESNO
r128_album_gainnumberYESNO
r128_track_gainnumberYESNO
metadataobject<string, string>NOYES
  • throws
<root><error></root>

Example

smartlist_delete

This deletes a smartlist

InputTypeDescriptionOptional
'filter'stringUID of smartlistNO
  • return
<root>
<success>
</root>
  • throws
<root><error></root>

Example

songs

Returns songs based on the specified filter

InputTypeDescriptionOptional
'filter'stringFilter results to match this stringYES
'exact'boolean0, 1 (if true filter is exact = rather than fuzzy LIKE)YES
'add'set_filterISO 8601 Date Format (2020-09-16) Find objects with an 'add' date newer than the specified dateYES
'update'set_filterISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified dateYES
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
'cond'stringApply additional filters to the browse using ; separated comma string pairsYES
(e.g. 'filter1,value1;filter2,value2')
'sort'stringSort name or comma-separated key pair. (e.g. 'name,order')YES
Default order 'ASC' (e.g. 'name,ASC' == 'name')
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a song list.

FieldTypeNullableOptionalNotes
total_countintegerNONO
md5stringNONO
songarray<SongObject>NONOsee SongObject fields

Each song entry (SongObject):

FieldTypeNullableOptionalNotes
idstringNONO
titlestringYESNO
namestringYESNO
artistNamedReferenceNONOsee NamedReference fields
artistsarray<NamedReference>NONOsee NamedReference fields
albumNamedReferenceNONOsee NamedReference fields
albumartistNamedReferenceNOYESsee NamedReference fields
diskintegerNONO
disksubtitlestringYESNO
bpmnumberYESNO
trackintegerNONO
filenamestringYESNO
genrearray<GenreReference>NONOsee GenreReference fields
moodarray<object>NONO{id, name}
playlisttrackintegerNONO
timeintegerNONO
yearintegerNONO
formatstringYESNO
stream_formatstringYESNO
bitrateintegerYESNO
stream_bitrateintegerYESNO
rateintegerNONO
modestringYESNO
mimestringYESNO
stream_mimestringYESNO
urlstringNONO
sizeintegerNONO
mbidstringYESNO
artstringYESNO
has_artbooleanNONO
flagbooleanNONO
ratingintegerYESNO
averageratingnumberYESNO
playcountintegerNONO
last_playedstringYESNO
catalogstringNONO
composerstringYESNO
channelsintegerYESNO
commentstringYESNO
licensestringYESNO
publisherstringYESNO
languagestringYESNO
lyricsstringYESNO
replaygain_album_gainnumberYESNO
replaygain_album_peaknumberYESNO
replaygain_track_gainnumberYESNO
replaygain_track_peaknumberYESNO
r128_album_gainnumberYESNO
r128_track_gainnumberYESNO
metadataobject<string, string>NOYES
  • throws
<root><error></root>

Example

song

returns a single song

InputTypeDescriptionOptional
'filter'stringUID of Song, returns song XMLNO
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a single object.

FieldTypeNullableOptionalNotes
idstringNONO
titlestringYESNO
namestringYESNO
artistNamedReferenceNONOsee NamedReference fields
artistsarray<NamedReference>NONOsee NamedReference fields
albumNamedReferenceNONOsee NamedReference fields
albumartistNamedReferenceNOYESsee NamedReference fields
diskintegerNONO
disksubtitlestringYESNO
bpmnumberYESNO
trackintegerNONO
filenamestringYESNO
genrearray<GenreReference>NONOsee GenreReference fields
moodarray<object>NONO{id, name}
playlisttrackintegerNONO
timeintegerNONO
yearintegerNONO
formatstringYESNO
stream_formatstringYESNO
bitrateintegerYESNO
stream_bitrateintegerYESNO
rateintegerNONO
modestringYESNO
mimestringYESNO
stream_mimestringYESNO
urlstringNONO
sizeintegerNONO
mbidstringYESNO
artstringYESNO
has_artbooleanNONO
flagbooleanNONO
ratingintegerYESNO
averageratingnumberYESNO
playcountintegerNONO
last_playedstringYESNO
catalogstringNONO
composerstringYESNO
channelsintegerYESNO
commentstringYESNO
licensestringYESNO
publisherstringYESNO
languagestringYESNO
lyricsstringYESNO
replaygain_album_gainnumberYESNO
replaygain_album_peaknumberYESNO
replaygain_track_gainnumberYESNO
replaygain_track_peaknumberYESNO
r128_album_gainnumberYESNO
r128_track_gainnumberYESNO
metadataobject<string, string>NOYES
  • throws
<root><error></root>

Example

song_delete

Delete an existing song. (if you are allowed to)

InputTypeDescriptionOptional
'filter'stringUID of song to deleteNO
  • return
<root>
<success>
</root>
  • throws
<root><error></root>

Example

song_tags

Get the full song file tags using VaInfo

This is used to get tags for remote catalogs to allow maximum data to be returned

InputTypeDescriptionOptional
'filter'stringUID of song to fetchNO
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a single object.

FieldTypeNullableOptionalNotes
idstringNONO
albumartiststringYESNO
albumstringYESNO
artiststringYESNO
artistsarray<string>YESNO
artstringYESNO
audio_codecstringYESNO
barcodestringYESNO
bitrateintegerYESNO
bpmnumberYESNO
catalogintegerYESNO
catalog_numberstringYESNO
channelsintegerYESNO
commentstringYESNO
composerstringYESNO
descriptionstringYESNO
diskintegerYESNO
disksubtitlestringYESNO
display_xintegerYESNO
display_yintegerYESNO
encodingstringYESNO
filestringYESNO
frame_ratenumberYESNO
genrearray<string>YESNO
isrcstringYESNO
languagestringYESNO
lyricsstringYESNO
mb_albumartistidstringYESNO
mb_albumartistid_arrayarray<string>YESNO
mb_albumid_groupstringYESNO
mb_albumidstringYESNO
mb_artistidstringYESNO
mb_artistid_arrayarray<string>YESNO
mb_trackidstringYESNO
mimestringYESNO
modestringYESNO
original_namestringYESNO
original_yearstringYESNO
publisherstringYESNO
r128_album_gainintegerYESNO
r128_track_gainintegerYESNO
rateintegerYESNO
ratingnumberYESNO
release_datestringYESNO
release_statusstringYESNO
release_typestringYESNO
replaygain_album_gainnumberYESNO
replaygain_album_peaknumberYESNO
replaygain_track_gainnumberYESNO
replaygain_track_peaknumberYESNO
sizeintegerYESNO
versionstringYESNO
summarystringYESNO
timeintegerYESNO
titlestringYESNO
totaldisksintegerYESNO
totaltracksintegerYESNO
trackintegerYESNO
yearintegerYESNO
  • throws
<root><error></root>

Example

sonic_match

Songs that sound like the given song, most similar first.

Similarity is derived from analysing the audio, which Ampache does not do itself, so this needs a sonic analysis plugin (e.g. AudioMuse) enabled for the user. With no plugin to ask, the method reports the feature as unavailable rather than returning an empty list.

Each entry carries the full song plus similarity, a 0.0-1.0 score where 1.0 is the same recording. A backend that gives no comparable score reports -1.

InputTypeDescriptionOptional
'filter'stringUID of SongNO
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a sonic_match list.

FieldTypeNullableOptionalNotes
sonic_matcharray<SonicMatchObject>NONOsee SonicMatchObject fields

Each sonic_match entry (SonicMatchObject):

FieldTypeNullableOptionalNotes
  • throws
<root><error></root>

stats

Get some items based on some simple search types and filters. (Random by default) This method HAD partial backwards compatibility with older api versions but it has now been removed Pass -1 limit to get all results. (0 will fall back to the popular_threshold value)

InputTypeDescriptionOptional
'type'stringsong, album, artist, video, playlist, podcast, podcast_episodeNO
'filter'stringnewest, highest, frequent, recent, forgotten, flagged, randomYES
'user_id'integerYES
'username'stringYES
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results (Use popular_threshold when missing; default 10)YES
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a video list.

FieldTypeNullableOptionalNotes
total_countintegerNONO
md5stringNONO
videoarray<VideoObject>NONOsee VideoObject fields

Each video entry (VideoObject):

FieldTypeNullableOptionalNotes
idstringNONO
titlestringYESNO
mimestringYESNO
resolutionstringYESNO
sizeintegerNONO
genrearray<GenreReference>NONOsee GenreReference fields
timeintegerNONO
urlstringNONO
artstringYESNO
has_artbooleanNONO
flagbooleanNONO
ratingintegerYESNO
averageratingnumberYESNO
playcountintegerNONO
last_playedstringYESNO
catalogstringNONO
  • throws
<root><error></root>

SONG Example

ARTIST Example

ALBUM Example

system_preference

Get your server preference by name

ACCESS REQUIRED: 100 (Admin)

InputTypeDescriptionOptional
'filter'stringPreference name e.g ('notify_email', 'popular_threshold')NO
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a single object.

FieldTypeNullableOptionalNotes
idstringNONO
namestringNONO
valuestringNONO
descriptionstringNONO
levelintegerNONO
typestringNONO
categorystringNONO
subcategorystringYESNO
has_accessbooleanNOYES
valuesarray<string> | array<integer>NOYES
  • throws
<root><error></root>

Example

timeline

This gets a user's timeline

NOTE filter is available in Ampache 7.9.0 and higher. username is deprecated and will be removed in API9.

InputTypeDescriptionOptional
'filter'stringUsername of the user for whom to get the timelineNO
'limit'integerMaximum number of results to returnYES
'since'integerUNIXTIME()YES
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a activity list.

FieldTypeNullableOptionalNotes
activityarray<ActivityObject>NONOsee ActivityObject fields

Each activity entry (ActivityObject):

FieldTypeNullableOptionalNotes
idstringNONO
dateintegerNONO
object_typestringYESNO
object_idstringNONO
actionstringNONO
userUserSummaryObjectNONOsee UserSummaryObject fields
  • throws
<root><error></root>

Example

toggle_follow

This follow/unfollow a user

NOTE filter is available in Ampache 7.9.0 and higher. username is deprecated and will be removed in API9.

InputTypeDescriptionOptional
'filter'stringUsername of the user to follow/unfollowNO
  • return
<root>
<success>
</root>
  • throws
<root><error></root>

Example

update_art

Updates a single album, artist, song running the gather_art process Existing art is replaced unless you send overwrite=0, which keeps whatever is already there.

ACCESS REQUIRED: 75 (Catalog Manager)

NOTE filter is available in Ampache 7.9.0 and higher. id is deprecated and will be removed in API9.

InputTypeDescriptionOptional
'filter'string$object_idNO
'type'stringsong, podcastNO
'overwrite'boolean0, 1YES
  • return
<root>
<success>
<art>
</root>
  • throws
<root><error></root>

Example

update_artist_info

Update artist information and fetch similar artists from last.fm Make sure lastfm_API_key is set in your configuration file

ACCESS REQUIRED: 75 (Catalog Manager)

NOTE filter is available in Ampache 7.9.0 and higher. id is deprecated and will be removed in API9.

InputTypeDescriptionOptional
'filter'string$artist_idNO
  • return
<root>
<success>
</root>
  • throws
<root><error></root>

Example

update_from_tags

Update a single album, artist, song from the tag data

NOTE filter is available in Ampache 7.9.0 and higher. id is deprecated and will be removed in API9.

InputTypeDescriptionOptional
'type'stringsong, artist, albumNO
'filter'string$artist_id, $album_id, $song_idNO
  • return
<root>
<success>
</root>
  • throws
<root><error></root>

Example

update_podcast

Sync and download new podcast episodes

ACCESS REQUIRED: 50 (Content Manager)

NOTE There was an error in documentation listing id as a valid parameter. (id will work in Ampache 7.9.0 / API 6.9.1+)

InputTypeDescriptionOptional
'filter'string$object_idNO
'id'stringAlias of filter (Ampache 7.9.0+)YES
  • return
<root>
<success>
</root>
  • throws
<root><error></root>

Example

upload

Add a media file to the catalog named by the upload_catalog preference.

Send the file either as a multipart form field named upl, or as the raw request body, in which case filename names it.

ACCESS REQUIRED: the allow_upload preference, at the access level set by upload_access_level

NOTE send a real Content-Type (e.g. audio/mpeg) with a raw body. A form-encoded content type makes PHP parse the file as request variables, which can emit a max_input_vars warning ahead of the response.

NOTE an artist or album owned by another user is refused, and a file that fails to be added is removed from the catalog directory again. A name already present in the catalog is refused rather than renamed, only the file name is used (any path in it is ignored), and a request body larger than PHP's upload_max_filesize/post_max_size is rejected.

InputTypeDescriptionOptional
'filename'stringFile name, required when the file is the request bodyYES
'license'integer$license_id, required when licensing is enabledYES
'artist_id'integer$artist_idYES
'artist_name'stringCreate or reuse an artist you ownYES
'album_id'integer$album_idYES
'album_name'stringCreate or reuse an album you ownYES
  • return
<root>
<success>
</root>
  • throws
<root><error></root>

url_to_song

This takes a url and returns the song object in question

NOTE filter is available in Ampache 7.9.0 and higher. url is deprecated and will be removed in API9.

InputTypeDescriptionOptional
'filter'stringFull Ampache URL from server, translates back into a song XMLNO
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a song list.

FieldTypeNullableOptionalNotes
total_countintegerNONO
md5stringNONO
songarray<SongObject>NONOsee SongObject fields

Each song entry (SongObject):

FieldTypeNullableOptionalNotes
idstringNONO
titlestringYESNO
namestringYESNO
artistNamedReferenceNONOsee NamedReference fields
artistsarray<NamedReference>NONOsee NamedReference fields
albumNamedReferenceNONOsee NamedReference fields
albumartistNamedReferenceNOYESsee NamedReference fields
diskintegerNONO
disksubtitlestringYESNO
bpmnumberYESNO
trackintegerNONO
filenamestringYESNO
genrearray<GenreReference>NONOsee GenreReference fields
moodarray<object>NONO{id, name}
playlisttrackintegerNONO
timeintegerNONO
yearintegerNONO
formatstringYESNO
stream_formatstringYESNO
bitrateintegerYESNO
stream_bitrateintegerYESNO
rateintegerNONO
modestringYESNO
mimestringYESNO
stream_mimestringYESNO
urlstringNONO
sizeintegerNONO
mbidstringYESNO
artstringYESNO
has_artbooleanNONO
flagbooleanNONO
ratingintegerYESNO
averageratingnumberYESNO
playcountintegerNONO
last_playedstringYESNO
catalogstringNONO
composerstringYESNO
channelsintegerYESNO
commentstringYESNO
licensestringYESNO
publisherstringYESNO
languagestringYESNO
lyricsstringYESNO
replaygain_album_gainnumberYESNO
replaygain_album_peaknumberYESNO
replaygain_track_gainnumberYESNO
replaygain_track_peaknumberYESNO
r128_album_gainnumberYESNO
r128_track_gainnumberYESNO
metadataobject<string, string>NOYES
  • throws
<root><error></root>

Example

user

This gets a user's public information.

If the username is omitted, this will return the current api user's public information.

InputTypeDescriptionOptional
'username'stringUsername of the user to get details forYES
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a single object.

FieldTypeNullableOptionalNotes
idstringNONO
usernamestringYESNO
create_dateintegerYESNO
last_seenintegerNONO
linkstringNONO
websitestringYESNO
statestringYESNO
citystringYESNO
artstringYESNO
has_artbooleanNONO
authstringYESYES
emailstringYESYES
accessintegerNOYES
streamtokenstringYESYES
fullname_publicbooleanNOYES
validationstringYESYES
disabledbooleanNOYES
fullnamestringYESYES
  • throws
<root><error></root>

Example

user_create

Create a new user. (Requires the username, password and email.)

ACCESS REQUIRED: 100 (Admin)

InputTypeDescriptionOptional
'username'string$usernameNO
'password'stringhash('sha256', $password)NO
'email'stringe.g. user@gmail.comNO
'fullname'stringYES
'disable'boolean0, 1YES
'group'integerCatalog filter group, default = 0YES

NOTE For privacy, send password in a form or JSON request body rather than the query string. Query-string support for password is deprecated but still accepted for backward compatibility.

  • return
<root>
<success>
</root>
  • throws
<root><error></root>

Example

user_delete

Delete an existing user.

ACCESS REQUIRED: 100 (Admin)

NOTE filter is available in Ampache 7.9.0 and higher. username is deprecated and will be removed in API9.

InputTypeDescriptionOptional
'filter'stringNO
  • return
<root>
<success>
</root>
  • throws
<root><error></root>

Example

user_edit

Update an existing user.

ACCESS REQUIRED: 100 (Admin)

NOTE This function has been renamed from user_update to match other edit functions

NOTE filter is available in Ampache 7.9.0 and higher. username is deprecated and will be removed in API9.

InputTypeDescriptionOptional
'filter'string$usernameNO
'password'stringhash('sha256', $password)YES
'email'stringe.g. user@gmail.comYES
'fullname'stringYES
'website'stringYES
'state'stringYES
'city'stringYES
'disable'boolean0, 1YES
'group'integerCatalog filter group, default = 0YES
'maxbitrate'stringTranscode bitrate in bps, e.g. 320000YES
'fullname_public'integer0, 1 show fullname in public displayYES
'reset_apikey'integer0, 1 reset user Api KeyYES
'reset_streamtoken'integer0, 1 reset user Stream TokenYES
'clear_stats'integer0, 1 reset all stats for this userYES

NOTE For privacy, send password in a form or JSON request body rather than the query string. Query-string support for password is deprecated but still accepted for backward compatibility.

  • return
<root>
<success>
</root>
  • throws
<root><error></root>

Example

user_playlists

This returns playlists based on the specified filter for your user

NOTE This method does not include smartlists

InputTypeDescriptionOptional
'filter'stringFilter results to match this stringYES
'exact'boolean0, 1 (if true filter is exact = rather than fuzzy LIKE)YES
'include'string0, 1 (include playlist items)YES
'add'set_filterISO 8601 Date Format (2020-09-16) Find objects with an 'add' date newer than the specified dateYES
'update'set_filterISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified dateYES
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
'cond'stringApply additional filters to the browse using ; separated comma string pairsYES
(e.g. 'filter1,value1;filter2,value2')
'sort'stringSort name or comma-separated key pair. (e.g. 'name,order')YES
Default order 'ASC' (e.g. 'name,ASC' == 'name')
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a playlist list.

FieldTypeNullableOptionalNotes
total_countintegerNONO
md5stringNONO
playlistarray<PlaylistObject>NONOsee PlaylistObject fields

Each playlist entry (PlaylistObject):

FieldTypeNullableOptionalNotes
idstringNONO
namestringYESNO
ownerstringYESNO
userUserSummaryObjectNONOsee UserSummaryObject fields
itemsarray<object> | integerNONO
typestringYESNO
artstringYESNO
has_accessbooleanNONO
has_collaboratebooleanNONO
has_artbooleanNONO
flagbooleanNONO
ratingintegerYESNO
averageratingnumberYESNO
md5stringYESNO
last_updateintegerYESNO
timeintegerNONO
playlist_folder_idstringNOYES
playlist_folder_sort_orderintegerNOYES
  • throws
<root><error></root>

Example

user_preference

Get your user preference by name

InputTypeDescriptionOptional
'filter'stringPreference name e.g ('notify_email', 'popular_threshold')NO
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a single object.

FieldTypeNullableOptionalNotes
idstringNONO
namestringNONO
valuestringNONO
descriptionstringNONO
levelintegerNONO
typestringNONO
categorystringNONO
subcategorystringYESNO
has_accessbooleanNOYES
valuesarray<string> | array<integer>NOYES
  • throws
<root><error></root>

Example

user_smartlists

This returns smartlists based on the specified filter for your user

NOTE This method does not include playlists

InputTypeDescriptionOptional
'filter'stringFilter results to match this stringYES
'exact'boolean0, 1 (if true filter is exact = rather than fuzzy LIKE)YES
'include'string0, 1 (include playlist items)YES
'add'set_filterISO 8601 Date Format (2020-09-16) Find objects with an 'add' date newer than the specified dateYES
'update'set_filterISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified dateYES
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
'cond'stringApply additional filters to the browse using ; separated comma string pairsYES
(e.g. 'filter1,value1;filter2,value2')
'sort'stringSort name or comma-separated key pair. (e.g. 'name,order')YES
Default order 'ASC' (e.g. 'name,ASC' == 'name')
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a playlist list.

FieldTypeNullableOptionalNotes
total_countintegerNONO
md5stringNONO
playlistarray<PlaylistObject>NONOsee PlaylistObject fields

Each playlist entry (PlaylistObject):

FieldTypeNullableOptionalNotes
idstringNONO
namestringYESNO
ownerstringYESNO
userUserSummaryObjectNONOsee UserSummaryObject fields
itemsarray<object> | integerNONO
typestringYESNO
artstringYESNO
has_accessbooleanNONO
has_collaboratebooleanNONO
has_artbooleanNONO
flagbooleanNONO
ratingintegerYESNO
averageratingnumberYESNO
md5stringYESNO
last_updateintegerYESNO
timeintegerNONO
playlist_folder_idstringNOYES
playlist_folder_sort_orderintegerNOYES
  • throws
<root><error></root>

Example

videos

This returns video objects!

InputTypeDescriptionOptional
'filter'stringFilter results to match this stringYES
'exact'boolean0, 1 (if true filter is exact = rather than fuzzy LIKE)YES
'offset'integerReturn results starting from this index positionYES
'limit'integerMaximum number of results to returnYES
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a video list.

FieldTypeNullableOptionalNotes
total_countintegerNONO
md5stringNONO
videoarray<VideoObject>NONOsee VideoObject fields

Each video entry (VideoObject):

FieldTypeNullableOptionalNotes
idstringNONO
titlestringYESNO
mimestringYESNO
resolutionstringYESNO
sizeintegerNONO
genrearray<GenreReference>NONOsee GenreReference fields
timeintegerNONO
urlstringNONO
artstringYESNO
has_artbooleanNONO
flagbooleanNONO
ratingintegerYESNO
averageratingnumberYESNO
playcountintegerNONO
last_playedstringYESNO
catalogstringNONO
  • throws
<root><error></root>

Example

video

This returns a single video

InputTypeDescriptionOptional
'filter'stringUID of video, returns video XMLNO
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a single object.

FieldTypeNullableOptionalNotes
idstringNONO
titlestringYESNO
mimestringYESNO
resolutionstringYESNO
sizeintegerNONO
genrearray<GenreReference>NONOsee GenreReference fields
timeintegerNONO
urlstringNONO
artstringYESNO
has_artbooleanNONO
flagbooleanNONO
ratingintegerYESNO
averageratingnumberYESNO
playcountintegerNONO
last_playedstringYESNO
catalogstringNONO
  • throws
<root><error></root>

Example

Binary Data Methods

Binary data methods are used for returning raw data to the user such as a image or stream.

download

Downloads a given media file. set format=raw to download the full file

NOTE search and playlist will only download a random object from the list

NOTE filter is available in Ampache 7.9.0 and higher. id is deprecated and will be removed in API9.

InputTypeDescriptionOptional
'filter'string$object_idNO
'type'stringsong, podcast_episode, search, playlistNO
'bitrate'integermax bitrate for transcoding in bytes (e.g 192000=192Kb)YES
'format'stringmp3, ogg, raw, etc (raw returns the original format)YES
'stats'boolean0, 1, if false disable stat recording when playing the object (default: 1)YES
  • return file (HTTP 200 OK)
  • throws (HTTP 400 Bad Request)
  • throws (HTTP 404 Not Found)

get_art

Get an art image.

NOTE filter is available in Ampache 7.9.0 and higher. id is deprecated and will be removed in API9.

InputTypeDescriptionOptional
'filter'string$object_idNO
'type'stringsong, artist, album, playlist, search, podcastNO
'size'stringwidth x height ('640x480')YES
  • return image (HTTP 200 OK)
  • throws (HTTP 400 Bad Request)
  • throws (HTTP 404 Not Found)

NOTE Art was called using thumb parameters which do not make size obvious.Here is a conversion table to convert any links you have created previously

ThumbWidthHeight
1200200
2256256
22512512
32768768
3160160
56464
6200300
346868
64128128
174348348
300400600
7400600
8940400
9300168
104848
4300300
11300300
12300300
999400400

random

Picks a random object and redirects (302) to its stream url. Ampache 8.0.0+

Mirrors stream's transcode parameters. A container type resolves to a random song from within it, so filter names that container.

NOTE filter is read against the table named by type, and those id spaces overlap - album 7 and album_disk 7 are different objects. A client browsing disks (album_group off) holds album_disk ids and must send type=album_disk.

InputTypeDescriptionOptional
'type'stringalbum, album_artist, album_disk, artist, catalog, favorite, genre, label, playlist, podcast_episode, rating, search, song, song_artist, video (default: song)YES
'filter'string$object_id of the container to pick from; a smart_ prefixed id selects a smartlist. favorite reads it as 1/omitted = flagged, 0 = not flagged; rating as 1-5 = that many stars or more, 0 = unrated, omitted = any rated songYES
'bitrate'integermax bitrate for transcoding in bytes (e.g 192000=192Kb) song onlyYES
'format'stringmp3, ogg, raw, etc (raw returns the original format) song onlyYES
'offset'integertime offset in secondsYES
'stats'boolean0, 1, if false disable stat recording when playing the object (default: 1)YES
  • return file (HTTP 302 Found; redirects to the stream url)
  • throws (HTTP 400 Bad Request)
  • throws (HTTP 404 Not Found)

stream

Streams a given media file. Takes the file id in parameter with optional max bit rate, file format, time offset, size and estimate content length option.

NOTE search and playlist will only stream a random object from the list

NOTE filter is available in Ampache 7.9.0 and higher. id is deprecated and will be removed in API9.

NOTE length requests an estimated Content-Length. The estimate is duration x bitrate and was measured 13% short to 7% over depending on codec, so it is unreliable unless the transcode is cached; an over-declared body is truncated in transit.

InputTypeDescriptionOptional
'filter'string$object_idNO
'type'stringsong, podcast_episode, search, playlistNO
'bitrate'integermax bitrate for transcoding in bytes (e.g 192000=192Kb)YES
'format'stringmp3, ogg, raw, etc (raw returns the original format)YES
'offset'integerReturn results starting from this index positionYES
'length'boolean0, 1 estimated Content-Length (unreliable unless cached)YES
'stats'boolean0, 1, if false disable stat recording when playing the object (default: 1)YES
  • return file (HTTP 200 OK)
  • throws (HTTP 400 Bad Request)
  • throws (HTTP 404 Not Found)

Control Methods

localplay

This is for controlling localplay

NOTE filter is available in Ampache 7.9.0 and higher. oid is deprecated and will be removed in API9.

InputTypeDescriptionOptional
'command'stringnext, prev, stop, play, pause, add, volume_upNO
volume_down, volume_mute, delete_all, skip, status
'filter'string$object_idYES
'type'stringsong, video, podcast_episode, channel, broadcast, democratic, live_streamYES
'clear'boolean0, 1 (Clear the current playlist before adding)YES
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

The status command reports the player state instead of a boolean.

FieldTypeNullableOptionalNotes
localplayobjectNONO{command}
  • throws
<root><error></root>

Example

Example (status)

localplay_songs

Get the list of songs in your localplay instance

This method takes no additional parameters.

  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Returns a localplay_songs list.

FieldTypeNullableOptionalNotes
localplay_songsarray<LocalplaySongObject>NONOsee LocalplaySongObject fields

Each localplay_songs entry (LocalplaySongObject):

FieldTypeNullableOptionalNotes
idintegerNONO
rawstringNONO
vlidintegerNOYES
oidintegerNOYES
namestringYESYES
linkstringYESYES
trackintegerNONO
  • throws
<root><error></root>

Example

democratic

This is for controlling democratic play (Songs only)

  • Method Descriptions
    • vote: +1 vote for the oid
    • devote: -1 vote for the oid
    • playlist: Return an array of song items with an additional <vote>[VOTE COUNT]</vote> element
    • play: Returns the URL for playing democratic play
InputTypeDescriptionOptional
'oid'stringUID of Song objectNO
'method'stringvote, devote, playlist, playNO
  • return

XML structure: serialised inside a <root> element. Each object is an element (e.g. <song>) with id as an attribute; nested objects are child elements (also carrying an id attribute), array/list fields are emitted as repeated elements, booleans are 0/1, and text values are wrapped in CDATA. Field names match the JSON model below, but element nesting/repetition differs from the JSON representation.

Depends on the method parameter: play returns the stream url, vote/devote return the applied method and its result, and playlist returns the current democratic song list.

DemocraticPlayResponse

Returned by method=play: the stream URL of the democratic playlist.

Returned by method=play: the stream URL of the democratic playlist.

FieldTypeNullableOptionalNotes
urlstringNONO

DemocraticVoteResponse

Returned by method=vote and method=devote.

Returned by method=vote and method=devote.

FieldTypeNullableOptionalNotes
methodstringNONO
resultbooleanNONO

DemocraticSongsResponse

Returns a song list.

FieldTypeNullableOptionalNotes
songarray<DemocraticSongObject>NONOsee DemocraticSongObject fields

Each song entry (DemocraticSongObject):

FieldTypeNullableOptionalNotes
idstringNONO
titlestringYESNO
artistNamedReferenceNONOsee NamedReference fields
albumNamedReferenceNONOsee NamedReference fields
genrearray<GenreReference>NONOsee GenreReference fields
trackintegerNONO
timeintegerNONO
formatstringYESNO
bitrateintegerYESNO
mimestringYESNO
urlstringNONO
sizeintegerNONO
artstringYESNO
has_artbooleanNONO
ratingintegerYESNO
averageratingnumberYESNO
playcountintegerNONO
voteintegerNONO
  • throws
<root><error></root>

Example

Example

Example

Shared reference objects

Objects referenced by the field tables above (as see <name> fields) that no single method response documents on its own — the shared reference shapes and a few payloads carried inside another response.

CollectionItemObject

One member of a collection, at the position it was curated into. object_type names the type and the property of the same name carries that type's own object, e.g. {"track": 1, "track_id": 7, "object_type": "album", "album": {...}}. track_id is the id of the membership row rather than of the object, and is the only stable way to tell two members apart when the same object appears more than once.

FieldTypeNullableOptionalNotes
trackintegerNONO
track_idintegerNONO
object_typestringNONO

FolderBrowseItem

One child of the folder being browsed. parent is always the id of that folder, so an item lifted out of the list still knows where it came from; it is -1 when the folder being browsed is the virtual root.

FieldTypeNullableOptionalNotes
idstringNONO
object_typestringNONO
titlestringYESNO
parentstringNONO
pathstringYESNO
artstringYESNO
has_artbooleanNONO
play_urlstringNONO
ratingintegerYESNO
averageratingintegerYESNO

FolderBrowseNode

The folder that was browsed, and its children. parent is the id of the folder this one hangs off: a top level folder reports the virtual root (-1) rather than nothing, so a client can always walk up, and null means this is the virtual root itself.

FieldTypeNullableOptionalNotes
idstringNONO
titlestringYESNO
parentstringYESNO
pathstringYESNO
catalogstringNONO
itemsarray<FolderBrowseItem>NONOsee FolderBrowseItem fields

GenreReference

FieldTypeNullableOptionalNotes
idstringNONO
namestringNONO

IndexReferenceObject

FieldTypeNullableOptionalNotes
idstringNONO
typestringNONO

LocalplayStatusObject

Player state. The exact fields come from the configured Localplay controller (MPD, VLC, XBMC, UPnP, HTTPQ), so only repeat and random are guaranteed - the API coerces those two to booleans. The rest are what that controller reports.

FieldTypeNullableOptionalNotes
statestringNOYES
volumestringNOYES
repeatbooleanNONO
randombooleanNONO
trackintegerNOYES
track_titlestringNOYES
track_artiststringNOYES
track_albumstringNOYES

NamedReference

FieldTypeNullableOptionalNotes
idstringNONO
namestringYESNO
prefixstringYESNO
basenamestringYESNO

PlaylistFolderItemObject

One list filed in a playlist folder. object_type is playlist, smartlist or collection and the property of the same name carries that type's own object, e.g. {"sort_order": 1, "object_type": "playlist", "playlist": {...}}. sort_order is client-assigned and shared with the sibling folders, so ties are broken by name.

FieldTypeNullableOptionalNotes
sort_orderintegerNONO
object_typestringNONO