Interact with the Trakt API to manage your watchlist, collection, ratings, and discover content
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install trakt-tv或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install trakt-tv⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/trakt-tv/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: trakt description: Interact with the Trakt API to manage your watchlist, collection, ratings, and discover content metadata: {"openclaw": {"requires": {"env": ["TRAKT_CLIENT_ID", "TRAKT_CLIENT_SECRET", "TRAKT_ACCESS_TOKEN"]}, "primaryEnv": "TRAKT_ACCESS_TOKEN", "homepage": "https://trakt.tv"}} ---
Interact with Trakt.tv to manage your watchlist, track viewing history, maintain your collection, rate content, and discover new movies and shows.
Before using this skill, you need to set up Trakt API credentials:
~/.openclaw/openclaw.json:{
"skills": {
"entries": {
"trakt": {
"enabled": true,
"env": {
"TRAKT_CLIENT_ID": "your_client_id",
"TRAKT_CLIENT_SECRET": "your_client_secret",
"TRAKT_ACCESS_TOKEN": "your_access_token",
"TRAKT_REFRESH_TOKEN": "your_refresh_token"
}
}
}
}
}
Add to watchlist:
curl -X POST https://api.trakt.tv/sync/watchlist \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TRAKT_ACCESS_TOKEN" \
-H "trakt-api-version: 2" \
-H "trakt-api-key: $TRAKT_CLIENT_ID" \
-d '{"movies":[{"title":"Inception","year":2010}]}'
Get watchlist:
curl https://api.trakt.tv/sync/watchlist/movies \
-H "Authorization: Bearer $TRAKT_ACCESS_TOKEN" \
-H "trakt-api-version: 2" \
-H "trakt-api-key: $TRAKT_CLIENT_ID"
Remove from watchlist:
curl -X POST https://api.trakt.tv/sync/watchlist/remove \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TRAKT_ACCESS_TOKEN" \
-H "trakt-api-version: 2" \
-H "trakt-api-key: $TRAKT_CLIENT_ID" \
-d '{"movies":[{"ids":{"trakt":12601}}]}'
Search movies:
curl "https://api.trakt.tv/search/movie?query=inception" \
-H "trakt-api-version: 2" \
-H "trakt-api-key: $TRAKT_CLIENT_ID"
Search shows:
curl "https://api.trakt.tv/search/show?query=breaking+bad" \
-H "trakt-api-version: 2" \
-H "trakt-api-key: $TRAKT_CLIENT_ID"
Get watch history:
curl https://api.trakt.tv/sync/history \
-H "Authorization: Bearer $TRAKT_ACCESS_TOKEN" \
-H "trakt-api-version: 2" \
-H "trakt-api-key: $TRAKT_CLIENT_ID"
Add to history (mark as watched):
curl -X POST https://api.trakt.tv/sync/history \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TRAKT_ACCESS_TOKEN" \
-H "trakt-api-version: 2" \
-H "trakt-api-key: $TRAKT_CLIENT_ID" \
-d '{"movies":[{"title":"The Matrix","year":1999,"watched_at":"2024-01-15T20:00:00.000Z"}]}'
Get collection:
curl https://api.trakt.tv/sync/collection/movies \
-H "Authorization: Bearer $TRAKT_ACCESS_TOKEN" \
-H "trakt-api-version: 2" \
-H "trakt-api-key: $TRAKT_CLIENT_ID"
Add to collection:
curl -X POST https://api.trakt.tv/sync/collection \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TRAKT_ACCESS_TOKEN" \
-H "trakt-api-version: 2" \
-H "trakt-api-key: $TRAKT_CLIENT_ID" \
-d '{"movies":[{"title":"Blade Runner 2049","year":2017,"collected_at":"2024-01-15T20:00:00.000Z","media_type":"bluray","resolution":"uhd_4k"}]}'
Get ratings:
curl https://api.trakt.tv/sync/ratings/movies \
-H "Authorization: Bearer $TRAKT_ACCESS_TOKEN" \
-H "trakt-api-version: 2" \
-H "trakt-api-key: $TRAKT_CLIENT_ID"
Add rating:
curl -X POST https://api.trakt.tv/sync/ratings \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TRAKT_ACCESS_TOKEN" \
-H "trakt-api-version: 2" \
-H "trakt-api-key: $TRAKT_CLIENT_ID" \
-d '{"movies":[{"title":"The Shawshank Redemption","year":1994,"rating":10}]}'
Get recommendations:
curl https://api.trakt.tv/recommendations/movies?limit=10 \
-H "Authorization: Bearer $TRAKT_ACCESS_TOKEN" \
-H "trakt-api-version: 2" \
-H "trakt-api-key: $TRAKT_CLIENT_ID"
Get trending:
curl https://api.trakt.tv/movies/trending \
-H "trakt-api-version: 2" \
-H "trakt-api-key: $TRAKT_CLIENT_ID"
Get popular:
curl https://api.trakt.tv/movies/popular \
-H "trakt-api-version: 2" \
-H "trakt-api-key: $TRAKT_CLIENT_ID"
{
"title": "Inception",
"year": 2010,
"ids": {
"trakt": 16662,
"slug": "inception-2010",
"imdb": "tt1375666",
"tmdb": 27205
}
}
{
"title": "Breaking Bad",
"year": 2008,
"ids": {
"trakt": 1,
"slug": "breaking-bad",
"tvdb": 81189,
"imdb": "tt0903747",
"tmdb": 1396
}
}
{
"season": 1,
"number": 1,
"title": "Pilot",
"ids": {
"trakt": 73482,
"tvdb": 349232,
"imdb": "tt0959621",
"tmdb": 62085
}
}
When the user asks to interact with Trakt:
- trakt-api-version: 2 - trakt-api-key: $TRAKT_CLIENT_ID - Authorization: Bearer $TRAKT_ACCESS_TOKEN (for authenticated endpoints) - Content-Type: application/json (for POST/PUT/DELETE)
- Watchlist: /sync/watchlist (POST to add, /sync/watchlist/remove to remove) - History: /sync/history (GET for viewing, POST for adding) - Collection: /sync/collection (GET for viewing, POST for adding) - Ratings: /sync/ratings (GET for viewing, POST for adding) - Search: /search/{type}?query={q} (no auth required) - Trending: /{type}/trending (no auth required) - Popular: /{type}/popular (no auth required) - Recommendations: /recommendations/{type} (requires auth)
- Success: 200/201 status codes - Not found: 404 - Unauthorized: 401 (token may need refresh) - Rate limited: 429
To get an access token, use this helper script:
#!/bin/bash
# Save as get_trakt_token.sh
CLIENT_ID="your_client_id"
CLIENT_SECRET="your_client_secret"
REDIRECT_URI="urn:ietf:wg:oauth:2.0:oob"
echo "1. Open this URL in your browser:"
echo "https://trakt.tv/oauth/authorize?response_type=code&client_id=$CLIENT_ID&redirect_uri=$REDIRECT_URI"
echo ""
echo "2. Authorize the app and copy the code"
echo -n "3. Paste the code here: "
read CODE
echo ""
echo "Exchanging code for token..."
RESPONSE=$(curl -s -X POST https://api.trakt.tv/oauth/token \
-H "Content-Type: application/json" \
-d "{
\"code\": \"$CODE\",
\"client_id\": \"$CLIENT_ID\",
\"client_secret\": \"$CLIENT_SECRET\",
\"redirect_uri\": \"$REDIRECT_URI\",
\"grant_type\": \"authorization_code\"
}")
echo ""
echo "Response:"
echo "$RESPONSE" | jq .
echo ""
echo "Add these to your OpenClaw config:"
echo "TRAKT_ACCESS_TOKEN=$(echo $RESPONSE | jq -r .access_token)"
echo "TRAKT_REFRESH_TOKEN=$(echo $RESPONSE | jq -r .refresh_token)"
Make it executable: chmod +x get_trakt_token.sh
User: "Add Dune to my Trakt watchlist"
Assistant: I'll add Dune to your Trakt watchlist.
curl -X POST https://api.trakt.tv/sync/watchlist \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TRAKT_ACCESS_TOKEN" \
-H "trakt-api-version: 2" \
-H "trakt-api-key: $TRAKT_CLIENT_ID" \
-d '{"movies":[{"title":"Dune","year":2021}]}'
---
...
安装 Trakt.tv 后,可以对 AI 说这些话来触发它
Help me get started with Trakt.tv
Explains what Trakt.tv does, walks through the setup, and runs a quick demo based on your current project
Use Trakt.tv to interact with the Trakt API to manage your watchlist, collection, r...
Invokes Trakt.tv with the right parameters and returns the result directly in the conversation
What can I do with Trakt.tv in my developer & devops workflow?
Lists the top use cases for Trakt.tv, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/trakt-tv/ 目录(个人级,所有项目可用),或 .claude/skills/trakt-tv/(项目级)。重启 AI 客户端后,用 /trakt-tv 主动调用,或让 AI 根据上下文自动发现并使用。
Trakt.tv 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Trakt.tv 可免费安装使用。请查阅仓库了解许可证信息。
Interact with the Trakt API to manage your watchlist, collection, ratings, and discover content
Trakt.tv 属于「Developer & DevOps」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my developer & devops tasks using Trakt.tv
Identifies repetitive steps in your workflow and sets up Trakt.tv to handle them automatically