Skip to content

Getting Started

Installation

Use your preferred package manager

Terminal window
npm install @untidy/thetvdb

Making your first API request

To get started, simply create an instance of the class with your API token:

import { TheTVDB } from '@untidy/thetvdb';
const client = new TheTVDB('access token');

Then, call any of the available methods to retrieve data from TheTVDB API. In this case, we retrieve specific character information:

const data = await client.characterById('64140522');
Successful response output
{
status: 'success',
data: {
id: 64140522,
name: 'Spike Spiegel',
peopleId: 7916957,
seriesId: 76885,
series: {
name: 'カウボーイビバップ',
image: 'https://artworks.thetvdb.com/https://artworks.thetvdb.com/banners/posters/76885-3.jpg',
year: '1998'
},
movie: null,
movieId: null,
episodeId: null,
type: 3,
image: 'https://artworks.thetvdb.com/banners/person/7916957/62110430.jpg',
sort: 1,
isFeatured: true,
url: 'https://thetvdb.com/people/7916957-kouichi-yamadera',
nameTranslations: [],
overviewTranslations: [],
aliases: [],
peopleType: 'Actor',
personName: 'Kouichi Yamadera',
tagOptions: [],
personImgURL: 'https://artworks.thetvdb.com/banners/v4/actor/7916957/photo/61ff8d2552665.jpg'
}
}

That’s it! You have now made your first request. For more documentation, please check the API section.