What is an API?
Understanding application interfaces

Buzz presents
an API is like a friendly waiter carrying orders between you and the kitchen!! once you see it, it's sooo simple.an API is like a friendly waiter carrying orders between you and the kitchen!! once you see it, it's sooo simple.

You use APIs every single day and probably have no idea. Checking the weather on your phone, paying for something online, logging in with your Google account... an API is doing the work behind the scenes every time.
API stands for Application Programming Interface. Sounds like something an engineer made up to scare people off (and honestly, maybe). It's actually simple. An API is just a way for two computer programs to talk to each other.
The Restaurant Analogy#
Think about eating at a restaurant. You don't stroll back into the kitchen and cook your own food. Here's how it goes instead.
Step 1. You Look at the Menu#
The menu shows what's available. You pick what you want.
Step 2. The Waiter Takes Your Order#
The waiter is the middleman. They carry your request back to the kitchen.
Step 3. The Kitchen Prepares the Food#
The kitchen does the work. You never see how they make it.
Step 4. The Waiter Brings Your Food#
The waiter delivers the result back to your table.
An API works the same way.
- The menu = the API documentation (what you can ask for)
- The waiter = the API itself (carries requests and responses)
- The kitchen = the server (does the actual work)
- Your food = the data you get back
How It Works Visually#
Here's what happens when you use an app that calls an API.
You App API Server Database
| | | | |
|--"weather"-->| | | |
| |---GET /weather------->| |
| | |---------->| |
| | | |--query--->|
| | | |<--data----|
| | |<---JSON---| |
| |<----58°---| | |
|<--display--| | | |
| | | | |Same as the restaurant. You don't see all the steps happening in the kitchen... you just get your result!
Real Examples of APIs#
Here are a few APIs you're probably using without realizing it.
Weather Apps#
Your weather app doesn't own weather stations all over the planet. It calls a weather API instead. The app sends your location, and the API sends back the forecast. That's why a bunch of different weather apps can show you the exact same data.
Payment Systems#
When you buy something online with your credit card, the website calls a payment API (like Stripe or PayPal). The API handles all the complicated money stuff. The website just sends "charge this card $25" and gets back "payment successful."
Social Logins#
Ever clicked "Sign in with Google" or "Log in with Facebook"? Yep, that's an API. The website asks Google or Facebook to confirm who you are, and Google sends back your basic info. You get to skip making yet another account.
Maps#
Tons of apps show maps, and most of them didn't draw their own from scratch. They use the Google Maps API or Apple Maps API. The app asks for a specific location and the API sends back the map data.
Why APIs Matter#

APIs are what make modern apps possible. Picture a world without them.
- Every weather app would need its own weather stations
- Every shopping site would need to build its own payment system
- Every service would need you to create a new account
- Developers would waste time rebuilding things that already exist
I'm not a developer, by the way. I'm an operator who came up through SEO and local marketing. And APIs are a BIG reason someone like me can build real software at all, because I get to plug into stuff other people already built.
What Data Looks Like#
When programs talk to each other they need a shared language. APIs usually send data in a format called JSON. You'll dig into it in a later lesson, but here's a quick taste.
Ask a weather API for the forecast and it might send back something like this.
{
"city": "Seattle",
"temperature": 58,
"condition": "Cloudy",
"humidity": 72
}That's data your app can actually use. It's organized and predictable, and every time you ask for the weather you get the same kind of response back.
Types of APIs#
APIs come in a few different styles, but the most common one today is called a REST API. REST stands for Representational State Transfer (you can forget that immediately, I won't tell). Just know that when people say "API," they usually mean a REST API.
REST APIs run on the same tech as websites. They work over the internet using web addresses (URLs) and standard web methods (like GET and POST). We'll get into those in the next lessons.
TL;DR#
- An API is how computer programs talk to each other
- It's like a waiter in a restaurant who takes your request and brings back the results
- You use APIs every day for weather, payments, logins and maps
- APIs let developers build on existing services instead of starting from scratch
- Most modern APIs use a style called REST
What's Next?#
Now that you know what an API is, let's look at HTTP methods. Those are the different ways you can ask an API to do stuff, like grabbing data or saving something new...
This lesson ends with a short activity.
