I work in Jeddah, and on weekends I help my brother with his mobile shop in
Hyderabad from here. I wrote him a small Python script that checks supplier prices for about 500 items.
The supplier has a free API. The plan allows 60 requests a minute, and I read
that late. My script fires all 500 requests in a loop and gets a 429 error after
about 60. First fix was a 1 second sleep between calls. That worked for about a day.
Then my brother added 200 more items to the list and the 429 errors came back again.
I also tried running the script at 3am Hyderabad time, thinking the server would be quiet. It
didn't help at all. The limit is per minute, and it has nothing to do with traffic.
Now I'm confused about what to try next. I've read about caching, queues
and retries. Most prices only change once a day, so asking for them
again every hour seems wasteful. But a queue feels like too much for a
script that runs on 1 old laptop. I don't want to build something
huge for a shop that has 2 employees and a tea flask. What
would you do with 700 items and a 60 per minute limit? Cache first?
Is retrying after a 429 safe, or does it make things worse? Does the server tell me
how long to wait? I'm happy to read the documentation if you can point me at the
right part of it. Real experience from someone who has done this before would help me most.