A self-hosted PHP page for browsing new TV show premieres by month

Highlights

  • :date: Browse new show premieres for any month/year via ?month=
  • :clapper_board: Shows grouped by day, with posters, ratings, genres, network & country
  • :white_check_mark: “Watching” / “not watching” toggle, synced server-side across devices
  • :chart_increasing: Premiere-count history with delta tracking between visits
  • :globe_showing_europe_africa: Genre / country / network filtering support (requires Trakt VIP for advanced filters)
  • :framed_picture: All static assets served locally — no third-party bandwidth used

Setup

Copy config.example.php to config.php, add your Trakt API credentials, and you’re ready to go. See the README for full setup instructions.

Notes

  • Requires PHP 7.4+ with cURL enabled
  • config.php and the data/ folder are git-ignored — your credentials and watch history never leave your server

@great_vc ok script, but if I can suggest something:

  • change name of script trakt_new_shows_fixed.php to trakt_new_shows.php it would looks better, any new versions can be handled by git and user can read versions in dedicated file like Changelog.md
  • add in README.md section about, how to get TRAKT_ACCESS_TOKEN, because access tokes in trakt.tv api have short ttl: 7 days - Authentication

Thanks for your comments/notes.

I will make the changes.

The weird thing with the API thouh, whenever i refresh i get a valid 90 days token. ALso at this point the Keys do not work for some reason (probably because something happened to all the APIS) but the page .[php still brings results, which is super weird.

@great_vc dont forget thtat you have vip account, so your access tokens can be “priviledged” about livetime :stuck_out_tongue:

info about access tokens from docs:

Refreshing an Access Token

Access tokens are valid for 7 days. Use the refresh_token returned during authorization with the POST /oauth/token endpoint to obtain a new access token without asking the user to authorize your app again.

but it can be old info, because as I rememeber they short from days to hours, but refresh tokens have longer livetime so you can refresh token without making whole gathering new token procedure :stuck_out_tongue:

again strange stuff.

My problem with the other scripts are gone, since i got a new token and the validity now is 7 days! it was 90 before.

But, the page still works with the old token!!! how???

@great_vc everything depends on implementation of oauth, but there are no obligatiory rule to invalid old token when you generate new one (when refresh yes, but not when you create new one)

so in your case, old access token can be valid (to expire point), last token updates as I remember was this: ⚠️ Important Access Tokens Updates - effective March 20, 2025 · trakt/trakt-api · Discussion #495 · GitHub - but it was from 3 months to 24h

but of course all depends on account type/status maybe vip (and vip tier - how much you pay) then you have different token lifetime :slight_smile:

yeah i figure it out, for the need that we access the public calendar we do not need an OAUTH token so the whole procedure changes.

The token is needed only if you use your calendar /great_vc/calendar but for the public one it needs only the client id of an API.

these changes everything so i will adjust accordingly.