Skip to content

API

This document describes the REST API and WebSocket protocol used by aMuTorrent.


When web UI authentication is enabled, the following authentication methods apply:

The web interface and internal APIs (Metrics, History, Config) use session-based authentication. Users must log in through the web interface to obtain a session cookie.

Protected endpoints:

  • /api/metrics/* - Metrics API
  • /api/history/* - History API
  • /api/config/* - Configuration API

WebSocket connections are also protected when authentication is enabled. The WebSocket upgrade request must include a valid session cookie (amule.sid) from an authenticated web session.

The Torznab indexer API uses API key authentication.

  • API Key: Use the same password as the web UI
  • Pass the key via the apikey query parameter

Example:

GET /indexer/amule/api?t=search&q=test&apikey=YOUR_UI_PASSWORD

When configuring in Sonarr/Radarr, enter your web UI password in the “API Key” field.

The qBittorrent-compatible API uses HTTP Basic Authentication.

  • Username: Any value (ignored)
  • Password: Same password as the web UI

When configuring the download client in Sonarr/Radarr:

  • Username: Enter any value (e.g., admin)
  • Password: Enter your web UI password

Historical metrics for speed and transfer data.

Returns speed data with different granularities based on time range.

Query Parameters:

ParameterValuesDescription
range24h, 7d, 30dTime range

Granularity:

  • 24h: 15-second buckets (~5,760 points)
  • 7d: 15-minute buckets (672 points)
  • 30d: 1-hour buckets (720 points)

Response:

{
"range": "24h",
"data": [
{
"timestamp": 1234567890000,
"uploadSpeed": 102400,
"downloadSpeed": 512000
}
]
}

Returns data transferred with time buckets.

Query Parameters:

ParameterValuesDescription
range24h, 7d, 30dTime range

Granularity:

  • 24h: 15-minute buckets (96 bars)
  • 7d: 2-hour buckets (84 bars)
  • 30d: 6-hour buckets (120 bars)

Response:

{
"range": "24h",
"data": [
{
"timestamp": 1234567890000,
"uploadSpeed": 102400,
"downloadSpeed": 512000,
"uploadedDelta": 1024000,
"downloadedDelta": 5120000
}
]
}

Returns summary statistics for a time range.

Query Parameters:

ParameterValuesDescription
range24h, 7d, 30dTime range

Response:

{
"range": "24h",
"totalUploaded": 10737418240,
"totalDownloaded": 53687091200,
"avgUploadSpeed": 124108,
"avgDownloadSpeed": 620540,
"peakUploadSpeed": 1048576,
"peakDownloadSpeed": 5242880
}

Download history tracking.

Returns paginated download history.

Query Parameters:

ParameterDefaultDescription
limit50Items per page
offset0Pagination offset
sortBystarted_atSort field
sortDirdescSort direction (asc/desc)
search-Filter by filename
status-Filter by status

Response:

{
"entries": [
{
"hash": "abc123...",
"filename": "file.mkv",
"size": 1073741824,
"status": "completed",
"started_at": "2024-01-15T10:00:00Z",
"completed_at": "2024-01-15T12:00:00Z",
"username": "user1"
}
],
"total": 150,
"trackUsername": true
}

Deletes a history entry by file hash.


Torznab-compatible API for Sonarr/Radarr integration.

Returns indexer capabilities.

Response: XML with supported categories and search capabilities.

Performs an ED2K search.

Query Parameters:

ParameterDescription
qSearch query
catCategory filter (optional)
limitMax results
offsetPagination offset

Response: XML in Torznab format with search results.


qBittorrent Web API v2 compatible endpoints for *arr integration.

Returns application version.

Response: v4.5.0

Returns Web API version.

Response: 2.8.3

Lists current downloads.

Query Parameters:

ParameterDescription
filterFilter by status (all, downloading, completed, etc.)
categoryFilter by category
hashesFilter by specific hashes

Response:

[
{
"hash": "abc123...",
"name": "file.mkv",
"size": 1073741824,
"progress": 0.75,
"dlspeed": 512000,
"upspeed": 102400,
"state": "downloading",
"category": "sonarr",
"content_path": "/downloads/sonarr/file.mkv",
"save_path": "/downloads/sonarr"
}
]

Adds a download from ED2K link.

Form Data:

FieldDescription
urlsED2K link(s), one per line
categoryCategory name

Pauses download(s).

Form Data:

FieldDescription
hashesHash(es) to pause, all for all

Resumes download(s).

Form Data:

FieldDescription
hashesHash(es) to resume, all for all

Deletes download(s).

Form Data:

FieldDescription
hashesHash(es) to delete
deleteFilestrue to also delete files

Returns configured categories.

Response:

{
"sonarr": {
"name": "sonarr",
"savePath": "/downloads/sonarr"
},
"radarr": {
"name": "radarr",
"savePath": "/downloads/radarr"
}
}

The server exposes a WebSocket endpoint at ws://HOST:PORT for real-time communication.

All messages are JSON objects with an action field.

{ "action": "search", "query": "file name", "type": "global" }
{ "action": "getDownloads" }
{ "action": "pauseDownload", "fileHash": "..." }
{ "action": "resumeDownload", "fileHash": "..." }
{ "action": "delete", "fileHash": "..." }
{ "action": "download", "fileHash": "..." }
{ "action": "getUploadingQueue" }
{ "action": "getShared" }
{ "action": "reloadSharedFiles" }
{ "action": "getStats" }
{ "action": "getStatsTree" }
{ "action": "getServers" }
{ "action": "connectServer", "serverAddress": "ip:port" }
{ "action": "disconnectServer" }
{ "action": "removeServer", "serverAddress": "ip:port" }
{ "action": "getLog" }
{ "action": "getServerInfo" }
{ "action": "getCategories" }
{ "action": "createCategory", "category": { "title": "...", "path": "...", "color": 0xCCCCCC, "priority": 0 } }
{ "action": "updateCategory", "id": 1, "category": { ... } }
{ "action": "deleteCategory", "id": 1 }
{ "action": "setFileCategory", "fileHash": "...", "categoryId": 1 }
{ "action": "addEd2kLink", "link": "ed2k://...", "categoryId": 0 }

All messages are JSON objects with a type field.

{ "type": "search-results", "data": [...] }
{ "type": "downloads-update", "data": [...] }
{ "type": "uploads-update", "data": [...] }
{ "type": "stats-update", "data": { ... } }
{ "type": "shared-update", "data": [...] }
{ "type": "servers-update", "data": [...] }
{ "type": "categories-update", "data": [...] }
{ "type": "log-update", "data": [...] }
{ "type": "serverinfo-update", "data": [...] }
{ "type": "error", "message": "Error description" }
{ "type": "connection-status", "connected": true }