Skip to content

Trakt API API

by trakt.tv

OAuthHTTPSGeocoding
Open documentation ↗

Overview

At Trakt, we collect lots of interesting information about what tv shows and movies everyone is watching. Part of the fun with such data is making it available for anyone to mash up and use on their own site or app. The Trakt API was made just for this purpose. It is very easy to use, you basically call a URL and get some JSON back. More complex API calls (such as adding a movie or show to your collection) involve sending us data. These are still easy to use, you simply POST some JSON data to a specific URL. Make sure to check out the [**Required Headers**](#introduction/required-headers) and [**Authentication**](#reference/authentication-oauth) sections for more info on what needs to be sent with each API call. Also check out the [**Terminology**](#introduction/terminology) section insight into the features Trakt supports. # Create an App To use the Trakt API, you'll need to [**create a new API app**](https://trakt.tv/oauth/applications/new). # Stay Connected API discussion and bugs should be posted in the [**GitHub Developer Forum**](https://github.com/trakt/api-help/issues) and *watch* the repository if you'd like to get notifications. Make sure to follow our [**API Blog**](https://apiblog.trakt.tv) and [**@traktapi on Twitter**](https://twitter.com/traktapi) too. # API URL The API should always be accessed over SSL. ``` https://api.trakt.tv ``` If you would like to use our sandbox environment to not fill production with test data, use this URL over SSL. **Note:** Staging is a completely separate environment, so you'll need to [**create a new API app on staging**](https://staging.trakt.tv/oauth/applications/new). ``` https://api-staging.trakt.tv ``` # Verbs The API uses restful verbs. | Verb | Description | |---|---| | `GET` | Select one or more items. Success returns `200` status code. | | `POST` | Create a new item. Success returns `201` status code. | | `PUT` | Update an item. Success returns `200` status code. | | `DELETE` | Delete an item. Success returns `200` or `204` status code. | # Status Codes The API will respond with one of the following HTTP status codes. | Code | Description | |---|---| | `200` | Success | `201` | Success - *new resource created (POST)* | `204` | Success - *no content to return (DELETE)* | `400` | Bad Request - *request couldn't be parsed* | `401` | Unauthorized - *OAuth must be provided* | `403` | Forbidden - *invalid API key or unapproved app* | `404` | Not Found - *method exists, but no record found* | `405` | Method Not Found - *method doesn't exist* | `409` | Conflict - *resource already created* | `412` | Precondition Failed - *use application/json content type* | `420` | Account Limit Exceeded - *list count, item count, etc* | `422` | Unprocessable Entity - *validation errors* | `423` | Locked User Account - *have the user contact support* | `426` | VIP Only - *user must upgrade to VIP* | `429` | Rate Limit Exceeded | `500` | Server Error - *please open a support ticket* | `502` | Service Unavailable - *server overloaded (try again in 30s)* | `503` | Service Unavailable - *server overloaded (try again in 30s)* | `504` | Service Unavailable - *server overloaded (try again in 30s)* | `520` | Service Unavailable - *Cloudflare error* | `521` | Service Unavailable - *Cloudflare error* | `522` | Service Unavailable - *Cloudflare error* # Required Headers You'll need to send some headers when making API calls to identify your application, set the version and set the content type to JSON. | Header | Value | |---|---| | `Content-type` <span style="color:red;">*</a> | `application/json` | | `trakt-api-key` <span style="color:red;">*</a> | Your `client_id` listed under your Trakt applications. | | `trakt-api-version` <span style="color:red;">*</a> | `2` | API version to use. All `POST`, `PUT`, and `DELETE` methods require a valid OAuth `access_token`. Some `GET` calls require OAuth and others will return user specific data if OAuth is sent. Methods that &#128274; **require** or have &#128275; **o

Trakt API is a geocoding API from trakt.tv. Requests are authenticated with OAuth. It is served over HTTPS. Its OpenAPI description documents 183 endpoints.

At a glance

Authentication
OAuth
HTTPS
Yes
CORS
Unknown
Category
Geocoding
Base URL
https://api.trakt.tv
Version
1.0.0
Endpoints
183
Spec updated
2023-03-04

Make a first request

Replace the placeholders; the documentation says exactly where credentials go.

cURL
curl -X GET "https://api.trakt.tv/lists/popular" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN"
JavaScript
const response = await fetch("https://api.trakt.tv/lists/popular", {
  method: "GET",
  headers: {
    "Accept": "application/json",
    "Authorization": "Bearer YOUR_TOKEN",
  },
});
const data = await response.json();
console.log(data);
Python
import requests

response = requests.request(
    "GET",
    "https://api.trakt.tv/lists/popular",
    headers={
    "Accept": "application/json",
    "Authorization": "Bearer YOUR_TOKEN",
    },
    timeout=30,
)
print(response.json())

Endpoints

MethodPathWhat it does
GET/calendars/all/dvd/{start_date}/{days}Get DVD releases
GET/calendars/all/movies/{start_date}/{days}Get movies
GET/calendars/all/shows/new/{start_date}/{days}Get new shows
GET/calendars/all/shows/premieres/{start_date}/{days}Get season premieres
GET/calendars/all/shows/{start_date}/{days}Get shows
GET/calendars/my/dvd/{start_date}/{days}Get DVD releases
GET/calendars/my/movies/{start_date}/{days}Get movies
GET/calendars/my/shows/new/{start_date}/{days}Get new shows
GET/calendars/my/shows/premieres/{start_date}/{days}Get season premieres
GET/calendars/my/shows/{start_date}/{days}Get shows
GET/certifications/{type}Get certifications
POST/checkinCheck into an item
DELETE/checkinDelete any active checkins
POST/commentsPost a comment
GET/comments/recent/{comment_type}/{type}Get recently created comments
GET/comments/trending/{comment_type}/{type}Get trending comments
GET/comments/updates/{comment_type}/{type}Get recently updated comments
GET/comments/{id}Get a comment or reply
PUT/comments/{id}Update a comment or reply
DELETE/comments/{id}Delete a comment or reply
GET/comments/{id}/itemGet the attached media item
POST/comments/{id}/likeLike a comment
DELETE/comments/{id}/likeRemove like on a comment
GET/comments/{id}/likesGet all users who liked a comment
GET/comments/{id}/repliesGet replies for a comment
POST/comments/{id}/repliesPost a reply for a comment
GET/countries/{type}Get countries
GET/genres/{type}Get genres
GET/languages/{type}Get languages
GET/lists/popularGet popular lists
GET/lists/trendingGet trending lists
GET/lists/{id}Get list
GET/lists/{id}/comments/{sort}Get all list comments
GET/lists/{id}/items/{type}Get items on a list
GET/lists/{id}/likesGet all users who liked a list
GET/movies/anticipatedGet the most anticipated movies
GET/movies/boxofficeGet the weekend box office
GET/movies/collected/{period}Get the most Collected movies
GET/movies/played/{period}Get the most played movies
GET/movies/popularGet popular movies
GET/movies/recommended/{period}Get the most recommended movies
GET/movies/trendingGet trending movies
GET/movies/updates/id/{start_date}Get recently updated movie Trakt IDs
GET/movies/updates/{start_date}Get recently updated movies
GET/movies/watched/{period}Get the most watched movies
GET/movies/{id}Get a movie
GET/movies/{id}/aliasesGet all movie aliases
GET/movies/{id}/comments/{sort}Get all movie comments
GET/movies/{id}/lists/{type}/{sort}Get lists containing this movie
GET/movies/{id}/peopleGet all people for a movie
GET/movies/{id}/ratingsGet movie ratings
GET/movies/{id}/relatedGet related movies
GET/movies/{id}/releases/{country}Get all movie releases
GET/movies/{id}/statsGet movie stats
GET/movies/{id}/studiosGet movie studios
GET/movies/{id}/translations/{language}Get all movie translations
GET/movies/{id}/watchingGet users watching right now
GET/networksGet networks
GET/oauth/authorizeAuthorize Application
POST/oauth/device/codeGenerate new device codes
POST/oauth/device/tokenPoll for the access_token
POST/oauth/revokeRevoke an access_token
POST/oauth/tokenExchange refresh_token for access_token
GET/people/updates/id/{start_date}Get recently updated people Trakt IDs
GET/people/updates/{start_date}Get recently updated people
GET/people/{id}Get a single person
GET/people/{id}/lists/{type}/{sort}Get lists containing this person
GET/people/{id}/moviesGet movie credits
GET/people/{id}/showsGet show credits
GET/recommendations/moviesGet movie recommendations
DELETE/recommendations/movies/{id}Hide a movie recommendation
GET/recommendations/showsGet show recommendations
DELETE/recommendations/shows/{id}Hide a show recommendation
POST/scrobble/pausePause watching in a media center
POST/scrobble/startStart watching in a media center
POST/scrobble/stopStop or finish watching in a media center
GET/search/{id_type}/{id}Get ID lookup results
GET/search/{type}Get text query results
GET/shows/anticipatedGet the most anticipated shows
GET/shows/collected/{period}Get the most collected shows
GET/shows/played/{period}Get the most played shows
GET/shows/popularGet popular shows
GET/shows/recommended/{period}Get the most recommended shows
GET/shows/trendingGet trending shows
GET/shows/updates/id/{start_date}Get recently updated show Trakt IDs
GET/shows/updates/{start_date}Get recently updated shows
GET/shows/watched/{period}Get the most watched shows
GET/shows/{id}Get a single show
GET/shows/{id}/aliasesGet all show aliases
GET/shows/{id}/certificationsGet all show certifications
GET/shows/{id}/comments/{sort}Get all show comments
GET/shows/{id}/last_episodeGet last episode
GET/shows/{id}/lists/{type}/{sort}Get lists containing this show
GET/shows/{id}/next_episodeGet next episode
GET/shows/{id}/peopleGet all people for a show
GET/shows/{id}/progress/collectionGet show collection progress
GET/shows/{id}/progress/watchedGet show watched progress
POST/shows/{id}/progress/watched/resetReset show progress
DELETE/shows/{id}/progress/watched/resetUndo reset show progress
GET/shows/{id}/ratingsGet show ratings

Showing the first 100 of 183 endpoints; the full list is in the documentation.

Questions

Does the Trakt API API need an API key?

Yes. The Trakt API API uses OAuth authentication; the documentation explains how to get credentials.

Does the Trakt API API support HTTPS?

Yes, the Trakt API API is served over HTTPS.

How many endpoints does the Trakt API API have?

Its OpenAPI description lists 183 endpoints in version 1.0.0. The first 100 are shown on this page.

What are alternatives to the Trakt API API?

Other Geocoding APIs include Bing Maps, ip-api, OpenStreetMap, GeographQL, IP Address Details.

Compare alternatives →

Listed from APIs.guru (CC0).