I’m working with a modified version of an Amazon price monitoring script for Google Sheets. The goal is to automatically fetch and display current prices for multiple products without having to manually check each one.
The issue I’m facing is that the script only processes around 20 products before it stops working completely. I have a much larger list of items I want to monitor, but the script seems to quit after handling the first 20 or so entries.
I’ve tried looking through the code myself but I’m pretty new to programming and can’t figure out what’s causing this limitation. Has anyone encountered a similar problem with Google Sheets scripts that stop executing after a certain number of iterations?
Any help identifying why the script terminates early would be greatly appreciated. If you know how to fix this issue, that would be even better!
yeah, execution timeout could be the issue. google sheets has a strict runtime limit. try adding sleep() calls and process your products in smaller chunks. also, ensure amazon ain’t blocking ya - they aren’t fans of bots scraping prices.
You’re hitting Google Apps Script’s 6-minute execution limit. Fetching Amazon prices takes time due to slow and inconsistent HTTP requests. After about 20 items, you’re likely timing out. I’ve experienced this issue as well, and the solution is to break the processing into smaller batches using triggers. Try handling 10 to 15 items at a time, and set a time trigger to run the script every few minutes. Additionally, save your progress in a sheet cell to ensure the script resumes correctly. Be aware that Amazon tightly regulates automated requests, so you may be facing rate limits or blocks after too many calls. Introducing random delays between requests can help mitigate this, but they could also increase the risk of timing out.
This is definitely Google Sheets hitting quota limits, not just timeouts. Scripts have daily caps on URL fetches, and Amazon’s anti-bot measures complicate this since you need multiple retries per product. I encountered this same issue while monitoring tech gear last year. The script worked great on the first batch, then just stopped with no clear error messages. I resolved it by implementing exponential backoff delays and caching successful responses to avoid duplicate calls. Be sure to check your logs in the Apps Script editor; you will likely see quota errors that don’t appear in the sheet. If possible, consider switching to a different data source or using a proper API, as scraping Amazon directly tends to become less reliable over time.