An application programming interface, commonly abbreviated as API, is a defined set of rules and tools that lets one software component request services, data or functions from another. APIs describe how programs interact by specifying available operations, input and output formats, and error behaviors. They are used to connect desktop and mobile applications to operating system services, software libraries and remote services.

How APIs work

An API acts as an intermediary layer between a caller (for example, an application or script) and a provider (such as an operating system or a web service). A caller invokes an API by making a request that conforms to the API’s specification; the provider performs the requested action and returns a response. In local contexts an API may expose functions or classes from a library. In distributed contexts, APIs are exposed as network endpoints that accept structured requests and return structured responses.

Common components and concepts

  • Endpoints: addresses or entry points where requests are sent.
  • Methods/operations: named actions that can be performed (for example, read, create, update, delete).
  • Parameters and payloads: structured input data passed to the API and output returned to the caller.
  • Authentication and authorization: mechanisms that verify identity and control access (keys, tokens, OAuth).
  • Documentation and SDKs: human- and machine-readable descriptions that help developers use the API.

Types and styles

APIs can be classified by exposure and by protocol. By exposure they include public (open) APIs, partner APIs, internal (private) APIs and composite APIs that combine multiple calls into one. By communication style common forms are RESTful APIs, which typically use HTTP and resource-oriented URLs; RPC-style APIs that expose procedures; and SOAP-based APIs, which use XML messages. APIs are also provided by operating systems and software libraries; examples include native OS service calls (operating system APIs) and library interfaces (software library APIs).

History and development

APIs evolved as software systems became larger and more modular. Early programmers used function and library interfaces to share code within a system; with the growth of networks and the web, APIs moved over the network to let independent systems integrate. The rise of web APIs and standardized protocols made it easier for unrelated services to interact. Many well-known services publish developer interfaces; for example, social platforms publish web APIs so external programs can access updates and post content (web services, and specific vendor APIs such as the Twitter API).

Uses, importance and best practices

APIs are central to modern software: they enable integration between systems, power mobile and single-page applications, support microservice architectures, and allow third-party developers to extend platforms. Good API design focuses on clear documentation, predictable error handling, backward-compatible versioning, and robust security practices including rate limiting, authentication and monitoring. Because APIs are public interfaces to a system’s functionality, their design and governance are important both technically and for business strategy.