php - When I upload excel with updated products with variants comes error (exceeded 2 calls per second for api client) in shopify Api
When I upload excel with updated products with variants comes error (exceeded 2 calls per second for api client) in shopify Api.
Like I have 1200 products and respective products have different variantd 1 ,2 3 etc.
when i will update that excel and then try to call api then some variant update but some are not update and give error ==>exceeded 2 calls per second for api client
so Please help me for this.
The error message is selft explanatory. It means you are exceeding the Shopify API call limit. More information on rate limitation is available on Shopify Website (https://help.shopify.com/en/api/getting-started/api-call-limit). It says
The API call limit operates using a leaky bucket algorithm as a controller. The bucket empties at a leak rate of two calls per second, which means that apps averaging two calls per second avoid bucket errors.
To do so, you need to implement rate limiting in your application. As the PHP tag suggests you are using API via PHP, you can have a look at
Shopify PHP (https://github.com/phpclassic/php-shopify)
It has a function checkApiCallLimit that ensures that your application does not exceed API rate limit.
$shopify = new PHPShopify\ShopifySDK($config);
Now any calls you make using shopify object, will respect the API rate limits. You can check the read me of linked library for more information.
Didn't find the answer?
Our community is visited by hundreds of Shopify development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.