Consuming APIs — Explained to my Grandma

Brennen Awana
2 min readJul 10, 2016

--

*Originally published on July 7, 2016

API Basic Concepts

Me: Okay Grandma, imagine that you just fired up Yelp, and now you’re looking for a pizza place. So you do a search for your area and you see a big list of restaurants with addresses, phone numbers, user reviews, pictures etc.

Grandma: Okay, I can imagine that.

Me: Now, that’s a lot of information, and it all has to be organized in such a way that is easy to retrieve and display for us right? That’s where API’s come in

Grandma: Oh okay, so sort of like my box of recipe cards? I’ve got hundreds of recipes and there all cataloged by the type. Under my desserts tab I’ve got tabs for cakes, pies and muffins which then have specific types of cakes like red velvet and -

Me: Exactly, that’s a good way of thinking about it. You’ve set up a system for yourself where you can access specific points of information within a vast database.

Grandma: — and for each card it tells you the ingredients, and how much of each, and how long to cook it, and all the instructions.

Me: You got it. Now what if this recipe box of yours had so many nice recipes, that you were asked to make that information available to millions of people to use?

Grandma: Well I’d be honored.

Me: Yes, and we would need to think about a way to organize the recipe box so that anyone who uses it can follow an easy system in order to quickly get any information they want.

Grandma: Of course, and we would need to make sure vegetarians, vegans, gluten-free and peanut sensitive people have their own list so they don’t have to read through everything to find something they can cook!

Me: Yes of course! That’s very nice of you. Also consider the fact that eventually people would like to contribute their own recipes to this box, or even compile their own cookbooks of specific recipes from our box. We would need to set up a system that everyone follows so that everything stays organized and it’s easy for everyone to use.

Grandma: Well this all sounds very nice and friendly.

Me: It really is. So API’s are used in a few different ways. For example: If your recipe box has a top-secret garlic bread recipe that no one else should know about, then you need to keep that protected and inaccessible from the public. So that would be like a private API, only to be used within your organization.

Grandma:

Me: The trend of making public API’s available to the public has proven it’s benefits in a variety of ways. It’s more efficient, allowing a wider audience to be reached, it encourages partnerships and integrations with other services and it also better prepares the application for future scaling and changes and technology.

Grandma: Well now, if these computer geniuses would have just looked at my recipe box 40 years ago we would have flying cars and time travel by now!

--

--