@chirag127/trakt
v1.0.0
Published
Trakt.tv v2 API client — user history, watchlist, stats
Downloads
61
Readme
@chirag127/trakt
Zero-dependency Trakt.tv v2 API client. Uses browser User-Agent to bypass Cloudflare.
Install
npm i @chirag127/traktUsage
import { createClient } from '@chirag127/trakt';
const trakt = createClient('YOUR_CLIENT_ID', 'username');
const history = await trakt.getHistory('movies', 200);
const watchlist = await trakt.getWatchlist('shows');
const stats = await trakt.getStats();
const watching = await trakt.getWatching();API
createClient(clientId, username)
Returns a client with:
| Method | Endpoint |
|---|---|
| getHistory(type, limit) | GET /users/{username}/history/{type}?limit={limit} |
| getWatchlist(type) | GET /users/{username}/watchlist/{type} |
| getStats() | GET /users/{username}/stats |
| getWatching() | GET /users/{username}/watching |
type defaults: 'movies'. limit default: 200.
License
MIT
