Skip to content
Gallery
The "Explain it to Grandma" Series
Share
Explore
The "Explain it to Grandma" Series

icon picker
What are APIs and endpoints?

Last edited 490 days ago by Abigail Braiman
Hi Grandma! I miss you and hope you’re not freezing up in Upstate NY :) Spring is almost here, I’ll call you to say Happy Easter!

Today, I’m going to explain to you what APIs and endpoints are in software engineering. They are very important! You might remember the concept of an endpoint from geometry — for example, a line has two endpoints.

In order to understand an endpoint, we have to understand a thing it’s a part of: an API, aka an Application Programming Interface. It sounds really fancy, but it’s not that hard!

Imagine I’m taking you out to a fancy restaurant. You can think of an API like the menu — a list of things you can order. You can only order things that are on the menu from the restaurant — it’s the list of things you can ask for that they can provide. Now comes the ordering part. The waiter comes out to us, takes our order, and relays it back to the kitchen. The kitchen then makes our food and the waiter brings it back out. In software terms, the waiter is a call. The waiter is performing a specific request and response — taking our order and going to the kitchen, telling them what to make us, and bringing it back.

I’ll go a bit deeper. In this example, we, the diners, are the “client” (AKA what users of technology experience). The kitchen is like a server, and the ingredients they have are like a database. The call (waiter) goes from the client (us ordering) to the kitchen (AKA the server) which then does some fancy cooking using the materials it has (AKA the database). Then it gives the waiter back our food and the waiter brings it back to us. That’s how it all works end-to-end!

In this example, the endpoint is the kitchen door. It allows the waiter to go in and out with our orders. He can only bring certain things in and out: a list of the things we ordered, and out comes the food we ordered. It keeps it simple.

But sometimes, as the diners, we may want different things from the menu that require different endpoints. For example, when we order the meal, the waiter will go to get food. But if we order cocktails, he’ll need to bring us drinks, not food. This means he has to go to a different endpoint — one where he can go with the drink orders, and come back with our drinks. This endpoint might be the bar.

Even though the menu is the same, it’s important to have different endpoints here. Because if you just make one endpoint, that’s lumping a lot of things together! It would be like the waiter going to get our food AND drink orders at the same time, every time. If he takes our drink orders through the kitchen door, they’re in the wrong spot! The kitchen door is where you go in and out for food, and it causes confusion and extra work for the kitchen if you bring the drink orders there too. What’s more, is sometimes I don’t need all of these things at once. What if I haven’t finished my cocktail yet, and don’t need another, I just want dessert? In this case, I don’t want the waiter to bring back food AND drinks every time — I don’t need them both.

So this is an overview of APIs and endpoints. Love you!
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.