Database API
Query and modify the database.
Get tags from the database, with a value symbolizing their prevalence.
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.
Set to true to exclude namespaces configured in server settings from the results. Default behavior returns all tags.
Success response
Namespace of the tag
The tag itself
Weight of the tag in the database
GET /api/database/stats HTTP/1.1
Host: lrr.tvc-16.science
Accept: */*
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
}
]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.
Use Authorization: Bearer <base64(api_key)>
Success response
GET /api/database/backup HTTP/1.1
Host: lrr.tvc-16.science
Authorization: YOUR_API_KEY
Accept: */*
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"
]
}
]
}Queues a Minion job to generate a backup JSON file. Use the returned job ID to check progress and download the file once complete.
Use Authorization: Bearer <base64(api_key)>
Enqueued job
POST /api/database/backup HTTP/1.1
Host: lrr.tvc-16.science
Authorization: YOUR_API_KEY
Accept: */*
Enqueued job
{
"job": 42,
"operation": "queue_backup",
"success": 1
}Downloads the backup JSON file generated by a completed backup job.
Use Authorization: Bearer <base64(api_key)>
ID of the completed backup job.
Format of the returned backup. Defaults to file. json will return the backup as a JSON response.
Backup JSON file
Job not found or not completed
GET /api/database/backup/{jobid} HTTP/1.1
Host: lrr.tvc-16.science
Authorization: YOUR_API_KEY
Accept: */*
{}Clears the "New!" flag on all archives.
Use Authorization: Bearer <base64(api_key)>
Success response
Name of operation
Error message if any
Success message if any
Returns 1 if operation was successful, else 0
DELETE /api/database/isnew HTTP/1.1
Host: lrr.tvc-16.science
Authorization: YOUR_API_KEY
Accept: */*
Success response
{
"operation": "text",
"error": "text",
"successMessage": "text",
"success": 0
}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.
Use Authorization: Bearer <base64(api_key)>
Success response
Name of the operation
Returns 1 if operation successful, else 0.
Amount of unlinked DB entries that were deleted
Amount of live DB entries that got unlinked - Run Clean again to delete them.
POST /api/database/clean HTTP/1.1
Host: lrr.tvc-16.science
Authorization: YOUR_API_KEY
Accept: */*
Success response
{
"operation": "text",
"success": 0,
"deleted": 1,
"unlinked": 1
}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!
Use Authorization: Bearer <base64(api_key)>
Success response
Name of operation
Error message if any
Success message if any
Returns 1 if operation was successful, else 0
POST /api/database/drop HTTP/1.1
Host: lrr.tvc-16.science
Authorization: YOUR_API_KEY
Accept: */*
Success response
{
"operation": "text",
"error": "text",
"successMessage": "text",
"success": 0
}Last updated