API
client.py
- class SlskdClient(host: str, api_key: str = None, url_base: str = '/', username: str = None, password: str = None, token: str = None, verify_ssl: bool = True, timeout: float = None)
The main class that allows access to the different APIs of a slskd instance. An API-Key with appropriate permissions (readwrite for most use cases) must be set in slskd config file. Alternatively, provide your username and password. Requests error status raise corresponding error. Usage:
slskd = slskd_api.SlskdClient(host, api_key, url_base) app_status = slskd.application.state()
apis/_types.py
- class AppVersion
TypedDict describing application version. Returned by
check_updates().
- class AppState
TypedDict describing application state. Returned by
state().- version: AppVersion
- server: ServerState
- class Message
TypedDict describing a message. Element of
Conversation.
- class Conversation
TypedDict describing a conversation. Returned by
get().- messages: NotRequired[list[Message]]
- class Event
TypedDict describing an event. Single element of list returned by
get().
- class Directory
TypedDict describing a directory in the downloads or incomplete folder. See
FilesApi.- files: NotRequired[list[File]]
- directories: NotRequired[list[Directory]]
- class RoomInfo
TypedDict describing room info.
- class RoomUser
TypedDict describing a room user.
- class Room
TypedDict describing a room. Returned by
join()andget_joined().- messages: list[RoomMessage]
- class SearchFile
TypedDict describing a single search file result. Element found in
SearchResponseItem.- bitRate: NotRequired[int]
- bitDepth: NotRequired[int]
- length: NotRequired[int]
- sampleRate: NotRequired[int]
- class SearchResponseItem
TypedDict describing a search response item. Single element of list returned by
search_responses().- files: list[SearchFile]
- lockedFiles: list[SearchFile]
- class SearchState
TypedDict describing search state. Returned by
state().- endedAt: NotRequired[str]
- responses: list[SearchResponseItem]
TypedDict describing a shared directory. Returned by
get().
TypedDict describing all shares (local or from relays). Returned by
get_all().
- class TransferedFile
TypedDict describing a transfered file. Element found in
TransferedDirectory.- enqueuedAt: NotRequired[str]
- startedAt: NotRequired[str]
- endedAt: NotRequired[str]
- elapsedTime: NotRequired[str]
- remainingTime: NotRequired[str]
- class TransferedDirectory
TypedDict describing a transfered directory. Element found in
Transfer.- files: list[TransferedFile]
- class Transfer
TypedDict describing transfer(s) to/from a given user. See
TransfersApi.- directories: NotRequired[list[TransferedDirectory]]
- class BrowsingStatus
TypedDict describing browsing status of a user’s shares. Returned by
browsing_status().
- class UserInfo
TypedDict describing user info. Returned by
info().- picture: NotRequired[str]
- class FileAttribute
TypedDict describing a file attribute. Defined attributes are added as new keys to
UserFile.
- class UserFile
TypedDict describing a user file. Found in
UserDirectory.- attributes: list[FileAttribute]
- class UserDirectory
TypedDict describing a user directory either locked or not. See
UserRootDir.
apis/application.py
- class ApplicationApi(api_url: str, session: Session)
This class contains the methods to interact with the Application API.
- stop()
Stops the application. Only works with token (usr/pwd login). ‘Unauthorized’ with API-Key.
- Returns:
bool– True if successful.
- restart()
Restarts the application. Only works with token (usr/pwd login). ‘Unauthorized’ with API-Key.
- Returns:
bool– True if successful.
apis/conversations.py
- class ConversationsApi(api_url: str, session: Session)
This class contains the methods to interact with the Conversations API.
- acknowledge(username: str, id: int)
Acknowledges the given message id for the given username.
- Returns:
bool– True if successful.
- acknowledge_all(username: str)
Acknowledges all messages from the given username.
- Returns:
bool– True if successful.
- delete(username: str)
Closes the conversation associated with the given username.
- Returns:
bool– True if successful.
- get(username: str, includeMessages: bool = True)
Gets the conversation associated with the specified username.
- Return type:
- send(username: str, message: str)
Sends a private message to the specified username.
- Returns:
bool– True if successful.
apis/events.py
apis/files.py
- class FilesApi(api_url: str, session: Session)
This class contains the methods to interact with the Files API. In order to delete files/directory you need to set remoteFileManagement: true in slskd.yml.
- get_downloaded_directory(dir_name: str, recursive: bool = False)
Lists the contents of the specified subdirectory within the downloads directory.
- delete_downloaded_directory(dir_name: str)
Deletes the specified subdirectory within the downloads directory.
- Return type:
- delete_downloaded_file(file_name: str)
Deletes the specified file within the downloads directory.
- Return type:
- get_incomplete_directory(dir_name: str, recursive: bool = False)
Lists the contents of the specified subdirectory within the incomplete directory.
apis/logs.py
apis/options.py
- class OptionsApi(api_url: str, session: Session)
This class contains the methods to interact with the Options API.
- debug()
Gets the debug view of the current application options. debug and remote_configuration must be set to true. Only works with token (usr/pwd login). ‘Unauthorized’ with API-Key.
- Return type:
- yaml_location()
Gets the path of the yaml config file. remote_configuration must be set to true. Only works with token (usr/pwd login). ‘Unauthorized’ with API-Key.
- Return type:
- download_yaml()
Gets the content of the yaml config file as text. remote_configuration must be set to true. Only works with token (usr/pwd login). ‘Unauthorized’ with API-Key.
- Return type:
apis/relay.py
- class RelayApi(api_url: str, session: Session)
[UNTESTED] This class contains the methods to interact with the Relay API.
- download_file(token: str)
Downloads a file from the connected controller.
- Returns:
bool– True if successful.
- upload_file(token: str)
Uploads a file from the connected controller.
- Returns:
bool– True if successful.
Uploads share information to the connected controller.
- Returns:
bool– True if successful.
apis/rooms.py
- class RoomsApi(api_url: str, session: Session)
This class contains the methods to interact with the Rooms API.
- send(roomName: str, message: str)
Sends a message to the specified room.
- Returns:
bool– True if successful.
- set_ticker(roomName: str, ticker: str)
Sets a ticker for the specified room.
- Returns:
bool– True if successful.
- add_member(roomName: str, username: str)
Adds a member to a private room.
- Returns:
bool– True if successful.
apis/searches.py
- class SearchesApi(api_url: str, session: Session)
Class that handles operations on searches.
- search_text(searchText: str, id: str = None, fileLimit: int = 10000, filterResponses: bool = True, maximumPeerQueueLength: int = 1000000, minimumPeerUploadSpeed: int = 0, minimumResponseFileCount: int = 1, responseLimit: int = 100, searchTimeout: int = 15000)
Performs a search for the specified request.
- Parameters:
searchText (
str) – Search queryid (
str) – uuid of the search. One will be generated if None.fileLimit (
int) – Max number of file resultsfilterResponses (
bool) – Filter unreachable users from the resultsmaximumPeerQueueLength (
int) – Max queue lengthminimumPeerUploadSpeed (
int) – Min upload speed in bit/sminimumResponseFileCount (
int) – Min number of matching files per userresponseLimit (
int) – Max number of users resultssearchTimeout (
int) – Search timeout in ms
- Returns:
SearchState– Info about the search (no results!)
- get_all()
Gets the list of active and completed searches.
- Return type:
- state(id: str, includeResponses: bool = False)
Gets the state of the search corresponding to the specified id.
- Parameters:
- Returns:
SearchState– Info about the search
- stop(id: str)
Stops the search corresponding to the specified id.
- Returns:
bool– True if successful.
- delete(id: str)
Deletes the search corresponding to the specified id.
- Returns:
bool– True if successful.
- search_responses(id: str)
Gets search responses corresponding to the specified id.
- Parameters:
id (
str) – uuid of the search.- Returns:
list[SearchResponseItem] – Search responses.
apis/server.py
apis/session.py
apis/telemetry.py
- class TelemetryApi(api_url: str, session: Session)
This class contains the methods to interact with the Metrics API.
- get_transfer_summary(start: str = None, end: str = None, direction: Literal['Download', 'Upload'] = None, username: str = None)
Gets a summary of all transfer activity over the specified timeframe, grouped by direction and final state.
- get_transfer_histogram(start: str = None, end: str = None, interval: int = 60, direction: Literal['Download', 'Upload'] = None, username: str = None)
Gets a histogram of all transfer activity over the specified timeframe, aggregated into fixed size time intervals and grouped by direction and final state.
- get_transfer_leaderboard(direction: Literal['Download', 'Upload'], start: str = None, end: str = None, sortBy: Literal['Count', 'TotalBytes', 'AverageSpeed'] = 'Count', sortOrder: Literal['ASC', 'DESC'] = 'DESC', limit: int = 25, offset: int = 0)
Gets the top N user summaries by count, total bytes, or average speed.
- Parameters:
start (
str) – The start time of the window (default: oldest). e.g. “2026-01-31”end (
str) – The end time of the window (default: now). e.g. “2026-02-15”sortBy (
Literal['Count','TotalBytes','AverageSpeed']) – The property by which to sort.sortOrder (
Literal['ASC','DESC']) – The sort order.limit (
int) – The number of records to return.offset (
int) – The record offset (if paginating).
- Returns:
list– List of users (dict) with transfer related info (count, totalBytes, averageSpeed…)
- get_user_transfers(username: str, start: str = None, end: str = None)
Gets detailed transfer activity for the specified user.
- get_transfer_exceptions(direction: Literal['Download', 'Upload'], start: str = None, end: str = None, username: str = None, sortOrder: Literal['ASC', 'DESC'] = 'DESC', limit: int = 25, offset: int = 0)
Gets a list of transfer exceptions by direction.
- Parameters:
start (
str) – The start time of the window (default: oldest). e.g. “2026-01-31”end (
str) – The end time of the window (default: now). e.g. “2026-02-15”username (
str) – An optional username by which to filter exceptions.sortOrder (
Literal['ASC','DESC']) – The sort order.limit (
int) – The number of records to return.offset (
int) – The record offset (if paginating).
- Returns:
list– List of exceptions (dict) with transfer related info (direction, filename, state…)
- get_transfer_exceptions_pareto(direction: Literal['Download', 'Upload'], start: str = None, end: str = None, username: str = None, limit: int = 25, offset: int = 0)
Gets the top N exceptions by total count and direction.
- Parameters:
start (
str) – The start time of the window (default: oldest). e.g. “2026-01-31”end (
str) – The end time of the window (default: now). e.g. “2026-02-15”username (
str) – An optional username by which to filter exceptions.limit (
int) – The number of records to return.offset (
int) – The record offset (if paginating).
- Returns:
list– List of exceptions (dict) with following info: exception message, count and distinctUsers.
- get_most_dl_directories(start: str = None, end: str = None, username: str = None, limit: int = 25, offset: int = 0)
Gets the top N most frequently downloaded directories by total count and distinct users.
- Parameters:
start (
str) – The start time of the window (default: oldest). e.g. “2026-01-31”end (
str) – The end time of the window (default: now). e.g. “2026-02-15”username (
str) – An optional username by which to filter exceptions.limit (
int) – The number of records to return.offset (
int) – The record offset (if paginating).
- Returns:
list– List of directories (dict) with following info: path, count and distinctUsers.
apis/transfers.py
- class TransfersApi(api_url: str, session: Session)
This class contains the methods to interact with the Transfers API.
- cancel_download(username: str, id: str, remove: bool = False)
Cancels the specified download.
- Returns:
bool– True if successful.
- remove_completed_downloads()
Removes all completed downloads, regardless of whether they failed or succeeded.
- Returns:
bool– True if successful.
- cancel_upload(username: str, id: str, remove: bool = False)
Cancels the specified upload.
- Returns:
bool– True if successful.
- remove_completed_uploads()
Removes all completed uploads, regardless of whether they failed or succeeded.
- Returns:
bool– True if successful.
- enqueue(username: str, files: list[SearchFile])
Enqueues the specified download.
- Parameters:
username (
str) – User to download from.files (
list[SearchFile]) – A list of files that can be obtained bysearch_responses()(see key files ofSearchResponseItem).
- Returns:
bool– True if successful.
apis/users.py
- class UsersApi(api_url: str, session: Session)
This class contains the methods to interact with the Users API.
- browsing_status(username: str)
Retrieves the status of the current browse operation for the specified username, if any. Will return error 404 if called after the browsing operation has ended. Best called asynchronously while
browse()is still running.- Return type:
- directory(username: str, directory: str)
Retrieves the specified directory from the specified user. This returns a list (usually with a single element).
- Return type: