Skip to content
explainroo

What an API does

An API is how one program asks another for something, shown with an online shop that asks a shipping service for a delivery date.

Transcript

Programs often need something from another program. The way one program asks another for it is called an API.

Say you buy a lamp from an online shop. At checkout, the page shows when it will arrive. To get that date, the shop asks a separate shipping service.

The shop’s website sends a request to the shipping service, using its API. It says where the package starts, where it goes, and how heavy it is.

The shipping service works out the date on its own computers. It sends the answer back, and the checkout page shows the date.

The shipping service decides what the shop can ask and what the answer looks like. The shop follows those rules and never sees how the shipping system works inside.

Every request also carries a key, a long code the shipping service gave the shop. The key tells the service who is asking. Then it can check that the shop is allowed to ask, and count how often it asks.

So, an API is how one program asks another for something. A request goes out, and an answer comes back.

More from business and software