API V2 is live!

Keep out! Low flying bears!
Posts: 216
Joined: Fri Mar 26, 2010 10:17 pm

Mon Apr 04, 2016 9:11 am

We're happy to announce the general availability of the new API. This release represents a full year of development work and is a complete re-write from scratch. You can access the basic docs via swagger (https://api.thetvdb.com/swagger) and we will be working on updating the wiki over the coming weeks. Please report any issues using the forum thread (viewtopic.php?f=17&t=22325), feature suggestions should go to Trello (https://trello.com/b/3eyIsds9/api-roadmap), and a big thanks to all of the users who contributed feedback and bug reports during the development cycle!

While we don't yet have a hard sunset date for the legacy API, we do consider it deprecated and will be phasing it out in the coming months. We will announce once we have a hard sunset date so no need for panic just yet.

Implementation details for those so inclined:

The API is being served via multiple vm's (two at launch time) running our server daemon. The daemon is writen in Go and is meant to be a fully RESTful implementation with data in JSON format. Authorization still uses the site API keys but all requests are authenticated via JWT tokens after key validatation.

Database access is provided by dedicated MariaDB slave(s) and can be scaled as needed. We are still using Sphinx for the full text search but ElasticSearch may be an option in the future.

Scalability was an integral part of our design planning and both the daemon and database levels can be expanded as load increases.

Some important notes if you're running a private caching server. We now set the 'cache-control' header to 'private' with an expiry value. This means you should still be able to cache but CloudFlare and public proxies should not. We also do properly honor the 'If-Modified-Since' header so you should be able to use that along with the expiry value to only update records if they've changed.