HTTP Code 429, I make a call from an external web server to a WIX backend and seems to support about 1 request every 60 secs

I’m having trouble with
making a call to a Web Function I have installed on my WIX Website.

This is the PHP Code that call my WIX function, if I call it more than once every 60 secs I get a 429. This is not happy……

Any pointers appreciated?

$wixApiUrl = “https://overlandtrailguides.com/_functions/getUserByEmail?email=”;

$wixApiUrl = $wixApiUrl . $email;

$apiKey = "XXXXXXX"; // Same as in your Wix function

// Initialize cURL session
$ch = curl_init($wixApiUrl);

// Set request options
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: ' . $apiKey,
    'Content-Type: application/json'
]);

// Execute the request
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

// Process the response
if ($httpCode == 200) {
    $subscriptionData = json_decode($response, true);

Site link
See Live Link above, the httpCode is 429 if I make calls < 60 secs or so

What I’m trying to do
I am trying to check for subscriptions on my WIX site from another of my sites.

What I’ve tried so far
I have created a cache on my external site to reduce the number of calls but it seems to be severely and unduly restrictive.

Extra context
See the code above.

Out of my knowledge wix do restrict calls under a rate-limit of 60 secs.
Too frequent calls!

Why do you need that call to be so frequent?

Already tried —>

Instead of frequent polling from your PHP server to Wix (which is what causes the 429 errors), you can invert the architecture so that Wix pushes updates to your PHP server whenever something changes.

fetch / wix-fetch in backend

Make HTTP calls from Wix to external APIs (your PHP endpoint).

:white_check_mark: Perfect for push updates

Process-Flow:

  1. Something changes in Wix-Subscriptions
  2. Automatic function starts fetching your ENDPOINT (PHP-ENDPOINT of your server).
  3. Server gets the call and knows that now it has to respond with a → REQUEST

No more frequent 60 sec. polling!

This is just the first tought and idea came into my mind, after reading your issue.

I appreciate your input, however it is a wee bit more complicated. We have many thousands of users in WIX, WIX stores the user Subscription data. On occasion we need to be able to query WIX for the current subscription data. I have a DB table cache to limit the requests to wix however if we get 2 new users ( which is a likely possible use case if we do campaigns), the second user will be hit with a 429. Backing off for 60 secs or until the request succeeds does NOT give the best user experience. I cannot understand why WIX could not support a request every 5 secs or so, that I could work around and create a reasonable User experience. I would hate to have to push from WIX any and all subscription changes. Thank you for your reply. It is a valid solution :slight_smile: