API

An application programming interface, or API, specifies how software can request work or exchange information with other software. It describes available operations and how to use them. APIs can be local library interfaces or remote service interfaces; they are not limited to web requests.

The agreement includes failure

Imagine a recommendation API that accepts a customer identifier and returns an ordered list of product identifiers. The caller needs to know required fields, response structure, access requirements, and possible errors. A response containing an empty list has a different meaning from a request that timed out.

An HTTP API may expose operations through addresses called endpoints. The API is the broader interface agreement; an endpoint is a particular access point. MDN's API definition covers the general software-interface concept.

A stable shape can still change meaning

If a returned score changes from purchase probability to a ranking score, retaining the same numeric field does not preserve its meaning. Document semantic changes as well as structural ones, and plan compatibility for existing callers.

For operations that change state, callers also need to know whether retrying can repeat an effect. An API call succeeding confirms only the operation's stated behavior; it does not prove that all downstream business processes completed.

Reference: MDN: API.


Discover more from Insightful Data Lab

Subscribe to get the latest posts sent to your email.

Similar Posts

Questions, corrections, or additional insights?

This site uses Akismet to reduce spam. Learn how your comment data is processed.