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.

Thanks for building this.

I only use Trakt for two things.

  1. Tracking what I have watched.
  2. Finding a past or future premiere I might want to watch, and adding that to a list.

With v3 #2 seems to be gone, and your work might just be a decent replacement.

However, since I use Kodi to watch my content, I, of course, have the Kodi addon register the watch status. Will I be able to use your code without VIP?

IIRC, you can only have one API connection on Free?

hi, thanks for the comments.

You need only a client ID not a “api key” i think that is free for averybody.

Go to your settings=>apps=>create application and just enter a name and nothing else, you will get a client ID, that is all that you need, no expiration and no refresh token like OAUTH

Can’t create API app without VIP.

:weary_face:

Sorry about that. i really thought that the client id was free cause tha calls i made do not require any authentication and are public the /calendar/

I would send an email to support just to clarify.

If it is only Create that requires VIP, it might be worth it to just get it registered, if you can keep it even when VIP expires. If not, then absolutely not.