Authentication

The Trakt API uses OAuth 2.0 for user authentication. Some endpoints are "public" and only require your API key, while others require an authenticated user access token. A few endpoints can also return more personalized results when OAuth is provided, even if authentication is optional.

Every app should send the required Trakt API headers, including your trakt-api-key. For endpoints that require or support OAuth, also send the user access token as a Bearer token:

Authorization: Bearer <access_token>

Trakt supports two OAuth flows:

  1. Authorization Code Flow - Best for apps that can open a browser and receive a redirect callback. Learn more: Authentication
  2. Device Code Flow - Best for TVs, media centers, CLI tools, and other devices with limited input. Learn more: Authentication

Check each endpoint’s documentation to see whether OAuth is required, optional, or not needed.