# Application Programming Interface \(API\)

A defined interface through which software components request capabilities or exchange data without depending on each other's internal implementation.

- Type: term
- Domain: Engineering & architecture
- Level: Foundational
- Last reviewed: 2026-09-23
- Original: [Soroush’s Product Wiki](<https://wiki.soroush.uk/topic/application-programming-interface/>)

## What it means

An application programming interface \(API\) is a documented boundary that lets one software component interact with another through specified operations, inputs, outputs, and rules. APIs can exist within a programming language, operating system, library, or network service; a web API is one form, not the whole category.

## Why it matters

A stable API lets teams and products integrate while changing their internal code independently. Its contract shapes developer experience, security, compatibility, support cost, and the speed at which clients can adopt a capability.

## When to use it

Define an API when a capability needs a clear reusable boundary for another component, team, partner, or customer. A direct internal function or a manual exchange may be simpler when there is only one tightly coupled use and no need for independent evolution.

## How it works

1. Identify the consumers, tasks, data, trust boundaries, and service expectations the interface must support.
2. Define operations, inputs, outputs, errors, authentication, and usage constraints as a contract.
3. Implement the provider behind the contract and expose the interface through an appropriate protocol or language mechanism.
4. Let consumers call the interface without requiring knowledge of the provider's internal implementation.
5. Monitor usage and failures, then evolve the contract with explicit compatibility and deprecation policies.

## A practical example

A delivery platform exposes an API that lets a retailer quote shipping, create a parcel, and retrieve tracking events. The retailer integrates against documented requests and responses while the delivery company changes routing systems behind the interface without forcing a client rewrite.

## Where it breaks

An API does not remove coupling; consumers still depend on its behavior, availability, data meanings, and change policy. Poor boundaries leak internal models, and public interfaces create lasting security, documentation, support, and compatibility obligations.

## Common mistakes

- Using API to mean only a public HTTP service and overlooking local or private interfaces.
- Exposing database structures directly instead of designing around consumer tasks and stable concepts.
- Documenting successful calls while omitting errors, limits, authentication, and lifecycle expectations.
- Making breaking changes without versioning, migration support, or a deprecation period.

## Visualization

[View the visualization on the website](<https://wiki.soroush.uk/topic/application-programming-interface/#visualization-application-programming-interface>)

## Sources

1. [API](<https://developer.mozilla.org/en-US/docs/Glossary/API>) — MDN Web Docs · Official technical documentation
2. [OpenAPI Specification](<https://spec.openapis.org/oas/latest.html>) — OpenAPI Initiative · Technical specification

## Related topics

- [API-First Design](<https://wiki.soroush.uk/topic/api-first-design/>)
- [Endpoint](<https://wiki.soroush.uk/topic/endpoint/>)
- [Request and Response](<https://wiki.soroush.uk/topic/request-and-response/>)
