API

A defined way for one program to ask another program to do something, such as a list of web requests a service accepts.

In more detail

API stands for application programming interface. A web service's API is the set of requests it accepts and the responses it returns, and a library's API is the set of functions it offers. Programs that use an API depend only on that contract, not on how the other side is built.

Examples

A dynamic inventory plugin calls the cloud provider's API to list the current machines.
In the APIs course: This course treats an API as a promise: a named set of operations, the shapes that go in and the shapes that come back, which callers can rely on while the code behind it changes.
Kafka exposes producer, consumer and admin APIs over the Kafka protocol.
A design system's component API is its components, props and package exports; designing and versioning it is a major theme of this course.
In the browser: API stands for application programming interface. This course treats an API as a promise: a named set of operations, the shapes that go in and the shapes that come back, which callers can rely on while the code behind it changes. A web API carries that promise over HTTP, so every operation is a request to an address and every answer has a status, headers and a body.
net/http client calls an API; encoding/json decodes its replies
The course builds an orders API: GET /orders/{id} returns one order as JSON.
Next.js offers several APIs: the Metadata API, the cookies API and Route Handlers for building your own web API.
In this course APIs are mostly functions: React hooks such as useState, and browser APIs such as AbortController.
Collectors pull events from cloud services' APIs; every Kubernetes action is an API request recorded in the audit log.
In the SQL course, an API shapes one set-based query result into its response instead of querying once per row.
In Terraform: Every cloud is controlled through an API, and each Terraform provider is essentially a translator between Terraform and one API. Planning makes read-only API calls to refresh state; only apply and destroy make calls that change things.
In this course: Between services an API is a promise: which requests are accepted and which fields come back. Contract tests make that promise executable so a change on either side fails a test before it reaches users.

Related terms

Taught in

References

Certification courses