What an API Actually Is
An API is a defined way for one program to ask another for something - a contract that says what you can ask and what you'll get back - and this guide builds that mental model from the ground up before you touch any code.
Download EPUB- A Contract Between Programs An API is a defined way for one program to ask another for something - a promise about what you can ask and what you'll get back - while the internals stay hidden, the way a restaurant menu lets you order without going into the kitchen.
- Why APIs Exist APIs exist for three reasons - reuse (don't rebuild maps or payments yourself), separation (the frontend talks to the backend through a clean line), and integration (your app uses someone else's service) - all resting on one idea: a stable boundary you can depend on while the other side changes.
- Kinds of APIs APIs come in two broad kinds - local/library APIs that live inside your own program, and web APIs you reach across the network - and within web APIs there are a few common styles (REST, GraphQL, gRPC) that this guide names but doesn't teach, pointing you to HTTP and JSON next.