XML Methods
API XML Methods
Let's go through come calls and examples that you can do for each XML method.
With the exception of Binary methods, all responses will return a HTTP 200 response.
Also remember that Binary data methods will not return xml; 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.
| Input | Type | Description | Optional |
|---|---|---|---|
| 'auth' | string | $passphrase (Timestamp . Password SHA hash) OR (API Key) | NO |
| 'user' | string | $username (Required if login/password authentication) | YES |
| 'timestamp' | integer | UNIXTIME() The timestamp used in seed of password hash | YES |
| (Required if login/password authentication) | |||
| 'version' | string | $version (API Version that the application understands) | YES |
- return
<root>
<auth>
<api>
<session_expire>
<update>
<add>
<clean>
<songs>
<albums>
<artists>
<genres>
<playlists>
<users>
<catalogs>
<videos>
<podcasts>
<podcast_episodes>
<shares>
<licenses>
<live_streams>
<labels>
</root>
- throws
<root><error></root>
goodbye
Destroy a session using the auth parameter.
| Input | Type | Description | Optional |
|---|---|---|---|
| 'auth' | string | (Session ID) destroys the session if it exists | NO |
- return
<root>
<success>
</root>
- throws
<root><error></root>
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);
| Input | Type | Description | Optional |
|---|---|---|---|
| 'auth' | string | password reset token | NO |
- return
<root>
<success>
</root>
- 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
| Input | Type | Description | Optional |
|---|---|---|---|
| 'auth' | string | (Session ID) returns version information and extends the session if passed | YES |
| 'version' | string | $version (API Version that the application understands) | YES |
- return
<root>
<session_expire>
<server>
<version>
<compatible>
<auth>
<api>
<update>
<add>
<clean>
<songs>
<albums>
<artists>
<genres>
<playlists>
<users>
<catalogs>
<videos>
<podcasts>
<podcast_episodes>
<shares>
<licenses>
<live_streams>
<labels>
</root>
- throws
<root>
<server>
<version>
<compatible>
</root>
register
Register as a new user if allowed. (Requires the username, password and email.)
| Input | Type | Description | Optional |
|---|---|---|---|
| 'username' | string | $username | NO |
| 'password' | string | hash('sha256', $password) | NO |
| 'email' | string | e.g. user@gmail.com | NO |
| 'fullname' | string | YES |
- 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
<root>
<success>
</root>
- throws
<root><error></root>
system_preferences
Get your server preferences
ACCESS REQUIRED: 100 (Admin)
-
You can modify and update your preferences using the following methods
-
return
<root>
<preferences>
</root>
- throws
<root><error></root>
users
Get ids and usernames for your site
- return
<root>
<user>
</root>
- throws
<root><error></root>
user_preferences
Get your user preferences
-
You can modify and update your preferences using the following methods
-
return
<root>
<preference>
</root>
Data Methods
Data methods require additional information and parameters to return information
advanced_search
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
| Input | Type | Description | Optional |
|---|---|---|---|
| operator | string | and, 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 |
| type | string | song, album, artist, label, playlist | NO |
podcast, podcast_episode, genre, user, video | |||
| random | boolean | 0, 1 (random order of results; default to 0) | YES |
| 'offset' | integer | Return results starting from this index position | YES |
| 'limit' | integer | Maximum number of results to return | YES |
- 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
| Input | Type | Description | Optional |
|---|---|---|---|
| 'filter' | string | Filter results to match this string | YES |
| 'include' | string | albums, songs (include child objects in the response) | YES |
| 'exact' | boolean | 0, 1 (if true filter is exact = rather than fuzzy LIKE) | YES |
| 'add' | set_filter | ISO 8601 Date Format (2020-09-16) Find objects with an 'add' date newer than the specified date | YES |
| 'update' | set_filter | ISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified date | YES |
| 'offset' | integer | Return results starting from this index position | YES |
| 'limit' | integer | Maximum number of results to return | YES |
| 'cond' | string | Apply additional filters to the browse using ; separated comma string pairs | YES |
| (e.g. 'filter1,value1;filter2,value2') | |||
| 'sort' | string | Sort name or comma-separated key pair. (e.g. 'name,order') | YES |
| Default order 'ASC' (e.g. 'name,ASC' == 'name') |
- return
<root>
<total_count>
<album>
</root>
- throws
<root><error></root>
album
This returns a single album based on the UID provided
| Input | Type | Description | Optional |
|---|---|---|---|
| 'filter' | string | UID of Album, returns album XML | NO |
| 'include' | string | songs (include child objects in the response) | YES |
- return
<root>
<total_count>
<album>
</root>
- throws
<root><error></root>
album_songs
This returns the songs of a specified album
| Input | Type | Description | Optional |
|---|---|---|---|
| 'filter' | string | UID of Album, returns song XML | NO |
| 'offset' | integer | Return results starting from this index position | YES |
| 'limit' | integer | Maximum number of results to return | YES |
| 'cond' | string | Apply additional filters to the browse using ; separated | YES |
| comma string pairs (e.g. 'filter1,value1;filter2,value2') | |||
| 'sort' | string | Sort name or comma-separated key pair. (e.g. 'name,order') | YES |
| Default order 'ASC' (e.g. 'name,ASC' == 'name') |
- return
<root>
<total_count>
<song>
</root>
- throws
<root><error></root>
artists
This takes a collection of inputs and returns artist objects.
| Input | Type | Description | Optional |
|---|---|---|---|
| 'filter' | string | Filter results to match this string | YES |
| 'exact' | boolean | 0, 1 (if true filter is exact = rather than fuzzy LIKE) | YES |
| 'add' | set_filter | ISO 8601 Date Format (2020-09-16) Find objects with an 'add' date newer than the specified date | YES |
| 'update' | set_filter | ISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified date | YES |
| 'include' | string | albums, songs (include child objects in the response) | YES |
| 'album_artist' | boolean | 0, 1 (if true filter for album artists only) | YES |
| 'offset' | integer | Return results starting from this index position | YES |
| 'limit' | integer | Maximum number of results to return | YES |
| 'cond' | string | Apply additional filters to the browse using ; separated comma string pairs | YES |
| (e.g. 'filter1,value1;filter2,value2') | |||
| 'sort' | string | Sort name or comma-separated key pair. (e.g. 'name,order') | YES |
| Default order 'ASC' (e.g. 'name,ASC' == 'name') |
- return
<root>
<total_count>
<artist>
</root>
- throws
<root><error></root>
artist
This returns a single artist based on the UID of said artist
| Input | Type | Description | Optional |
|---|---|---|---|
| 'filter' | string | UID of Artist, returns artist XML | NO |
| 'include' | string | albums, songs (include child objects in the response) | YES |
- return
<root>
<total_count>
<artist>
</root>
- throws
<root><error></root>
artist_albums
This returns the albums of an artist
| Input | Type | Description | Optional |
|---|---|---|---|
| 'filter' | string | UID of Artist, returns Album XML | NO |
| 'album_artist' | boolean | 0, 1 (if true filter for album artists only) | YES |
| 'offset' | integer | Return results starting from this index position | YES |
| 'limit' | integer | Maximum number of results to return | YES |
| 'cond' | string | Apply additional filters to the browse using ; separated comma string pairs | YES |
| (e.g. 'filter1,value1;filter2,value2') | |||
| 'sort' | string | Sort name or comma-separated key pair. (e.g. 'name,order') | YES |
| Default order 'ASC' (e.g. 'name,ASC' == 'name') |
- return
<root>
<total_count>
<album>
</root>
- throws
<root><error></root>
artist_songs
This returns the songs of the specified artist
| Input | Type | Description | Optional |
|---|---|---|---|
| 'filter' | string | UID of Artist, returns Song XML | NO |
| 'top50' | boolean | 0, 1 (if true filter to the artist top 50) | YES |
| 'offset' | integer | Return results starting from this index position | YES |
| 'limit' | integer | Maximum number of results to return | YES |
| 'cond' | string | Apply additional filters to the browse using ; separated comma string pairs | YES |
| (e.g. 'filter1,value1;filter2,value2') | |||
| 'sort' | string | Sort name or comma-separated key pair. (e.g. 'name,order') | YES |
| Default order 'ASC' (e.g. 'name,ASC' == 'name') |
- return
<root>
<total_count>
<song>
</root>
- throws
<root><error></root>
bookmarks
Get information about bookmarked media this user is allowed to manage.
| Input | Type | Description | Optional |
|---|---|---|---|
| 'client' | string | filter by the agent/client name | YES |
| 'include' | integer | 0,1, if true include the object in the bookmark | YES |
- return
<root>
<bookmark>
</root>
- throws
<root><error></root>
Example Example (with include)
bookmark
Get a single bookmark by bookmark_id
| Input | Type | Description | Optional |
|---|---|---|---|
| 'filter' | string | bookmark_id | YES |
| 'include' | integer | 0,1, if true include the object in the bookmark | YES |
- return
<root>
<bookmark>
</root>
- throws
<root><error></root>
Example Example (with include)
bookmark_create
Create a placeholder for the current media that you can return to later.
| Input | Type | Description | Optional |
|---|---|---|---|
| 'filter' | string | $object_id to find | NO |
| 'type' | string | song, video, podcast_episode (object_type) | NO |
| 'position' | integer | current track time in seconds | NO |
| 'client' | string | Agent string. | YES |
| 'date' | integer | update time (Default: UNIXTIME()) | YES |
| 'include' | integer | 0,1, if true include the object in the bookmark | YES |
- return
<root>
<bookmark>
</root>
- throws
<root><error></root>
bookmark_delete
Delete an existing bookmark. (if it exists)
| Input | Type | Description | Optional |
|---|---|---|---|
| 'filter' | string | $object_id to delete | NO |
| 'type' | string | song, video, podcast_episode (object_type) | NO |
| 'client' | string | Agent string. | YES |
- return
<root>
<success>
</root>
- throws
<root><error></root>
bookmark_edit
Edit a placeholder for the current media that you can return to later.
| Input | Type | Description | Optional |
|---|---|---|---|
| 'filter' | string | $object_id to find | NO |
| 'type' | string | bookmark, song, video, podcast_episode (object_type) | NO |
| 'position' | integer | current track time in seconds | NO |
| 'client' | string | Agent string. | YES |
| 'date' | integer | update time (Default: UNIXTIME()) | YES |
| 'include' | integer | 0,1, if true include the object in the bookmark | YES |
- return
<root>
<bookmark>
</root>
- throws
<root><error></root>
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 Catalog ID is required on 'artist', 'album', 'podcast' so you can filter the browse correctly
| Input | Type | Description | Optional |
|---|---|---|---|
| 'filter' | string | object_id | YES |
| 'type' | string | 'root', 'catalog', 'artist', 'album', 'podcast' | YES |
| 'catalog' | string | catalog ID you are browsing | YES |
| 'add' | set_filter | ISO 8601 Date Format (2020-09-16) Find objects with an 'add' date newer than the specified date | YES |
| 'update' | set_filter | ISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified date | YES |
| 'offset' | integer | Return results starting from this index position | YES |
| 'limit' | integer | Maximum number of results to return | YES |
| 'cond' | string | Apply additional filters to the browse using ; separated comma string pairs | YES |
| (e.g. 'filter1,value1;filter2,value2') | |||
| 'sort' | string | Sort name or comma-separated key pair. (e.g. 'name,order') | YES |
| Default order 'ASC' (e.g. 'name,ASC' == 'name') |
- return
<root>
<total_count>
<browse>
</root>
- throws
<root><error></root>
catalogs
This searches the catalogs and returns... catalogs
| Input | Type | Description | Optional |
|---|---|---|---|
| 'filter' | string | music, clip, tvshow, movie, personal_video, podcast (Catalog type) | YES |
| 'offset' | integer | Return results starting from this index position | YES |
| 'limit' | integer | Maximum number of results to return | YES |
| 'cond' | string | Apply additional filters to the browse using ; separated comma string pairs | YES |
| (e.g. 'filter1,value1;filter2,value2') | |||
| 'sort' | string | Sort name or comma-separated key pair. (e.g. 'name,order') | YES |
| Default order 'ASC' (e.g. 'name,ASC' == 'name') |
- return
<root>
<total_count>
<catalog>
</root>
- throws
<root><error></root>
catalog
Return catalog by UID
| Input | Type | Description | Optional |
|---|---|---|---|
| 'filter' | string | UID of Catalog | NO |
- return
<root>
<total_count>
<catalog>
</root>
- throws
<root><error></root>
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 will be deprecated and removed in a future release.
| Input | Type | Description | Optional |
|---|---|---|---|
| 'task' | string | add_to_catalog, clean_catalog | NO |
| 'catalog' | string | $catalog_id | NO |
| 'filter' | string | Alias of catalog (Ampache 7.9.0+) | YES |
- return
<root>
<success>
</root>
- throws
<root><error></root>
catalog_add
Create a public url that can be used by anyone to stream media. Takes the file id with optional description and expires parameters.
ACCESS REQUIRED: 75 (Catalog Manager)
| Input | Type | Description | Optional |
|---|---|---|---|
| 'name' | string | Name for the catalog | NO |
| 'path' | string | URL or folder path for your catalog | NO |
| 'type' | string | 'local', 'beets', 'remote', 'subsonic', 'seafile', 'beetsremote' Default: local | YES |
| 'media_type' | string | 'music', 'podcast', 'clip', 'tvshow', 'movie', 'personal_video' Default: 'music' | YES |
| 'file_pattern' | string | Pattern used identify tags from the file name. Default: '%T - %t' | YES |
| 'folder_pattern' | string | Pattern used identify tags from the folder name. Default: '%a/%A' | YES |
| 'username' | string | login to remote catalog ('remote', 'subsonic', 'seafile', 'beetsremote') | YES |
| 'password' | string | password to remote catalog ('remote', 'subsonic', 'seafile', 'beetsremote') | YES |
- return
<root>
<total_count>
<catalog>
</root>
- throws
<root><error></root>
catalog_delete
Delete an existing catalog.
ACCESS REQUIRED: 75 (Catalog Manager)
| Input | Type | Description | Optional |
|---|---|---|---|
| 'filter' | string | UID of catalog to delete | NO |
- return
<root>
<success>
</root>
- throws
<root><error></root>
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 will be deprecated and removed in a future release.
| Input | Type | Description | Optional |
|---|---|---|---|
| 'file' | string | FULL path to local file | NO |
| 'task' | string | add, clean, verify, remove (can include comma-separated values) | NO |
| 'catalog' | string | $catalog_id | NO |
| 'filter' | string | Alias of catalog (Ampache 7.9.0+) | YES |
- return
<root>
<success>
</root>
- throws
<root><error></root>
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 will be deprecated and removed in a future release.
| Input | Type | Description | Optional |
|---|---|---|---|
| 'folder' | string | FULL path to local folder | NO |
| 'task' | string | add, clean, verify, remove (can include comma-separated values) | NO |
| 'catalog' | string | $catalog_id | NO |
| 'filter' | string | Alias of catalog (Ampache 7.9.0+) | YES |
- return
<root>
<success>
</root>
- throws
<root><error></root>
deleted_podcast_episodes
This returns the episodes for a podcast that have been deleted
| Input | Type | Description | Optional |
|---|---|---|---|
| 'offset' | integer | Return results starting from this index position | YES |
| 'limit' | integer | Maximum number of results to return | YES |
- return
<root>
<deleted_podcast_episode>
</root>
- throws
<root><error></root>
deleted_songs
Returns songs that have been deleted from the server
| Input | Type | Description | Optional |
|---|---|---|---|
| 'offset' | integer | Return results starting from this index position | YES |
| 'limit' | integer | Maximum number of results to return | YES |
- return
<root>
<deleted_song>
</root>
- throws
<root><error></root>
deleted_videos
This returns video objects that have been deleted
| Input | Type | Description | Optional |
|---|---|---|---|
| 'offset' | integer | Return results starting from this index position | YES |
| 'limit' | integer | Maximum number of results to return | YES |
- return
<root>
<deleted_video>
</root>
- throws
<root><error></root>
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 will be deprecated and removed in a future release.
| Input | Type | Description | Optional |
|---|---|---|---|
| 'type' | string | song, album, artist, playlist, podcast | NO |
podcast_episode, video, tvshow, tvshow_season | |||
| 'id' | string | $object_id | NO |
| 'filter' | string | Alias of id (Ampache 7.9.0+) | YES |
| 'flag' | boolean | 0, 1 | NO |
- return
<root>
<success>
</root>
- throws
<root><error></root>
followers
This gets the followers for the requested username
| Input | Type | Description | Optional |
|---|---|---|---|
| 'username' | string | Username of the user for who to get followers list | NO |
| 'offset' | integer | Return results starting from this index position | YES |
| 'limit' | integer | Maximum number of results to return | YES |
| 'cond' | string | Apply additional filters to the browse using ; separated comma string pairs | YES |
| (e.g. 'filter1,value1;filter2,value2') | |||
| 'sort' | string | Sort name or comma-separated key pair. (e.g. 'name,order') | YES |
| Default order 'ASC' (e.g. 'name,ASC' == 'name') |
- return
<root>
<user>
</root>
- throws
<root><error></root>
following
Get a list of people that this user follows
| Input | Type | Description | Optional |
|---|---|---|---|
| 'username' | string | (Username of the user for who to get following list | NO |
- return
<root>
<user>
</root>
- throws
<root><error></root>
friends_timeline
This get current user friends timeline
| Input | Type | Description | Optional |
|---|---|---|---|
| 'limit' | integer | Maximum number of results to return | YES |
| 'since' | integer | UNIXTIME() | NO |
- return
<root>
<activity>
</root>
- throws
<root><error></root>
genres
This returns the genres (Tags) based on the specified filter
| Input | Type | Description | Optional |
|---|---|---|---|
| 'filter' | string | Filter results to match this string | YES |
| 'exact' | boolean | 0, 1 (if true filter is exact = rather than fuzzy LIKE) | YES |
| 'offset' | integer | Return results starting from this index position | YES |
| 'limit' | integer | Maximum number of results to return | YES |
| 'cond' | string | Apply additional filters to the browse using ; separated comma string pairs | YES |
| (e.g. 'filter1,value1;filter2,value2') | |||
| 'sort' | string | Sort name or comma-separated key pair. (e.g. 'name,order') | YES |
| Default order 'ASC' (e.g. 'name,ASC' == 'name') |
- return
<root>
<total_count>
<genre>
</root>
- throws
<root><error></root>
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.
| Input | Type | Description | Optional |
|---|---|---|---|
| 'filter' | string | UID of genre, returns genre XML | NO |
- return
<root>
<total_count>
<genre>
</root>
- throws
<root><error></root>
genre_albums
This returns the albums associated with the genre in question
| Input | Type | Description | Optional |
|---|---|---|---|
| 'filter' | string | UID of genre, returns album XML | NO |
| 'offset' | integer | Return results starting from this index position | YES |
| 'limit' | integer | Maximum number of results to return | YES |
| 'cond' | string | Apply additional filters to the browse using ; separated comma string pairs | YES |
| (e.g. 'filter1,value1;filter2,value2') | |||
| 'sort' | string | Sort name or comma-separated key pair. (e.g. 'name,order') | YES |
| Default order 'ASC' (e.g. 'name,ASC' == 'name') |
- return
<root>
<total_count>
<album>
</root>
- throws
<root><error></root>
genre_artists
This returns the artists associated with the genre in question as defined by the UID
| Input | Type | Description | Optional |
|---|---|---|---|
| 'filter' | string | UID of genre, returns artist XML | NO |
| 'offset' | integer | Return results starting from this index position | YES |
| 'limit' | integer | Maximum number of results to return | YES |
| 'cond' | string | Apply additional filters to the browse using ; separated comma string pairs | YES |
| (e.g. 'filter1,value1;filter2,value2') | |||
| 'sort' | string | Sort name or comma-separated key pair. (e.g. 'name,order') | YES |
| Default order 'ASC' (e.g. 'name,ASC' == 'name') |
- return
<root>
<total_count>
<artist>
</root>
- throws
<root><error></root>
genre_songs
returns the songs for this genre
| Input | Type | Description | Optional |
|---|---|---|---|
| 'filter' | string | UID of genre, returns song XML | NO |
| 'offset' | integer | Return results starting from this index position | YES |
| 'limit' | integer | Maximum number of results to return | YES |
| 'cond' | string | Apply additional filters to the browse using ; separated comma string pairs | YES |
| (e.g. 'filter1,value1;filter2,value2') | |||
| 'sort' | string | Sort name or comma-separated key pair. (e.g. 'name,order') | YES |
| Default order 'ASC' (e.g. 'name,ASC' == 'name') |
- return
<root>
<total_count>
<song>
</root>
- throws
<root><error></root>
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.
| Input | Type | Description | Optional |
|---|---|---|---|
| 'filter' | string | $object_id to find | NO |
| 'type' | string | song, video, podcast_episode (object_type) | NO |
| 'include' | integer | 0,1, if true include the object in the bookmark | YES |
| 'all' | integer | 0,1, if true include every bookmark for the object | YES |
- 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
| Input | Type | Description | Optional |
|---|---|---|---|
| 'filter' | string | $object_id to find | NO |
| 'type' | string | song, album, artist, label (object_type) | NO |
- return
<root>
</root>
- throws
<root><error></root>
get_indexes
This takes a collection of inputs and returns ID + name for the object type
NOTE This method is depreciated and will be removed in API7 (Use list)
| Input | Type | Description | Optional |
|---|---|---|---|
| 'type' | string | song, album, artist, album_artist, song_artist, playlist, podcast | NO |
podcast_episode, live_stream, catalog | |||
| 'filter' | string | Value is Alpha Match for returned results, may be more than one letter/number | YES |
| 'hide_search' | integer | 0, 1 (if true do not include searches/smartlists in the result) | YES |
| 'update' | set_filter | ISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified date | YES |
| 'include' | boolean | 0, 1 (include songs in a playlist or episodes in a podcast) | YES |
| 'offset' | integer | Return results starting from this index position | YES |
| 'limit' | integer | Maximum number of results to return | YES |
| 'cond' | string | Apply additional filters to the browse using ; separated comma string pairs | YES |
| (e.g. 'filter1,value1;filter2,value2') | |||
| 'sort' | string | Sort 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
| Input | Type | Description | Optional |
|---|---|---|---|
| 'filter' | string | $song_id to find | NO |
| 'plugins' | string | 0, 1, if false disable plugin lookup (default: 1) | NO |
- return
<root>
</root>
- throws
<root><error></root>
get_similar
Return similar artist id's or similar song ids compared to the input filter
| Input | Type | Description | Optional |
|---|---|---|---|
| 'type' | string | song, artist | NO |
| 'filter' | string | artist id or song id | NO |
| 'offset' | integer | Return results starting from this index position | YES |
| 'limit' | integer | Maximum number of results to return | YES |
- return
<root>
<total_count>
<song>|<artist>
</root>
- throws
<root><error></root>
index
This takes a collection of inputs and returns ID + name for the object type
| Input | Type | Description | Optional |
|---|---|---|---|
| 'type' | string | catalog, song, album, artist, album_artist, song_artist | NO |
playlist, podcast, podcast_episode, share, video, live_stream | |||
| 'filter' | string | Value is Alpha Match for returned results, may be more than one letter/number | YES |
| 'hide_search' | integer | 0, 1 (if true do not include searches/smartlists in the result) | YES |
| 'exact' | boolean | 0, 1 (if true filter is exact = rather than fuzzy LIKE) | YES |
| 'add' | set_filter | ISO 8601 Date Format (2020-09-16) Find objects with an 'add' date newer than the specified date | YES |
| 'update' | set_filter | ISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified date | YES |
| 'include' | boolean | 0, 1 (include songs in a playlist or episodes in a podcast) | YES |
| 'offset' | integer | Return results starting from this index position | YES |
| 'limit' | integer | Maximum number of results to return | YES |
| 'cond' | string | Apply additional filters to the browse using ; separated comma string pairs | YES |
| (e.g. 'filter1,value1;filter2,value2') | |||
| 'sort' | string | Sort name or comma-separated key pair. (e.g. 'name,order') | YES |
| Default order 'ASC' (e.g. 'name,ASC' == 'name') |
- return
<root>
<total_count>
<catalog>|<song>|<album>|<artist>|<album_artist>|<song_artist>|<playlist>|<podcast>|<podcast_episode>|<share>|<video>|<live_stream>
</root>
- throws
<root><error></root>
SONGS Example
ARTIST Example
ALBUM Example
PLAYLIST Example
PODCAST Example
ARTIST Example (with include)
ALBUM Example (with include)
PLAYLIST Example (with include)
labels
This returns labels based on the specified filter
| Input | Type | Description | Optional |
|---|---|---|---|
| 'filter' | string | Filter results to match this string | YES |
| 'exact' | boolean | 0, 1 (if true filter is exact = rather than fuzzy LIKE) | YES |
| 'offset' | integer | Return results starting from this index position | YES |
| 'limit' | integer | Maximum number of results to return | YES |
| 'cond' | string | Apply additional filters to the browse using ; separated comma string pairs | YES |
| (e.g. 'filter1,value1;filter2,value2') | |||
| 'sort' | string | Sort name or comma-separated key pair. (e.g. 'name,order') | YES |
| Default order 'ASC' (e.g. 'name,ASC' == 'name') |
- return
<root>
<total_count>
<label>
</root>
- throws
<root><error></root>
label
This returns a single label
| Input | Type | Description | Optional |
|---|---|---|---|
| 'filter' | string | UID of label, returns label XML | NO |
- return
<root>
<total_count>
<label>
</root>
- throws
<root><error></root>
label_artists
This returns the artists for a label
| Input | Type | Description | Optional |
|---|---|---|---|
| 'filter' | string | UID of label, returns artist XML | NO |
| 'offset' | integer | Return results starting from this index position | YES |
| 'limit' | integer | Maximum number of results to return | YES |
| 'cond' | string | Apply additional filters to the browse using ; separated comma string pairs | YES |
| (e.g. 'filter1,value1;filter2,value2') | |||
| 'sort' | string | Sort name or comma-separated key pair. (e.g. 'name,order') | YES |
| Default order 'ASC' (e.g. 'name,ASC' == 'name') |
- return
<root>
<total_count>
<artist>
</root>
- throws
<root><error></root>
last_shouts
This gets the latest posted shouts
| Input | Type | Description | Optional |
|---|---|---|---|
| 'username' | string | Get latest shouts for this username | YES |
| 'limit' | integer | Maximum number of results (Use popular_threshold when missing; default 10) | YES |
- return
<root>
<shout>
</root>
- throws
<root><error></root>
license
This returns a single license
| Input | Type | Description | Optional |
|---|---|---|---|
| 'filter' | string | UID of license, returns license XML | NO |
- return
<root>
<total_count>
<license>
</root>
- throws
<root><error></root>
license_songs
This returns the songs for a license
| Input | Type | Description | Optional |
|---|---|---|---|
| 'filter' | string | UID of license, returns song XML | NO |
| 'offset' | integer | Return results starting from this index position | YES |
| 'limit' | integer | Maximum number of results to return | YES |
| 'cond' | string | Apply additional filters to the browse using ; separated comma string pairs | YES |
| (e.g. 'filter1,value1;filter2,value2') | |||
| 'sort' | string | Sort name or comma-separated key pair. (e.g. 'name,order') | YES |
| Default order 'ASC' (e.g. 'name,ASC' == 'name') |
- return
<root>
<total_count>
<song>
</root>
- throws
<root><error></root>
licenses
This returns licenses based on the specified filter
| Input | Type | Description | Optional |
|---|---|---|---|
| 'filter' | string | Filter results to match this string | YES |
| 'exact' | boolean | 0, 1 (if true filter is exact = rather than fuzzy LIKE) | YES |
| 'offset' | integer | Return results starting from this index position | YES |
| 'limit' | integer | Maximum number of results to return | YES |
| 'cond' | string | Apply additional filters to the browse using ; separated comma string pairs | YES |
| (e.g. 'filter1,value1;filter2,value2') | |||
| 'sort' | string | Sort name or comma-separated key pair. (e.g. 'name,order') | YES |
| Default order 'ASC' (e.g. 'name,ASC' == 'name') |
- return
<root>
<total_count>
<license>
</root>
- throws
<root><error></root>
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.
| Input | Type | Description | Optional |
|---|---|---|---|
| 'type' | string | song, album, artist, album_artist, song_artist, playlist, podcast | NO |
podcast_episode, live_stream, catalog | |||
| 'filter' | string | Value is Alpha Match for returned results, may be more than one letter/number | YES |
| 'hide_search' | integer | 0, 1 (if true do not include searches/smartlists in the result) | YES |
| 'update' | set_filter | ISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified date | YES |
| 'offset' | integer | Return results starting from this index position | YES |
| 'limit' | integer | Maximum number of results to return | YES |
| 'cond' | string | Apply additional filters to the browse using ; separated comma string pairs | YES |
| (e.g. 'filter1,value1;filter2,value2') | |||
| 'sort' | string | Sort name or comma-separated key pair. (e.g. 'name,order') | YES |
| Default order 'ASC' (e.g. 'name,ASC' == 'name') |
- return
<root>
<total_count>
<list>
</root>
- throws
<root><error></root>
live_streams
This returns live_streams based on the specified filter
| Input | Type | Description | Optional |
|---|---|---|---|
| 'filter' | string | Filter results to match this string | YES |
| 'exact' | boolean | 0, 1 (if true filter is exact = rather than fuzzy LIKE) | YES |
| 'offset' | integer | Return results starting from this index position | YES |
| 'limit' | integer | Maximum number of results to return | YES |
| 'cond' | string | Apply additional filters to the browse using ; separated comma string pairs | YES |
| (e.g. 'filter1,value1;filter2,value2') | |||
| 'sort' | string | Sort name or comma-separated key pair. (e.g. 'name,order') | YES |
| Default order 'ASC' (e.g. 'name,ASC' == 'name') |
- return
<root>
<total_count>
<live_stream>
</root>
- throws
<root><error></root>
live_stream
This returns a single live_stream
| Input | Type | Description | Optional |
|---|---|---|---|
| 'filter' | string | UID of live_stream, returns live_stream XML | NO |
- return
<root>
<total_count>
<live_stream>
</root>
- throws
<root><error></root>
live_stream_create
Create a live_stream (radio station) object.
ACCESS REQUIRED: 50 (Content Manager) permission to create and edit live_streams
| Input | Type | Description | Optional |
|---|---|---|---|
| 'filter' | string | $object_id to find | NO |
| 'type' | string | song, video, podcast_episode (object_type) | NO |
| 'position' | integer | current track time in seconds | NO |
| 'client' | string | Agent string. (Default: 'AmpacheAPI') | YES |
| 'date' | integer | update time (Default: UNIXTIME()) | YES |
- return
<root>
<live_stream>
</root>
- throws
<root><error></root>
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
| Input | Type | Description | Optional |
|---|---|---|---|
| 'filter' | string | $object_id to delete | NO |
| 'type' | string | song, video, podcast_episode (object_type) | NO |
| 'client' | string | Agent string. (Default: 'AmpacheAPI') | YES |
- return
<root>
<success>
</root>
- throws
<root><error></root>
live_stream_edit
Edit a live_stream (radio station) object.
ACCESS REQUIRED: 50 (Content Manager) permission to create and edit live_streams
| Input | Type | Description | Optional |
|---|---|---|---|
| 'filter' | string | $object_id to find | NO |
| 'type' | string | song, video, podcast_episode (object_type) | NO |
| 'position' | integer | current track time in seconds | NO |
| 'client' | string | Agent string. (Default: 'AmpacheAPI') | YES |
| 'date' | integer | update time (Default: UNIXTIME()) | YES |
- return
<root>
<live_stream>
</root>
- throws
<root><error></root>
now_playing
Get what is currently being played by all users.
- return
<root>
<now_playing>
</root>
- throws
<root><error></root>
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
| Input | Type | Description | Optional |
|---|---|---|---|
| 'filter' | string | $object_id currently playing/stopping | NO |
| 'type' | string | song, video, podcast_episode (Default: song) | YES |
| 'state' | string | play, stop (Default: play) | YES |
| 'time' | integer | current play time in whole seconds (Default: 0) | YES |
| 'client' | string | agent/client name | YES |
- return
<root>
<now_playing>
</root>
- throws
<root><error></root>
playlists
This returns playlists based on the specified filter
| Input | Type | Description | Optional |
|---|---|---|---|
| 'filter' | string | Filter results to match this string | YES |
| 'hide_search' | integer | 0, 1 (if true do not include searches/smartlists in the result) | YES |
| 'show_dupes' | integer | 0, 1 (if true if true ignore 'api_hide_dupe_searches' setting) | YES |
| 'exact' | boolean | 0, 1 (if true filter is exact = rather than fuzzy LIKE) | YES |
| 'add' | set_filter | ISO 8601 Date Format (2020-09-16) Find objects with an 'add' date newer than the specified date | YES |
| 'update' | set_filter | ISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified date | YES |
| 'offset' | integer | Return results starting from this index position | YES |
| 'limit' | integer | Maximum number of results to return | YES |
| 'cond' | string | Apply additional filters to the browse using ; separated comma string pairs | YES |
| (e.g. 'filter1,value1;filter2,value2') | |||
| 'sort' | string | Sort name or comma-separated key pair. (e.g. 'name,order') | YES |
| Default order 'ASC' (e.g. 'name,ASC' == 'name') |
- return
<root>
<total_count>
<playlist>
</root>
- throws
<root><error></root>
playlist
This returns a single playlist
| Input | Type | Description | Optional |
|---|---|---|---|
| 'filter' | string | UID of playlist, returns playlist XML | NO |
- return
<root>
<total_count>
<playlist>
</root>
- throws
<root><error></root>
playlist_add
This adds a song to a playlist. setting check=1 will not add duplicates to the playlist
| Input | Type | Description | Optional |
|---|---|---|---|
| 'filter' | string | UID of Playlist | NO |
| 'id' | string | UID of the object to add to playlist | NO |
| 'type' | string | 'song', 'album', 'artist', 'playlist' | NO |
- return
<root>
<success>
</root>
- throws
<root><error></root>
playlist_add_song
This adds a song to a playlist. setting check=1 will not add duplicates to the playlist
NOTE This method is depreciated and will be removed in API7 (Use playlist_add)
| Input | Type | Description | Optional |
|---|---|---|---|
| 'filter' | string | UID of Playlist | NO |
| 'song' | string | UID of song to add to playlist | NO |
| 'check' | boolean | 0, 1 Whether to check and ignore duplicates (default = 0) | YES |
- return
<root>
<success>
</root>
- throws
<root><error></root>
playlist_create
This create a new playlist and return it
| Input | Type | Description | Optional |
|---|---|---|---|
| 'name' | string | Playlist name | NO |
| 'type' | string | public, private (Playlist type) | YES |
- return
<root>
<total_count>
<playlist>
</root>
- throws
<root><error></root>