Computers and the Internet · Talking at scale
What is an API?
An API is a contract between programs. It says which requests one program may send another, what each must contain, what comes back, and what errors look like. Most web APIs speak HTTP and JSON.
- Time16 min
- LevelBeginner
- Pictures11 diagrams
- Check6 questions







App you open the weather app; it asks its own server for tomorrow.
App's server adds the secret API key and calls GET /v1/forecast.
Provider's system looks up the forecast in its own private data.
Response 200 OK with JSON in exactly the documented shape.
Screen the app turns high_c 18 into a sun icon and 18°.
Provider's code any language, rewritten whenever the provider likes.
Provider's data any database, moved or reshaped without telling callers.