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 🔒 **require** or have 🔓 **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
- OpenAPI
- Specification ↗
- Spec updated
- 2023-03-04
Make a first request
Replace the placeholders; the documentation says exactly where credentials go.
curl -X GET "https://api.trakt.tv/lists/popular" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_TOKEN"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);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
| Method | Path | What 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 | /checkin | Check into an item |
| DELETE | /checkin | Delete any active checkins |
| POST | /comments | Post 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}/item | Get the attached media item |
| POST | /comments/{id}/like | Like a comment |
| DELETE | /comments/{id}/like | Remove like on a comment |
| GET | /comments/{id}/likes | Get all users who liked a comment |
| GET | /comments/{id}/replies | Get replies for a comment |
| POST | /comments/{id}/replies | Post a reply for a comment |
| GET | /countries/{type} | Get countries |
| GET | /genres/{type} | Get genres |
| GET | /languages/{type} | Get languages |
| GET | /lists/popular | Get popular lists |
| GET | /lists/trending | Get 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}/likes | Get all users who liked a list |
| GET | /movies/anticipated | Get the most anticipated movies |
| GET | /movies/boxoffice | Get the weekend box office |
| GET | /movies/collected/{period} | Get the most Collected movies |
| GET | /movies/played/{period} | Get the most played movies |
| GET | /movies/popular | Get popular movies |
| GET | /movies/recommended/{period} | Get the most recommended movies |
| GET | /movies/trending | Get 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}/aliases | Get 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}/people | Get all people for a movie |
| GET | /movies/{id}/ratings | Get movie ratings |
| GET | /movies/{id}/related | Get related movies |
| GET | /movies/{id}/releases/{country} | Get all movie releases |
| GET | /movies/{id}/stats | Get movie stats |
| GET | /movies/{id}/studios | Get movie studios |
| GET | /movies/{id}/translations/{language} | Get all movie translations |
| GET | /movies/{id}/watching | Get users watching right now |
| GET | /networks | Get networks |
| GET | /oauth/authorize | Authorize Application |
| POST | /oauth/device/code | Generate new device codes |
| POST | /oauth/device/token | Poll for the access_token |
| POST | /oauth/revoke | Revoke an access_token |
| POST | /oauth/token | Exchange 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}/movies | Get movie credits |
| GET | /people/{id}/shows | Get show credits |
| GET | /recommendations/movies | Get movie recommendations |
| DELETE | /recommendations/movies/{id} | Hide a movie recommendation |
| GET | /recommendations/shows | Get show recommendations |
| DELETE | /recommendations/shows/{id} | Hide a show recommendation |
| POST | /scrobble/pause | Pause watching in a media center |
| POST | /scrobble/start | Start watching in a media center |
| POST | /scrobble/stop | Stop 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/anticipated | Get the most anticipated shows |
| GET | /shows/collected/{period} | Get the most collected shows |
| GET | /shows/played/{period} | Get the most played shows |
| GET | /shows/popular | Get popular shows |
| GET | /shows/recommended/{period} | Get the most recommended shows |
| GET | /shows/trending | Get 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}/aliases | Get all show aliases |
| GET | /shows/{id}/certifications | Get all show certifications |
| GET | /shows/{id}/comments/{sort} | Get all show comments |
| GET | /shows/{id}/last_episode | Get last episode |
| GET | /shows/{id}/lists/{type}/{sort} | Get lists containing this show |
| GET | /shows/{id}/next_episode | Get next episode |
| GET | /shows/{id}/people | Get all people for a show |
| GET | /shows/{id}/progress/collection | Get show collection progress |
| GET | /shows/{id}/progress/watched | Get show watched progress |
| POST | /shows/{id}/progress/watched/reset | Reset show progress |
| DELETE | /shows/{id}/progress/watched/reset | Undo reset show progress |
| GET | /shows/{id}/ratings | Get 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.
Similar geocoding APIs
Compare alternatives →Bing Maps
GeocodingCreate/customize digital maps based on Bing Maps data
ip-api
GeocodingFind location with IP address or domain
OpenStreetMap
GeocodingNavigation, geolocation and geographical data
GeographQL
GeocodingA Country, State, and City GraphQL API
IP Address Details
GeocodingFind geolocation with ip address
ipapi.co
GeocodingFind IP address location information
Listed from APIs.guru (CC0).