new Client(apiKey, [language])
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
apiKey |
String | ||
language |
String |
<optional> |
Methods
getActors(seriesId, [opts]) → {Promise}
Get series actors by series id.
tvdb.getActors(73255)
.then(response => { handle response })
.catch(error => { handle error });
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
seriesId |
Number | String | ||
opts |
Object |
<optional> |
additional options for request |
getEpisodeById(episodeId, [opts]) → {Promise}
Get episode by episode id.
tvdb.getEpisodeById(4768125)
.then(response => { handle response })
.catch(error => { handle error });
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
episodeId |
Number | String | ||
opts |
Object |
<optional> |
additional options for request |
getEpisodesByAirDate(seriesId, airDate, [opts]) → {Promise}
Get series episode by air date.
tvdb.getEpisodeByAirDate(153021, '2011-10-03')
.then(response => { handle response })
.catch(error => { handle error });
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
seriesId |
Number | String | ||
airDate |
String | ||
opts |
Object |
<optional> |
additional options for request |
getEpisodesBySeriesId(seriesId, [opts]) → {Promise}
Get all episodes by series id.
The opts may include the object query
with any of the parameters from the query endpoint
tvdb.getEpisodesBySeriesId(153021)
.then(response => { handle response })
.catch(error => { handle error });
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
seriesId |
Number | String | ||
opts |
Object |
<optional> |
additional options for request |
getEpisodesSummaryBySeriesId(seriesId) → {Promise}
Get episodes summary by series id.
tvdb.getEpisodesSummaryBySeriesId(153021)
.then(response => { handle response })
.catch(error => { handle error });
Parameters:
Name | Type | Description |
---|---|---|
seriesId |
Number | String |
getLanguages([opts]) → {Promise}
Get available languages useable by TheTVDB API.
tvdb.getLanguages()
.then(response => { handle response })
.catch(error => { handle error });
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
opts |
Object |
<optional> |
additional options for request |
getSeasonPosters(seriesId, season, [opts]) → {Promise}
Convenience wrapper around getSeriesImages
to only return season poster images for a series.
tvdb.getSeasonPosters(73255, 1)
.then(response => { handle response })
.catch(error => { handle error });
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
seriesId |
Number | String | ||
season |
Number | String | ||
opts |
Object |
<optional> |
additional options for request |
getSeriesAllById(seriesId, [opts]) → {Promise}
Get series and episode information by series id. Helper for calling
getSeriesById
and getEpisodesBySeriesId
at the same time.
tvdb.getSeriesAllById(73255)
.then(response => {
response; // contains series data (i.e. `id`, `seriesName`)
response.episodes; // contains an array of episodes
})
.catch(error => { handle error });
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
seriesId |
Number | String | ||
opts |
Object |
<optional> |
additional options for request |
getSeriesBanner(seriesId, [opts]) → {Promise}
Get series banner by series id.
tvdb.getSeriesBanner(73255)
.then(response => { handle response })
.catch(error => { handle error });
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
seriesId |
Number | String | ||
opts |
Object |
<optional> |
additional options for request |
getSeriesById(seriesId, [opts]) → {Promise}
Get basic series information by id.
tvdb.getSeriesById(73255)
.then(response => { handle response })
.catch(error => { handle error });
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
seriesId |
Number | String | ||
opts |
Object |
<optional> |
additional options for request |
getSeriesByImdbId(imdbId, [opts]) → {Promise}
Get basic series information by imdb id.
tvdb.getSeriesByImdbId('tt0903747')
.then(response => { handle response })
.catch(error => { handle error });
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
imdbId |
String | ||
opts |
Object |
<optional> |
additional options for request |
getSeriesByName(name, [opts]) → {Promise}
Get basic series information by name.
tvdb.getSeriesByName('Breaking Bad')
.then(response => { handle response })
.catch(error => { handle error });
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
String | ||
opts |
Object |
<optional> |
additional options for request |
getSeriesByZap2ItId(zap2ItId, [opts]) → {Promise}
Get basic series information by zap2it id.
tvdb.getSeriesByZap2ItId('EP00018693')
.then(response => { handle response })
.catch(error => { handle error });
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
zap2ItId |
String | ||
opts |
Object |
<optional> |
additional options for request |
getSeriesImages(seriesId, keyType, [opts]) → {Promise}
Get series images for a given key type.
// request only return fan art images:
tvdb.getSeriesImages(73255, 'fanart', { query: queryOptions })
.then(response => { handle response })
.catch(error => { handle error });
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
seriesId |
Number | String | ||
keyType |
String | the key type to query by |
|
opts |
Object |
<optional> |
additional options for request |
getSeriesPosters(seriesId, [opts]) → {Promise}
Convenience wrapper around getSeriesImages
to only return poster images for a series.
tvdb.getSeriesPosters(73255)
.then(response => { handle response })
.catch(error => { handle error });
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
seriesId |
Number | String | ||
opts |
Object |
<optional> |
additional options for request |
getUpdates(fromTime, [toTime], [opts]) → {Promise}
Get a list of series updated since a given unix timestamp (and, if given, between a second timestamp).
tvdb.getUpdates(1400611370, 1400621370)
.then(response => { handle response })
.catch(error => { handle error });
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
fromTime |
Number | timestamp to get series updates from |
|
toTime |
Number |
<optional> |
timestamp to get series updates to |
opts |
Object |
<optional> |
additional options for request |
sendRequest(path, [opts]) → {Promise}
Runs a get request with the given options, useful for running custom requests.
tvdb.sendRequest('custom/endpoint', { custom: 'options' })
.then(response => { handle response })
.catch(error => { handle error });
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
path |
String | path for http resource |
|
opts |
Object |
<optional> |
additional options for request |