question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Shopify: Exceeded 2 calls per second for api client

See original GitHub issue

Hi there,

I have a large catalogue of products +600 and are trying to change them all from Draft > Active through Shopify. However, due to an API limit HULL and Shopify are giving some issues.

Maybe there needs to be added some sort of queue to prevent this from happening, as this could easily also happen if two or more people are updating Shopify at the same time.

[POST] /api/shopify/product-update — 10:24:47:73
url: 'https://[shop-name].myshopify.com/admin/products/[pid]/metafields.json',
method: 'get',
...
data: {
  errors: 'Exceeded 2 calls per second for api client. Reduce request rates to resume uninterrupted service.'
}

I found this link: https://help.apidrop.com/en/articles/5220902-shopify-platform-comunication-error-exceeded-2-calls-per-second-for-api-client-reduce-request-rates-to-resume-uninterrupted-service

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
j4ysencommented, Oct 29, 2021

Hey @dnlmzw, I ran into a similar problem with a client and after a bunch of research found this tool called hookdeck which allows you to queue/throttle webhooks.

All I had to do was change out the webhook urls from my own api endpoint to one they give. From there I set a rate limit of 2 per second to the /api/shopify/product-update endpoint, and it seems like it’s working fine for now! There’s a free plan of 10,000 events per month.

1reaction
multiplehatscommented, May 19, 2022

Hi folks, I’m one of the creators of hookdeck. It was rewarding to read about your experience. I wanted to jump in to contribute a bit more and offer help!

First of all, you can check out our cli, a free alternative to ngrok with a permanent URL (amongst other things). It almost mimics the behaviour of Hookdeck for what you are ready to go to production, you’ll just need to add a destination URL.

@djclarkson The /api/shopify/* endpoints seem to be defined here. When you add the Hookdeck URL to Shopify, you don’t need to append your server path to the path. That could be leading to 404. Your URL would be https://events.hookdeck.com/e/src_YOUR_ID and not https://events.hookdeck.com/e/src_YOUR_ID/api/shopify/.... Happy to help debug if you reach out in the dashboard live chat!

One more thing, all though this might not be obvious, people tend to prefer using a single Hookdeck URL. You can create a unique shopify source and send all your webhooks to it. Using the filters, you can then forward to the right webhooks to the right URL. Optional but some prefer this approach. It would look like this:

Screen Shot 2022-01-09 at 4 31 42 PM

@ndimatteo All of this configuration can also be automated, would there be interest in baking methods to configure the webhooks within the repo? I could find some time to work on it and open a PR if there is interest 😃

Very cool product! Going to keep a close eye on my logs. Will def use this if I hit rate limits.

Edit: Scratch that, this looks awesome. Going to move some of my webhooks to Hookdeck. I like that it keeps a record of webhooks. ❤️

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Exceeded 2 calls per second for api client" - Please help!
Solved: Hi, I am publishing products to the shop back office via the API. Unfortunately, I get the following error, when publishing certain...
Read more >
Exceeded 2 Calls per Second for API Client” for Webhooks
This Shopify error is due to a limitation on API calls, which unfortunately for you impacts your ability to handle events that trigger...
Read more >
Shopify API: Exceeded 2 calls per second for api client
I am fully aware of the rate limits of 40 requests per minute and the refresh rate of 2 requests per second. The...
Read more >
Shopify API rate limits
Shopify limits the amount of checkouts that can be created on the Storefront API per minute. If an API client exceeds this throttle,...
Read more >
Question: Exceeded 2 calls per second for api client (Shopify)
The trick is to set the "Maximum concurrent executions", depending on the capacity of the end point. If you set it to 1,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found