See: https://api.thetvdb.com/swagger
Authentication is based on JSON Web Token (JWT). See:
- Michael B. Jones, John Bradley, Nat Sakimura. JSON Web Token (JWT). RFC 7797. May 2015.
- https://jwt.io/
Obtaining a JWT token for authentication:
http https://api.thetvdb.com/login apikey=<api-key> userkey=<unique-id> username=<username> -v
The identifiers to be substituted into the command above can be found here (requires login): https://www.thetvdb.com/member/api.
The message body of the response contains the token, store it in a file named TheTVDB.jwt
.
In subsequent requests, the token must be submitted in the Authorization
header field as follows:
http https://api.thetvdb.com/search/series "Authorization: Bearer $(<TheTVDB.jwt)" name=="The Big Bang Theory" -v
The token is automatically included in subsequent requests when the --session
command line option is specified:
rm -f TheTVDB.json
http --session=./TheTVDB.json https://api.thetvdb.com/search/series "Authorization: Bearer $(<TheTVDB.jwt)" name=="The Big Bang Theory" -v
cat TheTVDB.json
http --session=./TheTVDB.json https://api.thetvdb.com/search/series name=="Game of Thrones" -v
http --session=./TheTVDB.json https://api.thetvdb.com/languages
http --session=./TheTVDB.json https://api.thetvdb.com/series/80379
http --session=./TheTVDB.json https://api.thetvdb.com/series/80379/filter keys==id,seriesName,firstAired,overview
http --session=./TheTVDB.json https://api.thetvdb.com/series/80379/filter keys==id,seriesName,firstAired,overview Accept-Language:hu
http --session=./TheTVDB.json https://api.thetvdb.com/series/80379/filter keys==id,seriesName,firstAired,overview Accept-Language:fr
http --session=./TheTVDB.json https://api.thetvdb.com/series/80379/filter keys==id,seriesName,firstAired,overview Accept-Language:zh
http --session=./TheTVDB.json https://api.thetvdb.com/series/80379/actors
http --session=./TheTVDB.json https://api.thetvdb.com/series/80379/episodes/summary
http --session=./TheTVDB.json https://api.thetvdb.com/series/80379/episodes
http --session=./TheTVDB.json https://api.thetvdb.com/series/80379/episodes page==2
http --session=./TheTVDB.json https://api.thetvdb.com/series/80379/episodes page==3
http --session=./TheTVDB.json https://api.thetvdb.com/series/80379/episodes/query/params
http --session=./TheTVDB.json https://api.thetvdb.com/series/80379/episodes/query airedSeason==1
http --session=./TheTVDB.json https://api.thetvdb.com/series/80379/episodes/query airedSeason==1 airedEpisode==1
http --session=./TheTVDB.json https://api.thetvdb.com/series/80379/episodes/query airedEpisode==1
http --session=./TheTVDB.json https://api.thetvdb.com/episodes/332484
http --session=./TheTVDB.json https://api.thetvdb.com/series/80379/images
http --session=./TheTVDB.json https://api.thetvdb.com/series/80379/images/query/params
http --session=./TheTVDB.json https://api.thetvdb.com/series/80379/images/query keyType==poster
date -d 2019-09-28 +%s
http --session=./TheTVDB.json https://api.thetvdb.com/updated/query fromTime==$(date -d 2019-09-28 +%s) -v