A wrapper for the API

Usage no npm install needed!

<script type="module">
  import nodeTrakt from '';



node-trakt is a wrapper for the API. It supports:


npm install node-trakt


var trakt = require("node-trakt")("api-key");

// Get movie information for The Lone Ranger (2013)
trakt.movieSummary({ title: "tt1210819" }, function(err, movie){


apiMethod([params,] callback(err, data))

  • params (Optional) An object containing the parameters for the API call. Arrays will be converted/joined to strings if the method is a GET method for convenience.
  • callback Called after the request completed. If an error ocurred err will contain the Error object, otherwise it will be null. The parsed JSON data is returned in data.

API methods are generated by joining the parts of the path, uppercasing every part. (e.g. movie/summary becomes movieSummary)
If a required parameter is omitted, no request is made to the server and instead an error is returned.
This function will pass an auth header for every request if user credentials are provided.

Check out the API docs for documentation on all methods and their parameters.

login(username, password, callback(loggedIn))

  • username
  • password Can be either the password in plain text or the SHA1 encoded password.
  • callback Will be called after testing the credentials with loggedIn being the succes value of the login.

Sets the username and password in an options object so they can later be used in API requests. Tests if the credentials are valid using API method account/test.


  • confirmed (Default = true) Whether the login credentials should be confirmed for this function to regard the user logged in. If this is set to false, the function will return true if credentials were provided using login().
  • returns True if the user is logged in, false if not.

Use this to check if the user is logged in.