31 KiB
Tranga API Calls v2
This document outlines all different HTTP API calls that Tranga accepts. Tranga expects specific HTTP methods for its calls and therefore careful attention must be paid when making them.
apiUri
refers to your http(s)://TRANGA.FRONTEND.URI/api
.
Parameters are included in the HTTP request URI and/or the request body. The request Body is in JSON key-value-pair format, with all values as strings. Tranga responses are always in the JSON format within the Response Body.
Parameters in italics are optional
Quick Entry
Connectors ^top
/v2/Connector/Types
Returns available Manga Connectors (Scanlation sites)
Returns
List of Connectors
/v2/Connector/<ConnectorName>/GetManga
Returns the Manga from the specified Manga Connector.
Request
ConnectorName
is returned in the response of GET /v2/Connector/Types
Use either title
or url
Parameter.
Parameter | Value |
---|---|
title | Search Term |
url | Direct link (URL) to the Manga on the used Site |
Manga ^top
/v2/Mangas
Returns all known Manga.
Returns
List of internalIds.
/v2/Manga/Search
Initiates a search for a Manga on all Connectors.
Request
Parameter | Value |
---|---|
title | Search Term |
/v2/Manga/<internalId>
Returns the specified Manga.
Request
internalId
is returned in the response of
/v2/Manga/
Returns the list of Mangas requested.
Request
Parameter | Value |
---|---|
mangaIds | Comma-Seperated list of internalId |
internalId
is returned in the response of
Returns
List of Manga
StatusCode | Meaning |
---|---|
400 | Missing Parameter |
404 | Manga with internalId could not be found |
/v2/Manga/<internalId>
Deletes all associated Jobs for the specified Manga
Request
internalId
is returned in the response of
/v2/Manga/<internalId>/Cover
Returns the URL for the Cover of the specified Manga.
Request
internalId
is returned in the response of
Optional: dimensions=<width>x<height>
replace width and height with requested dimensions in pixels.
Fitting will cover requested area.
Returns
String with the url.
If dimensions=x
was not requested, returns full sized image.
StatusCode | Meaning |
---|---|
404 | Manga with internalId could not be found |
/v2/Manga/<internalId>/Chapters
Returns the Chapter-list for the specified Manga.
Request
internalId
is returned in the response of
Parameter | Value |
---|---|
language | Language to search for |
/v2/Manga/<internalId>/Chapters/latest
Returns the latest Chapter of the specified Manga.
Request
internalId
is returned in the response of
/v2/Manga/<internalId>/ignoreChaptersBelow
Request
internalId
is returned in the response of
Parameter | Value |
---|---|
startChapter | Chapter-number to start at |
Returns
StatusCode | Meaning |
---|---|
404 | Manga with internalId could not be found |
500 | Parsing Error |
/v2/Manga/<internalId>/moveFolder
Request
internalId
is returned in the response of
Parameter | Value |
---|---|
location | New location (relative to root dir) |
Returns
StatusCode | Meaning |
---|---|
400 | Parameter missing |
404 | Manga with internalId could not be found |
Jobs ^top
/v2/Jobs
Returns all configured Jobs as IDs.
Returns
List of JobIds.
/v2/Jobs/Running
Returns all Running Jobs as IDs.
Returns
List of JobIds.
/v2/Jobs/Waiting
Returns all Waiting Jobs as IDs.
Returns
List of JobIds.
/v2/Jobs/Standby
Returns all Standby Jobs as IDs.
Returns
List of JobIds.
/v2/Jobs/Monitoring
Returns all Monitoring Jobs as IDs.
Returns
List of JobIds.
/v2/Job/Types
Returns the valid Job-Types.
Returns
List of strings.
/v2/Job/Create/<Type>
Creates a Job.
Request
Type
is returned in the response of GET /v2/Job/Types
Parameter | Value |
---|---|
internalId | Manga ID |
customFolder | Custom folder location Only for MonitorManga, DownloadNewChapters and DownloadChapter |
startChapter | Chapter to start downloading at Only for MonitorManga, DownloadNewChapters |
interval | Interval at which the Job is re-run in HH:MM:SS format Only for MonitorManga, UpdateMetadata |
language | Translated language Only for MonitorManga, DownloadNewChapters and DownloadChapter |
internalId
is returned in the response of
Returns
StatusCode | Meaning |
---|---|
200 | Job created. |
404 | Parameter missing or could not be found. |
409 | Job already exists |
500 | Error parsing interval |
/v2/Job/
Returns the list of Jobs requested.
Request
Parameter | Value |
---|---|
jobIds | Comma-Seperated list of jobIds |
jobId
is returned in the response of
/v2/Job/<jobId>
Returns the specified Job.
Request
jobId
is returned in the response of
/v2/Job/<jobId>
Deletes the specified Job and all descendants.
Request
jobId
is returned in the response of
Returns
StatusCode | Meaning |
---|---|
200 | Job deleted |
404 | Manga with jobId could not be found |
/v2/Job/<jobId>/Progress
Returns the progress the of the specified Job.
Request
jobId
is returned in the response of
/v2/Job/<jobId>/StartNow
Starts the specified Job.
Request
jobId
is returned in the response of
Returns
StatusCode | Meaning |
---|---|
200 | Job started |
404 | Manga with jobId could not be found |
/v2/Job/<jobId>/Cancel
Cancels the specified Job, or dequeues it.
Request
jobId
is returned in the response of
Returns
StatusCode | Meaning |
---|---|
200 | Job cancelled |
404 | Manga with jobId could not be found |
/v2/Job/<jobId>/SetInterval
NOT YET IMPLEMENTED
Edits the specified Job.
Request
jobId
is returned in the response of
Returns
StatusCode | Meaning |
---|---|
404 | Manga with jobId could not be found |
Settings ^top
/v2/Settings
Returns the settings.json
file.
Returns
/v2/Settings/UserAgent
Returns the current User Agent used for Requests.
Returns
/v2/Settings/UserAgent
Sets the User Agent. If left empty, User Agent is reset to default.
Request
Parameter | Value |
---|---|
value | New UserAgent |
Returns
StatusCode | Meaning |
---|---|
202 | UserAgent Reset |
201 | UserAgent Updated |
/v2/Settings/RateLimit/Types
Returns the configurable Rate-Limits.
Returns
Key-Value-Pairs of Values and RateLimit-Names.
/v2/Settings/RateLimit
Returns the current configuration of Rate-Limits for Requests.
Returns
Dictionary of Rate-Limits
and Requests per Minute
/v2/Settings/RateLimit
Sets the Rate-Limits for all Requests. If left empty, resets to default Rate-Limits.
Request
For each Rate-Limit set as follows:
Parameter | Value |
---|---|
Type | Requests per Minute |
Type
is returned by GET /v2/Settings/RateLimit/Types and should be supplied as string
Returns
StatusCode | Meaning |
---|---|
500 | Error parsing RequestType or RequestsPerMinute |
/v2/Settings/RateLimit/<Type>
Returns the current Rate-Limit for the Request-Type.
Request
Type
is returned by GET /v2/Settings/RateLimit/Types
Returns
Integer with Requests per Minute.
StatusCode | Meaning |
---|---|
404 | Error parsing RequestType |
/v2/Settings/RateLimit/<Type>
Sets the Rate-Limit for the Request-Type in Requests per Minute.
Request
Type
is returned by GET /v2/Settings/RateLimit/Types
Parameter | Value |
---|---|
value | Requests per Minute |
Returns
StatusCode | Meaning |
---|---|
404 | Rate-Limit-Name does not exist |
500 | Parsing Error |
/v2/Settings/AprilFoolsMode
Returns the current state of the April-Fools-Mode setting.
Returns
Boolean
/v2/Settings/AprilFoolsMode
Enables/Disables April-Fools-Mode.
Request
Parameter | Value |
---|---|
value | true/false |
Returns
StatusCode | Meaning |
---|---|
500 | Parsing Error |
/v2/Settings/CompressImages
Returns the current state of the Image-compression setting.
Returns
number
/v2/Settings/CompressImages
Set the quality of the compression.
Request
Parameter | Value |
---|---|
value | 1-100 |
Returns
StatusCode | Meaning |
---|---|
500 | Parsing Error |
/v2/Settings/BWImages
Returns the current state of the Black/White Image setting.
Returns
Boolean
/v2/Settings/BWImages
Enables/Disables converting Images to Black and White.
Request
Parameter | Value |
---|---|
value | true/false |
Returns
StatusCode | Meaning |
---|---|
500 | Parsing Error |
/v2/Settings/DownloadLocation
Updates the default Download-Location.
Request
Parameter | Value |
---|---|
location | New Folder-Path |
moveFiles | true/false |
Returns
StatusCode | Meaning |
---|---|
200 | Successfully changed |
404 | Parameter 'location' is missing |
500 | Parsing Error |
Library Connectors ^top
/v2/LibraryConnector
Returns the configured Library-Connectors.
Returns
List of LibraryConnectors
/v2/LibraryConnector/Types
Returns the available Library-Connector types.
Returns
List of String of Names.
/v2/LibraryConnector/<Type>
Returns the Library-Connector for the specified Type.
Request
Type
is returned by GET /v2/LibraryConnector/Types
/v2/LibraryConnector/<Type>
Creates a Library-Connector of the specified Type.
Request
Type
is returned by GET /v2/LibraryConnector/Types
Parameter | Value |
---|---|
url | URL of the Library |
username | Username |
password | Password |
Returns
StatusCode | Meaning |
---|---|
404 | Library Connector does not exist |
406 | Missing Parameter |
500 | Parsing Error |
/v2/LibraryConnector/<Type>/Test
Tests a Library-Connector of the specified Type.
Request
Type
is returned by GET /v2/LibraryConnector/Types
Parameter | Value |
---|---|
url | URL of the Library |
username | Username |
password | Password |
Returns
StatusCode | Meaning |
---|---|
200 | Test successful |
404 | Library Connector does not exist |
406 | Missing Parameter |
424 | Test failed |
500 | Parsing Error |
/v2/LibraryConnector/<Type>
Deletes the Library-Connector of the specified Type.
Request
Type
is returned by GET /v2/LibraryConnector/Types
Returns
StatusCode | Meaning |
---|---|
200 | Deleted |
404 | Library Connector Type does not exist |
Notification Connectors ^top
/v2/NotificationConnector
Returns the configured Notification-Connectors.
Returns
List of NotificationConnectors
/v2/NotificationConnector/Types
Returns the available Notification-Connectors.
Returns
List of String of Names.
/v2/NotificationConnector/<Type>
Returns the configured Notification-Connector of the specified Type.
Request
Type
is returned by GET /v2/NotificationConnector/Types
Returns
StatusCode | Meaning |
---|---|
404 | Library Connector Type does not exist |
500 | Parsing Error |
/v2/NotificationConnector/<Type>
Creates a Notification-Connector of the specified Type.
Request
Type
is returned by GET /v2/NotificationConnector/Types
Type specific Parameters (must be included for each)
- Gotify
Parameter | Value |
---|---|
url | URL of the Gotify Instance |
appToken | AppToken of the configured Gotify App |
- LunaSea
Parameter | Value |
---|---|
webhook | LunaSea Webhook |
- Nty
Parameter | Value |
---|---|
url | URL of the Ntfy Instance |
username | Username |
password | Password |
Returns
StatusCode | Meaning |
---|---|
404 | Notification Connector Type does not exist |
406 | Missing Parameter |
500 | Parsing Error |
/v2/NotificationConnector/<Type>/Test
Tests a Notification-Connector of the specified Type.
Request
Type
is returned by GET /v2/NotificationConnector/Types
Type specific Parameters (must be included for each)
- Gotify
Parameter | Value |
---|---|
url | URL of the Gotify Instance |
appToken | AppToken of the configured Gotify App |
- LunaSea
Parameter | Value |
---|---|
webhook | LunaSea Webhook |
- Ntfy
Parameter | Value |
---|---|
url | URL of the Ntfy Instance |
username | Username |
password | Password |
Returns
StatusCode | Meaning |
---|---|
200 | Test successful |
404 | Notification Connector Type does not exist |
406 | Missing Parameter |
500 | Parsing Error |
/v2/NotificationConnector/<Type>
Deletes the Notification-Connector of the specified Type.
Request
Type
is returned by GET /v2/NotificationConnector/Types
Returns
StatusCode | Meaning |
---|---|
200 | Deleted |
404 | Notification Connector Type does not exist |
Miscellaneous ^top
/v2/LogFile
Returns the current log-file.
Returns
The Logfile as Stream.
StatusCode | Meaning |
---|---|
404 | No Logfile |
/v2/Ping
Pong!
/v2/Ping
Pong!