Correct permanent failures
Change the request before retrying authentication, validation, not-found, or conflict responses. Log the HTTP status, structured error code, message, and request identifier without logging the API key or personal data.
Retry temporary failures safely
Retry 429 and 5xx responses with bounded exponential backoff and random jitter. Honor Retry-After when it is present, cap the number of attempts, and surface a clear failure after the retry budget is exhausted.
Stay inside request limits
Compare two to four distinct products. Price-history ranges are 7d, 30d, 90d, and 1y. Validate these values before sending a request so user input fails locally with a useful message.