Unit 13 · overview
Unit 13: APIs & The Internet
For the first twelve Units, most of your program’s truth lived inside the process or on local disk. Now part of the system can live somewhere else.
That changes the failure model.
Draw the boundary before you call it
A web API is an interface exposed over a network protocol such as HTTP. Your Python code becomes a client. The remote service decides what resources exist and what response it sends. The network sits between you.
Python client
-> HTTP request
-> network / remote service
-> HTTP response
-> representation such as JSON
-> local validation and analysis
This Unit separates those layers so the API broke stops being the only diagnosis.
You will inspect requests and responses, status-code families, URLs, headers, response bodies, JSON conversion, timeouts, HTTP failure handling, and payload assumptions. The build lesson uses a live test service when available and a local fixture so network access is never the only path to the learning target.
Evidence from two worlds
Keep one trace from a live or intentionally failed request and one trace from the local fixture. Label the source honestly. Then prove that your analysis logic can process the same data shape without caring whether it arrived over HTTP or from disk.
External data is input. Treat it with the same skepticism you would give keyboard input, only with more failure layers.