An API, or Application Programming Interface, is a defined set of rules and protocols that enables one piece of software to communicate with another in a structured and predictable way. Rather than exposing an application's internal logic or code, an API provides a controlled access point through which external systems can request specific functionality or data.
The purpose of an API is to create a clear boundary between what a system offers and how it works internally. When a developer wants their application to use a service, whether that is processing a payment, retrieving weather data, or sending an email, they do not need to understand the underlying code of that service. They simply follow the API's documented rules to send a request and receive a response in an agreed format.
In practice, most APIs used on the web today communicate over HTTP and exchange data in a format called JSON or XML. A mobile banking app, for example, does not store financial data locally. Instead, it sends requests to the bank's API, which validates the request, queries the appropriate systems, and returns the relevant account information. The app displays that data to the user without ever having direct access to the bank's internal infrastructure.
APIs exist across virtually every layer of modern software. Operating systems expose APIs that allow applications to interact with hardware. Cloud platforms offer APIs for managing servers and storage. Third-party services publish APIs so other developers can integrate their features, such as maps, authentication, or messaging, into their own products. This model of composable services, where applications are built by connecting specialised APIs, has become foundational to how software is developed today.
A well-designed API is stable, consistent, and versioned. When a provider updates or improves its service, the API ensures that existing integrations continue to work without breaking, by maintaining compatibility across versions. This reliability is what makes APIs a practical building block rather than a fragile dependency.