Resta saysAn API is a contract: a defined way for one program to request something from another.
An Application Programming Interface defines what you can ask for and what you'll get back — the agreed-upon "menu" between software systems. A weather app doesn't measure temperature; it calls a weather API. The contract (endpoints, inputs, outputs) lets teams build against each other without knowing each other's internals.
Power-ups you unlock
An API = a contract between programs
Defines requests in and responses out
Hides the other system’s internals
Lets teams integrate without coupling
The 401 Bandit attacks — common mistakes
Treating an API as the implementation, not the contract
Depending on undocumented behavior
Ignoring the contract’s versioning
Boss battleDescribe a real app you use and name the API call it likely makes.
Example code
<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre>request: GET /weather?city=NYC
response: { "temp": 21, "unit": "C" }
the contract, not the thermometer.</pre></body></html>