ELI5: What is an API?

Explained with a polite messenger

An API is like a polite messenger that takes a request from one place, delivers it to another place, and brings back the answer.

Imagine you are sitting at a table in a restaurant. You are hungry, and the delicious food is being prepared in the kitchen. However, you are not allowed to walk into the kitchen to cook the food yourself, and the chefs cannot leave the kitchen to talk to every hungry customer.

This is where the waiter comes in.

  • You look at the menu and choose what you want.
  • You tell the waiter your order.
  • The waiter walks into the kitchen and tells the chefs what to make.
  • When the meal is ready, the waiter brings the warm food back to your table.

In this story, the waiter is the API. The waiter connects you to the kitchen so you can get what you need without ever having to step behind the counter.

We use these invisible messengers all the time in everyday life without even realizing it:

  • Checking the weather: When you open a weather app on a smartphone, the app does not actually measure the wind or rain itself. It sends an API messenger to a giant weather station far away, asks "What is the temperature today?", and brings the answer right back to your screen.
  • Buying movie tickets: When you use a travel or entertainment website to buy tickets, an API dashes over to the cinema's computer system to see which seats are empty, reserves your favorite spot, and runs back to confirm your purchase.
  • Paying at a store: When an online store lets you pay using a service like PayPal, an API asks your bank if you have enough money to buy the toy, and tells the store it is safe to send your package.

In simple terms, an API lets two different things talk to each other and share information safely, making our modern world work smoothly together.

Ask your own question

Opens the question on the homepage. Nothing is sent until you press Explain it.

Follow-up questions

Test yourself

Three quick questions to see if it stuck. You can challenge a friend after.