DEV Community

Cover image for API for Newbies
Emma Odia
Emma Odia

Posted on • Updated on

API for Newbies

Spare me the technical jargons please!

So in this article I'm going to answer questions that as at when I was a Junior Dev I did not have any answers to. I wish someone had made a post about it when I started out. So here I am and the goal is simple: Explain what an API is in non Dev Talk, so help me God!

"Everything Should Be Made as Simple as Possible, But Not Simpler"
Albert Einstein

In this article we will take an approach of asking questions and then providing answers which should be sufficient enough to answer the question without any loss in explanations or meaning.

1. Is an API a piece of Software?

Answer: There is this common misconception about what an API really is even after you have read the definitions on Wikipedia and all other sources that first begin with the Keyword definition: Application Programming Interface. Emphasis on Interface here that often causes a confusion not to mention the use of examples like Twitter API, YouTube API, Facebook API and APIs made by tech giants and then as a noob there’s this misconception associated with such thinking that APIs are made by the Tech Giants ONLY!

Well with this one question, I will provide three answers. As there exist two unasked questions given this one. The other two being:

1a. Can I build my own API?

1b. Can other people use my API as well?

An API is basically a piece of Software like an APP running on your Phone or a Website.

Before the “Senior Engineers” call this misleading, please remember that I said at the beginnig that this will be a non technical explanation!

Here’s a visual representation that explicitly explains in steps:

App Hosting Servers


Use the image as a Visual guide

At this point it is safe to resort to using an Analogy to explain the answer and thereby give it some depth.

Yes, I compared an API to an APP on Mobile or a Website. Now to be explicit:

Both Apps run (are hosted) on a server before you can have access to use. The App has a code base which may be (or not) split into the front-end and the back-end. You do not see and maybe are not interested in the logic (code) that causes this app to run. You have it as a complete Software that you can access! An API is basically the same, it is a piece of Software hosted on a server that you can access for a myriad of reasons and usage.

Yes, you can build one! Simple enough answer! In a follow up article to this one I will teach you how to build an API using ExpressJS on Node with either MongoDB or PostgreSQL and you will push out to a server and have others use it. Watch out for this article. Like the Big Tech Giants, other people can use your API as well. The beauty here being that, they can use (consume) it on either Desktop or Mobile.

App Hosting Servers


You can host your app on a server and make it live!

In closing this is what I wish I’d known when I started as a Junior Engineer and the buzz word was often thrown around and I felt dizzy when I discovered big tech companies where the ones who had APIs publicly available. Well, there, this is one of the many ways that it be made into simple language for non techie. If you have more questions, concerns or simply want to add your thoughts to this conversation, please you are kindly welcome to that in the comments section. Also be on the look out for the follow up articles where I build an API and walk you through the entire process so that you can begin building some yourself.

Top comments (5)

Collapse
 
dfeuster profile image
Daniel Feuster • Edited

Another analogy would be a restaurant as the application, the staff is the API.

1) Guest enters the restaurant(hereto-for called App).
2) The Hostess/Host requests info from the guest: How many in your party?
3) Then the Host reviews current seating and availability and suggests a short wait before a table is ready.
4) The Busser rushes out to clear a table and reset it for the new group of Guests.

etc. etc. Sometimes this is how I see the world, as a complex group of APIs I have to interact with/consume.

Collapse
 
emma_odia profile image
Emma Odia

Yes. This is a very good analogy!

Note forgetting to mention that the food is json responses! Lols!

Thank you for the comments.

Collapse
 
dfeuster profile image
Daniel Feuster

Yes, exactly! The Busser is identifying the stuff that needs to handled by the Dishwasher(garbage collector). The world is an endless analog for programming.

It's fun to come up with the algorithms at a restaurant in pseudo code while getting lunch!

Collapse
 
thomasjunkos profile image
Thomas Junkツ

APIs are like Post Office counters:

You could get things or you could deposit things for others; you could talk to someone doing something on your behalf.

Collapse
 
emma_odia profile image
Emma Odia

This is a clear analogy!

What could be conflicting about this is that individuals cannot OWN nor build Post Offices though... Lols.

Nonetheless, it puts it in context in terms of sending and receiving data.

Thank you for the comment.