TheTvdbApiV2 - JavaScript client for the_tvdb_api_v2 API v2 targets v1 functionality with a few minor additions. The API is accessible via https://api.thetvdb.com and provides the following REST endpoints in JSON format.
You may browse the API routes without authentication, but if you wish to send requests to the API and see response data, then you must authenticate. 1. Obtain a JWT token by POST
ing to the /login
route in the Authentication
section with your API key and credentials. 1. Paste the JWT token from the response into the "JWT Token" field at the top of the page and click the 'Add Token' button. You will now be able to use the remaining routes to send requests to the API and get a response.
Language selection is done via the Accept-Language
header. At the moment, you may only pass one language abbreviation in the header at a time. Valid language abbreviations can be found at the /languages
route..
Authentication to use the API is similar to the How-to section above. Users must POST
to the /login
route with their API key and credentials in the following format in order to obtain a JWT token. {\"apikey\":\"APIKEY\",\"username\":\"USERNAME\",\"userkey\":\"USERKEY\"}
Note that the username and key are ONLY required for the /user
routes. The user's key is labled Account Identifier
in the account section of the main site. The token is then used in all subsequent requests by providing it in the Authorization
header. The header will look like: Authorization: Bearer <yourJWTtoken>
. Currently, the token expires after 24 hours. You can GET
the /refresh_token
route to extend that expiration date.
You may request a different version of the API by including an Accept
header in your request with the following format: Accept:application/vnd.thetvdb.v$VERSION
. This documentation automatically uses the version seen at the top and bottom of the page.
This SDK is automatically generated by the Swagger Codegen project:
- API version: 2.1.2
- Package version: 2.1.2
- Build package: io.swagger.codegen.languages.JavascriptClientCodegen
For Node.js
To publish the library as a npm, please follow the procedure in "Publishing npm packages".
Then install it via:
npm install the_tvdb_api_v2 --save
If the library is hosted at a git repository, e.g. https://github.com/YOUR_USERNAME/the_tvdb_api_v2 then install it via:
npm install YOUR_USERNAME/the_tvdb_api_v2 --save
The library also works in the browser environment via npm and browserify. After following
the above steps with Node.js and installing browserify with npm install -g browserify
,
perform the following (assuming main.js is your entry file):
browserify main.js > bundle.js
Then include bundle.js in the HTML pages.
Please follow the installation instruction and execute the following JS code:
var TheTvdbApiV2 = require('the_tvdb_api_v2');
var api = new TheTvdbApiV2.AuthenticationApi()
var authenticationString = new TheTvdbApiV2.AuthenticationString(); // {AuthenticationString} JSON string containing your authentication details.
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.loginPost(authenticationString, callback);
All URIs are relative to https://api.thetvdb.com/
Class | Method | HTTP request | Description |
---|---|---|---|
TheTvdbApiV2.AuthenticationApi | loginPost | POST /login | |
TheTvdbApiV2.AuthenticationApi | refreshTokenGet | GET /refresh_token | |
TheTvdbApiV2.EpisodesApi | episodesIdGet | GET /episodes/{id} | |
TheTvdbApiV2.LanguagesApi | languagesGet | GET /languages | |
TheTvdbApiV2.LanguagesApi | languagesIdGet | GET /languages/{id} | |
TheTvdbApiV2.SearchApi | searchSeriesGet | GET /search/series | |
TheTvdbApiV2.SearchApi | searchSeriesParamsGet | GET /search/series/params | |
TheTvdbApiV2.SeriesApi | seriesIdActorsGet | GET /series/{id}/actors | |
TheTvdbApiV2.SeriesApi | seriesIdEpisodesGet | GET /series/{id}/episodes | |
TheTvdbApiV2.SeriesApi | seriesIdEpisodesQueryGet | GET /series/{id}/episodes/query | |
TheTvdbApiV2.SeriesApi | seriesIdEpisodesQueryParamsGet | GET /series/{id}/episodes/query/params | |
TheTvdbApiV2.SeriesApi | seriesIdEpisodesSummaryGet | GET /series/{id}/episodes/summary | |
TheTvdbApiV2.SeriesApi | seriesIdFilterGet | GET /series/{id}/filter | |
TheTvdbApiV2.SeriesApi | seriesIdFilterParamsGet | GET /series/{id}/filter/params | |
TheTvdbApiV2.SeriesApi | seriesIdGet | GET /series/{id} | |
TheTvdbApiV2.SeriesApi | seriesIdHead | HEAD /series/{id} | |
TheTvdbApiV2.SeriesApi | seriesIdImagesGet | GET /series/{id}/images | |
TheTvdbApiV2.SeriesApi | seriesIdImagesQueryGet | GET /series/{id}/images/query | |
TheTvdbApiV2.SeriesApi | seriesIdImagesQueryParamsGet | GET /series/{id}/images/query/params | |
TheTvdbApiV2.UpdatesApi | updatedQueryGet | GET /updated/query | |
TheTvdbApiV2.UpdatesApi | updatedQueryParamsGet | GET /updated/query/params | |
TheTvdbApiV2.UsersApi | userFavoritesGet | GET /user/favorites | |
TheTvdbApiV2.UsersApi | userFavoritesIdDelete | DELETE /user/favorites/{id} | |
TheTvdbApiV2.UsersApi | userFavoritesIdPut | PUT /user/favorites/{id} | |
TheTvdbApiV2.UsersApi | userGet | GET /user | |
TheTvdbApiV2.UsersApi | userRatingsGet | GET /user/ratings | |
TheTvdbApiV2.UsersApi | userRatingsItemTypeItemIdItemRatingPut | PUT /user/ratings/{itemType}/{itemId}/{itemRating} | |
TheTvdbApiV2.UsersApi | userRatingsQueryGet | GET /user/ratings/query | |
TheTvdbApiV2.UsersApi | userRatingsQueryParamsGet | GET /user/ratings/query/params |
- TheTvdbApiV2.Auth
- TheTvdbApiV2.AuthenticationString
- TheTvdbApiV2.BasicEpisode
- TheTvdbApiV2.Conflict
- TheTvdbApiV2.Episode
- TheTvdbApiV2.EpisodeDataQueryParams
- TheTvdbApiV2.EpisodeRecordData
- TheTvdbApiV2.FilterKeys
- TheTvdbApiV2.InlineResponse200
- TheTvdbApiV2.InlineResponse2001
- TheTvdbApiV2.InlineResponse20010
- TheTvdbApiV2.InlineResponse20010Data
- TheTvdbApiV2.InlineResponse20010RatingsInfo
- TheTvdbApiV2.InlineResponse20011
- TheTvdbApiV2.InlineResponse20011Data
- TheTvdbApiV2.InlineResponse20012
- TheTvdbApiV2.InlineResponse20012Data
- TheTvdbApiV2.InlineResponse20013
- TheTvdbApiV2.InlineResponse20013Data
- TheTvdbApiV2.InlineResponse20014
- TheTvdbApiV2.InlineResponse20014Data
- TheTvdbApiV2.InlineResponse20015
- TheTvdbApiV2.InlineResponse20015Data
- TheTvdbApiV2.InlineResponse20016
- TheTvdbApiV2.InlineResponse2001Data
- TheTvdbApiV2.InlineResponse2002
- TheTvdbApiV2.InlineResponse2003
- TheTvdbApiV2.InlineResponse2004
- TheTvdbApiV2.InlineResponse2005
- TheTvdbApiV2.InlineResponse2005Data
- TheTvdbApiV2.InlineResponse2006
- TheTvdbApiV2.InlineResponse2006Data
- TheTvdbApiV2.InlineResponse2007
- TheTvdbApiV2.InlineResponse2007Data
- TheTvdbApiV2.InlineResponse2007Links
- TheTvdbApiV2.InlineResponse2008
- TheTvdbApiV2.InlineResponse2009
- TheTvdbApiV2.InlineResponse2009Data
- TheTvdbApiV2.InlineResponse200Data
- TheTvdbApiV2.InlineResponse200Errors
- TheTvdbApiV2.InlineResponse401
- TheTvdbApiV2.InlineResponse404
- TheTvdbApiV2.InlineResponse409
- TheTvdbApiV2.JSONErrors
- TheTvdbApiV2.Language
- TheTvdbApiV2.LanguageData
- TheTvdbApiV2.Links
- TheTvdbApiV2.NotAuthorized
- TheTvdbApiV2.NotFound
- TheTvdbApiV2.Series
- TheTvdbApiV2.SeriesActors
- TheTvdbApiV2.SeriesActorsData
- TheTvdbApiV2.SeriesData
- TheTvdbApiV2.SeriesEpisodes
- TheTvdbApiV2.SeriesEpisodesQuery
- TheTvdbApiV2.SeriesEpisodesQueryParams
- TheTvdbApiV2.SeriesEpisodesSummary
- TheTvdbApiV2.SeriesImageQueryResult
- TheTvdbApiV2.SeriesImageQueryResults
- TheTvdbApiV2.SeriesImagesCount
- TheTvdbApiV2.SeriesImagesCounts
- TheTvdbApiV2.SeriesImagesQueryParam
- TheTvdbApiV2.SeriesImagesQueryParams
- TheTvdbApiV2.SeriesSearchData
- TheTvdbApiV2.Token
- TheTvdbApiV2.Update
- TheTvdbApiV2.UpdateData
- TheTvdbApiV2.UpdateDataQueryParams
- TheTvdbApiV2.User
- TheTvdbApiV2.UserData
- TheTvdbApiV2.UserFavorites
- TheTvdbApiV2.UserFavoritesData
- TheTvdbApiV2.UserRatings
- TheTvdbApiV2.UserRatingsData
- TheTvdbApiV2.UserRatingsDataNoLinks
- TheTvdbApiV2.UserRatingsQueryParams
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header