API returning 403 for public list

My app is receiving a 403 from the Trakt API when trying to retrieve certain lists. The lists are public, so I don’t see why I’m receiving this error. This was working before, but suddenly stopped a few days ago.

Here’s my backend code:

export async function getListItems(username: string, slug: string): Promise<TraktListItem[]> {
  const response = await fetch(`https://api.trakt.tv/users/${username}/lists/${slug}/items?extended=full,images`, {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'trakt-api-version': '2',
      'trakt-api-key': 'redacted'
    }
  })
  console.log(response)
  if (!response.ok) {
    return [];
  }
  return await response.json();
}

And here are the lists I’m trying to get:

As mentioned this has been working for a while so I can#t see what I could be doing wrong.

Could you please open an issue on GitHub?

Thanks!!

Thanks, didn’t realise there was a Github for this.

1 Like