Week 6 • Tuesday

Block 54: Rate Limiting & Robustness

Write production-quality API fetchers that handle errors and limits.

Concepts

Code Examples

See exercise below.

Exercise

Write a function fetch_with_retry(url, retries=3) that retries on 5xx errors. Fetch 10 pages of data with a 1-second sleep between each; collect all results.

Homework

Why is it important to save raw API data before processing it? Describe a scenario where this matters. Wednesday