Term
应用程序编程接口(API)
Next Token / Wiki

Application Programming Interface (API)

An application programming interface (API) is a contract that specifies how software components call each other's functions and exchange data. Callers follow the documented methods, parameters and response formats without needing to know the internals behind them.

Also known as

API · Web API · 接口 · 应用程序编程接口 · Application Programming Interface

Definition

An application programming interface (API) is a contract that specifies how software components call functions, pass parameters and receive results. Callers follow the documented contract without needing to understand the implementation behind it.

How it works

The caller builds a request according to the interface documentation — for an HTTP-based API, that means the method, path, parameters and credentials. The other side processes the request and responds in an agreed data format, most often JSON. The documentation defines the available operations, inputs, outputs and error handling.

Usage

Websites and apps use web APIs to fetch data from services such as weather, payments or maps. Operating systems and libraries also expose capabilities through APIs — for example, the DOM API a browser provides to JavaScript, or file system interfaces.

An SDK bundles libraries, tools and documentation, usually built around one or more APIs to speed up integration. A CLI is an interface for humans typing commands, while an API is an interface for programs to call. Many services offer an API, an SDK and a CLI at the same time.

Sources