
The core concept
An API (Application Programming Interface) is a contract defining what requests a system accepts, what parameters they take, and what responses it returns — hiding internal implementation from callers.
REST
REST (Representational State Transfer) uses HTTP. Resources are identified by URLs. HTTP methods represent operations. Responses are typically JSON. Each request is self-contained (stateless).
GraphQL
GraphQL (Facebook, 2012; open-sourced 2015) lets clients specify exactly what data they need in one request. The client controls response shapes, eliminating over-fetching and under-fetching.
gRPC
gRPC (Google) is a high-performance binary protocol using Protocol Buffers for service-to-service communication in microservices where bandwidth and latency matter most.
Good API design
Good APIs are consistent, predictable, and version-stable. Clear naming, meaningful error codes, comprehensive documentation. API design is as much communication as technology.