Using CF purge cache api


I have recently used an API script to purge cache on 16 sites on CF e.g

curl -X POST "" \
 -H "X-Auth-Email: USER" \
 -H "X-Auth-Key: KEY " \
 -H "Content-Type: application/json" \
 --data '{"purge_everything":true}'

it worked okay for a couple of months up until got these error messages:
“message”:“Rate limited. Please wait and consider throttling your request speed”

I did found something related to rate limit on Cloudflare firewall tab but I didn’t have any rules applied
I tried setting a wait function so it will be 10 seconds each request but it looks like these messages appear random for each zone

Does anyone have an idea where I can throttle my request speed?


How often do you make these calls?

twice in 2 weeks perhaps maybe more…

Alright, so the only issue is when you run your script and it iterates over these 16 domains, right?

I’d increase the waiting time between requests to thirty seconds and try that. It will be trial and error.

its already set to 40 seconds each request but I will try to increase and see if anything changes…


Maybe set a minute or two. Just wait a bit before you run all the tests. You could also open a support ticket and clarify what interval best to use.

limit seems to be 1200 API requests every 5 minutes per CF user

maybe you have other API calls besides those purges within same CF user which is adding up to hit the limit ?

1 Like

I concur, there must be something else running in parallel. Sending 16 API requests (even in two second intervals) is no issue at all, just tested that.

@qbemedia, check for any other API calls. Assuming this 4/second average limit is accurate, there must be something that is using the API heavily. Check your audit log too.