Tech, ExplainedNetworking, infrastructure and security
Concept

APIs

How one program asks another for help.

HOW IT WORKSThe owner of a servicepublishes what may beasked and howA developer writes aprogram that sends arequest as describedThe service checks whois asking, often witha secret keyThe servicedoes the workIt sends back a replyin a fixed formatThe caller needs to know only what to ask and what comes back, not how the service works inside.HOW IT WORKSThe owner ofa servicepublisheswhat may beasked and howA developerwrites aprogramthat sendsa requestas describedThe servicechecks whois asking,often witha secret keyThe servicedoes the workIt sends backa reply in afixed formatThe caller needs to know only what to ask and what comes back, not how the service works inside.HOW IT WORKSThe owner of a service publishes what maybe asked and how↓A developer writes a program that sends arequest as described↓The service checks who is asking, oftenwith a secret key↓The service does the work↓It sends back a reply in a fixed formatThe caller needs to know only what to ask and what comesback, not how the service works inside.
A program sends a request in a published format to another program, which checks it, does the work and sends back a reply in a fixed format.
opens a page inside this one a page in the same scene a page in another scene a concept page a label only, with no page

APIs are the way one program asks another program to do something. API stands for application programming interface. A weather app asks a weather service for tomorrow's forecast, a shopping site asks a payment service to charge a card, and a bank app asks a telecom service whether a SIM was swapped. In each case, one program sends a request in a fixed format and receives a reply in a fixed format.

Here is how it works in general. The company that owns a service decides what others may ask for and publishes the rules: the address to send the request to, the details to include, and the form of the reply. This published description is the API. Another developer writes a program that sends requests as described. The service checks who is asking, often with a secret key, and then does the work and replies. A developer never needs to know how the service works inside, only what to ask and what comes back.

A few terms help. The address a request is sent to is called an endpoint. The reply carries a status number: 200 means success and 404 means not found. The data is usually in a text format called JSON. Services limit how many requests one user may send in a minute. The owner may change the API over time, so it is given version numbers, and old versions are kept for a while. An API is also a door into the service, so keys, limits and checks must protect it. In India, apps reach UPI through APIs in the same way.

Take, for example, an app that sends one-time passwords. It sends a request to an SMS service with the phone number and the message, and the service delivers the SMS; see messaging and voice APIs. Consider a delivery app that asks a map service for the road distance between two places; see location platforms. Say a lender asks a telecom operator whether the phone's SIM was changed in the last day; see network APIs.

APIs are listed and tested with API workspaces and API testing, described with API descriptions, and protected by API gateways and API protection. Companies that sell their service as an API are described in renting the backend.

How is it different from a user interface? A screen is made for a person to read. An API is made for another program to call.

Appears in

Networking, infrastructure and security
Cloud platforms and developer tools
Enterprise SaaS and software
Fintech
Healthtech and life sciences
Industrial tech and mobility
Tech, Explained is a part of ingrid.fyi. Every page explains one piece of technology in plain words.