# Cloudflare is blocking API calls

**URL:** <https://forums.trakt.tv/t/cloudflare-is-blocking-api-calls/50946>\
**Category:** Questions & Help\
**Created:** [March 21, 2025, 10:53am UTC](https://forums.trakt.tv/t/cloudflare-is-blocking-api-calls/50946 "2025-03-21T10:53:40Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![kasperlk](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.trakt.tv/kasperlk/32/19990_2.png) [@kasperlk](https://forums.trakt.tv/u/kasperlk)\
**Post date:** [March 21, 2025, 10:53am UTC](https://forums.trakt.tv/t/cloudflare-is-blocking-api-calls/50946/1 "2025-03-21T10:53:40Z")

</div>

When calling the API, I get a 403 back with the message “Sorry, you have been blocked”.

Cloudflare Ray ID: 923cd07c1d8c5690  
I’m forced to use a Cato VPN, but my IP is still located in Denmark.

---

<div class="post-metadata">

**Author:** ![kasperlk](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.trakt.tv/kasperlk/32/19990_2.png) [@kasperlk](https://forums.trakt.tv/u/kasperlk)\
**Post date:** [March 21, 2025, 12:43pm UTC](https://forums.trakt.tv/t/cloudflare-is-blocking-api-calls/50946/2 "2025-03-21T12:43:14Z")

</div>

I have just tried using [https://trakt.docs.apiary.io/](https://trakt.docs.apiary.io/) from my phone, which is not on a VPN, and I still get the Cloudflare error when using the Try button on the examples.

---

<div class="post-metadata">

**Author:** ![justin](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.trakt.tv/justin/32/50135_2.png) [@justin](https://forums.trakt.tv/u/justin)\
**Post date:** [March 21, 2025, 3:46pm UTC](https://forums.trakt.tv/t/cloudflare-is-blocking-api-calls/50946/3 "2025-03-21T15:46:16Z")

</div>

A 403 indicates a bad api key.

---

<div class="post-metadata">

**Author:** ![vraposo](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.trakt.tv/vraposo/32/25826_2.png) [@vraposo](https://forums.trakt.tv/u/vraposo)\
**Post date:** [March 21, 2025, 3:54pm UTC](https://forums.trakt.tv/t/cloudflare-is-blocking-api-calls/50946/4 "2025-03-21T15:54:35Z")

</div>

I can confirm that the same happens (Cloudflare gateway) with something that I’ve been playing around with to keep track of my collection “offline”, and can asure you that it was working before without an issue.

---

<div class="post-metadata">

**Author:** ![kasperlk](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.trakt.tv/kasperlk/32/19990_2.png) [@kasperlk](https://forums.trakt.tv/u/kasperlk)\
**Post date:** [March 21, 2025, 4:06pm UTC](https://forums.trakt.tv/t/cloudflare-is-blocking-api-calls/50946/5 "2025-03-21T16:06:14Z")

</div>

> **[Trakt API · Apiary](https://trakt.docs.apiary.io/#reference/movies/trending/get-trending-movies)**
>
> A place where APIs are kept.

Can be used without any sort of api key as far as I can see, and it still fails.

---

<div class="post-metadata">

**Author:** ![justin](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.trakt.tv/justin/32/50135_2.png) [@justin](https://forums.trakt.tv/u/justin)\
**Post date:** [March 21, 2025, 4:19pm UTC](https://forums.trakt.tv/t/cloudflare-is-blocking-api-calls/50946/6 "2025-03-21T16:19:25Z")

</div>

The API requires a key for all methods, a 403 means you’re sending no key or an invalid key.

---

<div class="post-metadata">

**Author:** ![vraposo](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.trakt.tv/vraposo/32/25826_2.png) [@vraposo](https://forums.trakt.tv/u/vraposo)\
**Post date:** [March 21, 2025, 5:26pm UTC](https://forums.trakt.tv/t/cloudflare-is-blocking-api-calls/50946/7 "2025-03-21T17:26:27Z")

</div>

I just run a simple call using Apiary, with a valid key, and Cloudflare still steps in erroring out the call.

If it helps, the Cloudflare Ray ID is 923f212bfbcd4d20.

What’s also “really funny” is that the page mentions that my IP address is 147.154.29.227, which doesn’t even come close to my real IP address.

Is there some other way we can provide more information to help understand what the issue might be? Thanks in advance.

---

<div class="post-metadata">

**Author:** ![justin](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.trakt.tv/justin/32/50135_2.png) [@justin](https://forums.trakt.tv/u/justin)\
**Post date:** [March 21, 2025, 5:30pm UTC](https://forums.trakt.tv/t/cloudflare-is-blocking-api-calls/50946/8 "2025-03-21T17:30:47Z")

</div>

I wouldn’t rely on running stuff through the API docs. I’m sure they proxy and do other stuff. It would be more helpful to have raw curls that you’re using.

---

<div class="post-metadata">

**Author:** ![vraposo](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.trakt.tv/vraposo/32/25826_2.png) [@vraposo](https://forums.trakt.tv/u/vraposo)\
**Post date:** [March 21, 2025, 5:31pm UTC](https://forums.trakt.tv/t/cloudflare-is-blocking-api-calls/50946/9 "2025-03-21T17:31:10Z")

</div>

After doing some more search around, according to a discussion on Github ([Getting 403 status code when trying to get the access\_token · trakt/trakt-api · Discussion #507 · GitHub](https://github.com/trakt/trakt-api/discussions/507)), that the team is “experimenting with some firewall rules to block bot traffic”.

The proposed workaround, which I just tried and seems to work, is to set the User-Agent header. Maybe that should have been communicated… 😉

---

<div class="post-metadata">

**Author:** ![kasperlk](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.trakt.tv/kasperlk/32/19990_2.png) [@kasperlk](https://forums.trakt.tv/u/kasperlk)\
**Post date:** [March 24, 2025, 9:23am UTC](https://forums.trakt.tv/t/cloudflare-is-blocking-api-calls/50946/10 "2025-03-24T09:23:44Z")

</div>

I’m not sure what changed, but today my API calls are working again, and requests sent from Insomnia is also working again.

My requests are scheduled to run every night, and started failing on marts 21 4:10 AM GMT+1.  
I also tried multiple times from Insmonia on the 21 with a similar Cloudflare related error.  
The same error happend when the schedule ran on the 22 and 23, but today marts 24 4:22 AM GMT+1 everything worked again.

I actually didn’t look at my logs before trying to fix the problem, so I started by sending my saved requests from Insomnia, thad had failed on the 21, and to my surprise they worked, so I requested a new access token as I thought that was the problem for my scheduled requests, but after updating them in my application I noticed that the schedule has completed during the night without any problems.
