A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Hi
Hope you are doing well
I am using the Shopify Rest API for getting the products data and updating the products in shopify store but I am getting "{"errors":"Exceeded 2 calls per second for api client. Reduce request rates to resume uninterrupted service."}" this error again and agoin I have added the delay "sleep(2)" for resolving this issue but there is no positive response so can you please help me out about this issue.
Thanks & Regards
Rinku Sharma
Are you checking to see how many calls you have remaining or just running into the limit and then deciding to make less calls? If you've been aggressively hitting the api it's possible you've been throttled. The right approach would be to avoid hitting the limit in the first place.
Walk me through how you are handling your calls rates and your bucket size at the moment.
The admin rest api has a limit of 2 requests per second and it is best not to push against that. There are headers returned on the request that will tell you how long to wait, so if you implement a request retry with gradual back-off, you can just use the retry-after header to set your back-off value or something like that: https://shopify.dev/api/usage/rate-limits