Skip to content

Endpoints

Endpoints can be accessed from properties whose name is the HTTP method you want to use. For more details on each endpoint, check the VNDB API documentation.

TIP

Some endpoints have a shorthand. For example, vndb.get.stats() could be written as vndb.stats().

GET /authinfo

Validates and returns information about the given API Token.

Example

ts
import { VNDB } from '@tb-dev/vndb';

const vndb = new VNDB();
const info = await vndb.get.authinfo('MY SECRET');

GET /schema

Returns a JSON object with metadata about several API objects, including enumeration values, which fields are available for querying and a list of supported external links.

GET /stats

Returns a few overall database statistics.

GET /user

Lookup users by id or username.

Example

ts
// Fetch only one user.
const user = await vndb.get.user('u2');

// Fetch many users.
const many = await vndb.get.user(['u1', 'u2', 'u3']);

GET /ulist_labels

Fetch the list labels for a certain user.

Example

ts
vndb.get.ulistLabels('u2').then((labels) => console.log(labels));

WARNING

The name of the method is not written in snake_case, as in the endpoint, but in camelCase.

POST /character

Example

ts
const query = new QueryBuilder({
  fields: ['name', 'original', 'age'],
  sort: 'name',
  results: 10
});

query.filter('search').equal.value('Ame');
const vn = await vndb.post.character(query);

POST /producer

POST /release

POST /tag

POST /trait

POST /vn

Query visual novel entries.

Example

ts
const query = new QueryBuilder();
query.filter('id').equal.value('v1194');
const vn = await vndb.post.vn(query);

PATCH /ulist/<id>

Add or update a visual novel in the user’s list. Requires the listwrite permission.

Example

ts
const vndb = new VNDB();
vndb.patch.ulist('v6540', {
  token: 'MY TOKEN',
  vote: 100,
  notes: 'Nemu best girl'
});

PATCH /rlist/<id>

Add or update a release in the user’s list. Requires the listwrite permission. All visual novels linked to the release are also added to the user’s visual novel list, if they aren’t in the list yet.

DELETE /ulist/<id>

Remove a visual novel from the user’s list. Removing a VN also removes any associated releases from the user’s list.

Example

ts
const vndb = new VNDB();
vndb.delete.ulist('v6710', {
  token: 'MY TOKEN'
});

DELETE /rlist/<id>

Remove a release from the user’s list. Removing a release does not remove the associated visual novels from the user’s visual novel list, that requires separate calls to DELETE /ulist.