Trakt is a service that integrates with your media center to better keep track of the TV shows and movies that you've watched.
Go to siteThe Trakt API provides an interface to track and discover movies and TV shows, allowing you to manage watchlists, get personalized recommendations, and engage with a social community of film and TV enthusiasts. On Pipedream, you can harness this API to create custom workflows that automate your media activities, sync your watch status with other apps, or even analyze your viewing habits.
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
trakt: {
type: "app",
app: "trakt",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://api.trakt.tv/users/me`,
headers: {
Authorization: `Bearer ${this.trakt.$auth.oauth_access_token}`,
"Content-Type": `application/json`,
"trakt-api-version": `2`,
"trakt-api-key": `${this.trakt.$auth.oauth_client_id}`,
},
})
},
})
Sync Watched Status to Calendar: Automatically add movies or episodes you've watched to your Google Calendar. This workflow triggers when you mark an item as watched on Trakt, then creates an event in your calendar with the title and watch date.
Curate Weekly Watchlist Email: Gather your Trakt watchlist and recommendations at the end of each week, and send yourself an email with a curated list of what to watch next. This could include ratings, genres, and a brief synopsis to help you decide.
Social Media Sharing: Share your ratings or reviews on social media platforms like Twitter. After you rate a movie or episode on Trakt, this workflow posts your rating along with a personalized message to your Twitter feed, spreading the word about your latest picks.
Remove one of more items from watchlist. See the documentation
Trakt uses OAuth authentication. When you connect your Trakt account, Pipedream will open a popup window where you can sign into Trakt and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Trakt API.
Pipedream requests the following authorization scopes when you connect your account:
GET
https://api.trakt.tv/oauth/authorize
?
client_id={{oauth.client_id}}
&
redirect_uri={{oauth.redirect_uri}}
&
state={{oauth.state}}
&
response_type=code
POST
https://api.trakt.tv/oauth/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
redirect_uri={{oauth.redirect_uri}}
&
grant_type=authorization_code
&
code={{oauth.code}}
POST
https://api.trakt.tv/oauth/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
grant_type=refresh_token
&
refresh_token={{oauth.refresh_token}}