A powerful and interactive Python CLI tool to explore the Trakt.tv API. View trending movies and shows, explore user activity, collections, watchlists, ratings, and more — all from your terminal.
- ✅ Browse trending, popular, and anticipated movies and TV shows
- ✅ View sync history, watchlist, ratings, and collections
- ✅ Explore user data (watched, ratings, lists, followers, comments, etc.)
- ✅ PrettyTables for clean terminal display
- ✅ Modular and easily extensible
- Python 3.7+
- Trakt.tv API key (Client ID only)
Install dependencies:
pip install requests prettytable
- Clone the repo:
git clone https://github.com/suuhm/trakt.tv-API-Handler.git
cd trakt.tv-API-Handler
- Open the script and insert your Trakt.tv API key:
HEADERS = {
'Content-Type': 'application/json',
'trakt-api-version': '2',
'trakt-api-key': 'YOUR_CLIENT_ID_HERE' # ← replace this
}
Absolutely! Here's an additional section you can add to your README.md
file that explains how to get a Trakt.tv API token (Client ID) step-by-step:
To use the Trakt.tv API, you need a free Client ID. Here's how to get one:
-
Create an account (if you don’t have one): Go to https://trakt.tv/join and sign up.
-
Log in to your account at https://trakt.tv
-
Go to the Developer Applications page: Visit 👉 https://trakt.tv/oauth/applications
-
Click "New Application"
-
Fill in the application form:
Field Value Name Trakt.tv API Handler Redirect URI urn:ietf:wg:oauth:2.0:oob
(for testing only)Description CLI tool to explore Trakt.tv content Permissions Leave as-is (read-only is fine for public APIs) -
Click Save Application
-
After saving, you'll see:
- Client ID
- Client Secret
-
Run the python script
python trakt.tv-oauth.py
In the Python file, find this line:
"Authorization": "Bearer API_ACCESS_TOKEN",
'trakt-api-key': 'YOUR_CLIENT_ID_HERE'
Replace 'YOUR_CLIENT_ID'
and 'API_ACCESS_TOKEN'
with your actual Client ID and API_ACCESS_TOKEN from the step above.
- Run the tool:
python trakt_api_handler.py
🎬 Trakt.tv API Handler
-------------------
1. Movies → Submenu (Trending, Popular, Recommended, etc.)
2. Shows → Submenu (Trending, Played, Anticipated, etc.)
3. Sync → Submenu (Watched, History, Collection, etc.)
4. User → Enter a username, explore their profile data
0. Exit
Each submenu offers an option to fetch individual endpoints or "A. Show all" to fetch all related endpoints at once.
Choose: 1
📚 Movies
1. Trending Movies
2. Popular Movies
...
A. Show all
0. Back
Select an item to see a clean terminal table:
📊 Trending Movies
+---------------------+------+---------+-----------------------+
| Title | Year | Rating | Genres |
+---------------------+------+---------+-----------------------+
| Dune: Part Two | 2024 | 8.7 | sci-fi, adventure |
| The Batman | 2022 | 7.9 | action, crime, drama |
+---------------------+------+---------+-----------------------+
Pull requests and suggestions welcome! Want a GUI version or OAuth support next? Open an issue!