Rate limiting with Python SDK

Travis_D
Shopify Partner
39 1 4

We are using the Python SDK. 

 

How are people rate limiting their API requests? We frequently receive the  "Too Many Requests" error. 

 

The ratelimit project looks good - but doesn't seem to allow you to limit with a group. We are making API calls on behalf of several merchants, so it's not feasible to enforce limits application wide for all merchants. 

 

A solution that uses an existing project or module would be preferable. 

 

Thanks!

 

 

 

hassain
Shopify Staff (Retired)
Shopify Staff (Retired)
623 104 148

Hey @Travis_D ,

 

Here's a helpful article that provides some tips on how avoid the API Rate Limits: https://www.shopify.ca/partners/blog/84051654-7-tips-to-maximize-your-use-of-the-shopify-api

 

One of the useful tips is to schedule concurrent jobs to send out synchronized API requests to Shopify, and then use a data storage of some kind in order to track the remaining API budget between all of the jobs. In terms of existing projects or modules you can use, you can look into implementing a Python job scheduler (like schedule or APScheduler) and use some database like Redis to track your shared API budget count between jobs.

 

Hassain | Developer Support Specialist @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes
saml12345
Excursionist
23 0 4

Did you ever resolve this? I'm dealing with the same thing. 

 

 

0 Likes
Travis_D
Shopify Partner
39 1 4

I did. I'll post a follow up when I'm back online. 

Which SDK are you using to connect to Shopify? Are you handling multiple shops, or just one? 

0 Likes