The API is still pretty new and needs some serious cleaning up on the backend but should be reasonably functional. There are no error codes yet.
The API endpoint is http://ip:port + HTTP_ROOT + /api?apikey=$apikey&cmd=$command
Data response in JSON formatted. If executing a command like "delArtist" or "addArtist" you'll get back an "OK", else, you'll get the data you requested.
Fetch data from index page. Returns: ArtistName, ArtistSortName, ArtistID, Status, DateAdded, [LatestAlbum, ReleaseDate, AlbumID], HaveTracks, TotalTracks, IncludeExtras, LastUpdated, [ArtworkURL, ThumbURL]: a remote url to the artwork/thumbnail.
To get the cached image path, see getArtistArt command. ThumbURL is added/updated when an artist is added/updated. If your using the database method to get the artwork, it's more reliable to use the ThumbURL than the ArtworkURL)
Fetch artist data. returns the artist object (see above) and album info: Status, AlbumASIN, DateAdded, AlbumTitle, ArtistName, ReleaseDate, AlbumID, ArtistID, Type, ArtworkURL: hosted image path. For cached image, see getAlbumArt command)
Fetch data from album page. Returns the album object, a description object and a tracks object. Tracks contain: AlbumASIN, AlbumTitle, TrackID, Format, TrackDuration (ms), ArtistName, TrackTitle, AlbumID, ArtistID, Location, TrackNumber, CleanName (stripped of punctuation /styling), BitRate)
Returns: Status, AlbumASIN, DateAdded, AlbumTitle, ArtistName, ReleaseDate, AlbumID, ArtistID, Type
Returns: Status, AlbumASIN, DateAdded, AlbumTitle, ArtistName, ReleaseDate, AlbumID, ArtistID, Type
Returns similar artists - with a higher "Count" being more likely to be similar. Returns: Count, ArtistName, ArtistID
Returns: Status, DateAdded, Title, URL (nzb), FolderName, AlbumID, Size (bytes)
Not working yet
Perform artist query on musicbrainz. Returns: url, score, name, uniquename (contains disambiguation info), id)
Perform album query on musicbrainz. Returns: title, url (artist), id (artist), albumurl, albumid, score, uniquename (artist - with disambiguation)
Add an artist to the db by artistid)
Add an album to the db by album release id
Delete artist from db by artistid)
Pause an artist in db)
Resume an artist in db)
Refresh info for artist in db from musicbrainz
Mark an album as wanted and start the searcher. Optional paramters: 'new' looks for new versions, 'lossless' looks only for lossless versions
Unmark album as wanted / i.e. mark as skipped
force search for wanted albums - not launched in a separate thread so it may take a bit to complete
Force post process albums in download directory - also not launched in a separate thread
force Active Artist Update - also not launched in a separate thread
Returns some version information: git_path, install_type, current_version, installed_version, commits_behind
Updates the version information above and returns getVersion data
Shut down headphones
Restart headphones
Update headphones - you may want to check the install type in get version and not allow this if type==exe
Returns either a relative path to the cached image, or a remote url if the image can't be saved to the cache dir
getAlbumArt&id=$albumid see above
Returns Summary and Content, both formatted in html.
See above, returns Summary and Content.
Returns either a relative path to the cached thumbnail artist image, or an http:// address if the cache dir can't be written to.
See above.
Gives you a list of results from searcher.searchforalbum(). Basically runs a normal search, but rather than sorting them and downloading the best result, it dumps the data, which you can then pass on to download_specific_release(). Returns a list of dictionaries with params: title, size, url, provider & kind - all of these values must be passed back to download_specific_release
Allows you to manually pass a choose_specific_download release back to searcher.send_to_downloader()