API V2.x Discussion

A place for developers to advertise their TheTVDB.com enabled app and get help from other developers with the API.
Forum rules
This forum is now read-only. Support for TheTVDB.com is now available at https://support.thetvdb.com/

Tue Aug 08, 2017 8:20 am

mlaggner wrote:according to the docs at https://api.thetvdb.com/swagger#!/Serie ... ages_query there should be a languageId in the image response, but unfortunately I cannot find this tag in my test cases

https://api.thetvdb.com/series/83462/im ... ype=poster

Code: Select all

data": [
      "id": 42756,
      "keyType": "poster",
      "subKey": "",
      "fileName": "posters/83462-1.jpg",
      "resolution": "680x1000",
      "ratingsInfo": {
        "average": 4.4,
        "count": 17
      "thumbnail": "_cache/posters/83462-1.jpg"
    }, ...
There's also no way to retrieve a full list of images of all languages. If you don't set it it falls back to english leaving out localized ones

Wed Aug 16, 2017 4:15 pm

Not sure if I have found some bugs (or I'm doing something really, really wrong), but when when using Swagger to generate a Go language client I encountered some problems.

First, in the "Series" object, "seriesId" is defined to type "integer" in the swagger.json. However, the server API responds with a string. In fact, all other objects with a "seriesId" item are defined as type "string". I suspect this should be changed in the "Series" object.

Second, the "/search/series" GET call is supposed to return an array of results. The problem is that the 200 response only returns a single instance of a "SeriesSearchData" object. I suspect the correct thing to do is the "/search/series" 200 response should instead return a "SeriesSearchResult" that is defined as an array of "SeriesSearchData" objects.

I have made changes to the swagger.json locally which results in a working client (in my limited testing).

Finally, I looked at Trello, but I can't figure out how the heck to do anything there. Is there a more proper way to file a bug report?


Wed Aug 16, 2017 7:49 pm

Unsure if I am using the api incorrectly, but on Swagger /updates always yields

Code: Select all

{ data: null }
no matter the time I give it. Here are some times I tried:

Code: Select all

// attempted Aug 8 - Aug 15
fromTime: 1502246395828
toTime: 1502851226685
// attempted just Aug 8
fromTime: 1502246395828
// attempted utc time Aug 8 - Aug 15
fromTime: 1502246719919
toTime: 1502851554244
I can use /search properly so I know my token is working

Wed Aug 16, 2017 8:49 pm

andykais wrote:

Code: Select all

// attempted Aug 8 - Aug 15
fromTime: 1502246395828
toTime: 1502851226685
You are using epoch time with milliseconds. Drop the last 3 digits. ;-)

Wed Aug 23, 2017 9:32 pm

Yes! It works now, thanks @patsoffice
Posts: 27
Joined: Wed Mar 11, 2015 9:47 am

Sun Aug 27, 2017 9:25 am

I wonder what is used to determine if the lastUpdated field should be updated... Does this include data such as imdbId, and siteRatingCount (which are only available if you query /episode/{id})?

The app I'm developing also stored the IMDb ID, as well as the ratings given on theTVDb (using v1 of the API), but given that those fields are not present when you query the episodes of a show (that only returns a BasicEpisode), it'd mean I have to send another request per episode for that series...
Posts: 30
Joined: Sun Jun 02, 2013 6:36 pm

Mon Sep 04, 2017 4:26 pm

Not sure if bugs are supposed to be here or in Trello, but I can't add a card in Trello anyways.
If one asks for images for a season that don't exist, instead of getting an expected 404, one gets a 500, internal server error. Seasonwide works correctly.

https://api.thetvdb.com/series/330415/i ... n&subKey=1
Posts: 32
Joined: Thu Jan 07, 2010 2:16 pm

Wed Sep 13, 2017 1:52 pm

So I have major reservations with API V2 in regards to getting all episode data for a series.
Speed of getting complete episode information for all episodes associated with a series is horrendous, and amounts to serious performance issues versus current (but to be depreciated) api V1.

Here's my example.
User wishes to populate their database with all the episodes of say CSI: Crime Scene Investigation
There are 337 episodes.

In API V1, we would download the series XML file (for this volume of episode) in under 10 seconds. One API request.
This has complete Series information, as well as complete episode information.
We then pass this file locally, populating the episode information. And make One download request per episode matched to download the episode thumbnail.
Total 1 api requests, and 337 image calls.

In API V2,
We query the series: 1 api call.
Populate the episodes. Now here the episodes are given in pages of 100 episodes, that's four api calls. Total time approx 3 seconds.
Then we need to populate all episode details. 337 api calls. (each api call is taking just under half a second) Total time approx 98 seconds.
And download the episode thumbnails. 337 image calls
Total 342 api calls, and 337 image calls.

My questions is: If we populate the series with episodes:
get /series/{id}/episodes
can we not specify to load all episode details at that time, instead of having to call
get /episodes/{id}

In regards to performance, my application can probably be improved to cut down the time.
But, 1 api call, over 342 can not be better on your server.

The above example for CSI was actually performed by myself, and while populating a whole series is not a regular occurrence, it does happen. And whole seasons would be quite often. Followed by single episode very often.
Posts: 23
Joined: Sat Mar 14, 2015 2:49 am

Fri Sep 15, 2017 1:59 am

I completely agree with jphoenix!
Posts: 6
Joined: Wed Jan 06, 2010 10:04 am

Fri Sep 15, 2017 12:21 pm

Hello, any reason for having additional root "data" object for most of json responses instead of actual data?