For the complete documentation index, see llms.txt. This page is also available as Markdown.

Database API

Query and modify the database.

Get Statistics

get

Get tags from the database, with a value symbolizing their prevalence.

Query parameters
minweightintegerOptional

Add this parameter if you want to only get tags whose weight is at least the given minimum.
Default is 1 if not specified, to get all tags.

hide_excluded_namespacesstringOptional

Set to true to exclude namespaces configured in server settings from the results. Default behavior returns all tags.

Responses
200

Success response

application/json
namespacestring · nullableOptional

Namespace of the tag

textstringRequired

The tag itself

weightintegerOptional

Weight of the tag in the database

get/database/stats
GET /api/database/stats HTTP/1.1
Host: lrr.tvc-16.science
Accept: */*
200

Success response

[
  {
    "namespace": "character",
    "text": "jeanne alter",
    "weight": 2
  },
  {
    "namespace": "character",
    "text": "xuanzang",
    "weight": 2
  },
  {
    "namespace": "parody",
    "text": "fate grand order",
    "weight": 3
  },
  {
    "namespace": null,
    "text": "artbook",
    "weight": 3
  }
]

🔑 Get a backup JSON

get

Scans the entire database and returns a backup in JSON form. Consider using the POST variant if your database is large, as this basic GET endpoint might time out if it takes too long to generate the backup. This backup can be reimported manually through the Backup and Restore feature.

Authorizations
AuthorizationstringRequired

Use Authorization: Bearer <base64(api_key)>

Responses
200

Success response

application/json
get/database/backup
GET /api/database/backup HTTP/1.1
Host: lrr.tvc-16.science
Authorization: YOUR_API_KEY
Accept: */*
200

Success response

{
  "archives": [
    {
      "arcid": "28697b96f0ac5858be2614ed10ca47742c9522fd",
      "title": "Fate GO MEMO",
      "tags": "parody:fate grand order, group:wadamemo, artist:wada rco, artbook, full color, super:test, date_added:1553537258",
      "summary": null,
      "thumbhash": "ec2a0ca3a3da67a9390889f0910fe494241faa9a",
      "filename": "FateGOMEMO"
    },
    {
      "arcid": "d1858d5dc36925aa66be072a97817650d39de166",
      "title": "test title",
      "tags": null,
      "summary": null,
      "thumbhash": "9846bb6d62949b56545c42e88d8010446b65702e",
      "filename": "(Memes)9B789D38B0784C5FBC9D59A9F24D20F2"
    }
  ],
  "categories": [
    {
      "archives": [],
      "catid": "SET_1749925633",
      "name": "english",
      "search": "language:english"
    }
  ],
  "tankoubons": [
    {
      "tankid": "TANK_1749925516",
      "name": "sailor moon",
      "archives": [
        "28697b96f0ac5858be2614ed10ca47742c9522fd",
        "d1858d5dc36925aa66be072a97817650d39de166"
      ]
    }
  ]
}

🔑 Queue a backup job

post

Queues a Minion job to generate a backup JSON file. Use the returned job ID to check progress and download the file once complete.

Authorizations
AuthorizationstringRequired

Use Authorization: Bearer <base64(api_key)>

Responses
200

Enqueued job

application/json
operationstring · enumOptionalPossible values:
successinteger · enumOptionalPossible values:
jobintegerOptional
post/database/backup
POST /api/database/backup HTTP/1.1
Host: lrr.tvc-16.science
Authorization: YOUR_API_KEY
Accept: */*
200

Enqueued job

{
  "job": 42,
  "operation": "queue_backup",
  "success": 1
}

🔑 Download backup JSON from completed job

get

Downloads the backup JSON file generated by a completed backup job.

Authorizations
AuthorizationstringRequired

Use Authorization: Bearer <base64(api_key)>

Path parameters
jobidintegerRequired

ID of the completed backup job.

Query parameters
formatstring · enumOptional

Format of the returned backup. Defaults to file. json will return the backup as a JSON response.

Possible values:
Responses
200

Backup JSON file

application/json
objectOptional
get/database/backup/{jobid}
GET /api/database/backup/{jobid} HTTP/1.1
Host: lrr.tvc-16.science
Authorization: YOUR_API_KEY
Accept: */*
{}

🔑 Clear All "New" flags

delete

Clears the "New!" flag on all archives.

Authorizations
AuthorizationstringRequired

Use Authorization: Bearer <base64(api_key)>

Responses
200

Success response

application/json
operationstringRequired

Name of operation

errorstringOptional

Error message if any

successMessagestringOptional

Success message if any

successinteger · enumRequired

Returns 1 if operation was successful, else 0

Possible values:
delete/database/isnew
DELETE /api/database/isnew HTTP/1.1
Host: lrr.tvc-16.science
Authorization: YOUR_API_KEY
Accept: */*
200

Success response

{
  "operation": "text",
  "error": "text",
  "successMessage": "text",
  "success": 0
}

🔑 Clean the Database

post

Cleans the Database, hiding then removing entries for files that are no longer on the filesystem. Entries that are no longer on the filesystem are only unlinked at first so they don't appear in the UI -- A subsequent run of this cleanup will delete unlinked entries.

Authorizations
AuthorizationstringRequired

Use Authorization: Bearer <base64(api_key)>

Responses
200

Success response

application/json
operationstringOptional

Name of the operation

successinteger · enumOptional

Returns 1 if operation successful, else 0.

Possible values:
deletedintegerOptional

Amount of unlinked DB entries that were deleted

unlinkedintegerOptional

Amount of live DB entries that got unlinked - Run Clean again to delete them.

post/database/clean
POST /api/database/clean HTTP/1.1
Host: lrr.tvc-16.science
Authorization: YOUR_API_KEY
Accept: */*
200

Success response

{
  "operation": "text",
  "success": 0,
  "deleted": 1,
  "unlinked": 1
}

🔑 Drop the Database

post

Delete the entire database, including user preferences. This is a rather dangerous endpoint, invoking it might lock you out of the server as a client!

Authorizations
AuthorizationstringRequired

Use Authorization: Bearer <base64(api_key)>

Responses
200

Success response

application/json
operationstringRequired

Name of operation

errorstringOptional

Error message if any

successMessagestringOptional

Success message if any

successinteger · enumRequired

Returns 1 if operation was successful, else 0

Possible values:
post/database/drop
POST /api/database/drop HTTP/1.1
Host: lrr.tvc-16.science
Authorization: YOUR_API_KEY
Accept: */*
200

Success response

{
  "operation": "text",
  "error": "text",
  "successMessage": "text",
  "success": 0
}

Last updated