What are API’s? How do I use them?

Garrett Dick
4 min readNov 23, 2021
Server Response Cycle

By now, I am sure you have heard the phrase “API” whilst browsing the internet. It seems to be the one of those tech ‘buzz’ words that you are bound to come across, but what does it mean, and why does it matter? What impact does it have on me?

Well the truth is, if you have spent at least .000001% of your time on the internet, you have most certainly came across, consumed and used and API. These things are EVERYWHERE and will only become more and more prevalent as we march forever forward our technological future.

What is an API? (A brief history…)

API stands for Application Programming Interface, and this interface is what allows you to send and receive information all across the web. The web API as we know it came to be via a dissertation from Roy Fielding. In this early 2000’s dissertation, Roy broke the idea of a “network-based Application Programming Interface” — which at that time, contrasted the traditional thought of “library-based API’s”.

This idea took hold, and we saw wide spread adoption of XML and JSON web APIs which has propagated into the internet we know and love today.

How does it work?

Probably the best and most straight forward way to think of an API is to think of a restaurant (stay with me on this one…) However, before we get started, we need to talk about the “Request Response Cycle.”

To catch the gist, the picture below high level view of the Request Response Cycle.

Request/Response cycle
Request/Response Cycle

As you can see, there are four parts to the cycle:
(1)You, the client, search for cute kittens on google.
(2)That ‘request’ is then sent to the google servers.
(3)The google servers then find the best and cutest kittens, and then (4)‘returns’ that curated, adorable list back to you, the client.
This cycle continues over and over again as we use the internet. OK! Back to the restaurant…

For the sake of this example and simplicity, we are going to say that the restaurant has three primary components:

The kitchen
The waiter
And you

The kitchen is where all the “magic” happens. It is the ‘server’ in the Request/Response cycle. This is where your food is prepped, cooked, and plated — ready to be brought back to you to eat! Just like the server found all those cute kittens for you ❤

You, you are the client! You are the person entering the restaurant, being seated, and then browsing the menu. Without your input, the waiter would have no orders to send to the kitchen, and the kitchen would have nothing to cook. If you think about it, you are kind of what kicks off the whole cycle in the first place!

And now, the waiter. Ahhh, yes, our API has arrived! In this example, the waiter best describes what an API does, and is.

Your API

The waiter is the person who waits on you to decide what you want, then takes that order from you and sends it to the kitchen. At that point, the kitchen takes that order (or request) and then prepares whatever you ordered. Once that has been completed, the kitchen then sends your food (or response) back via the waiter (or API)

The API, just like our waiter, is the middle man. The kitchen cannot get your order without it, and you wont get your tasty meal either!

Wrapping Things Up

In conclusion, API’s are simply the middle man between you and the content/data that you want. They use defined routes to target your queries and ensure that they are sending and receiving the correct request and responses.

Could you imagine a world with out APIs? The internet as we use it today would be dramatically different. On the same coin, imagine a restaurant without a waiter… You would have to sit down, browse the menu, then walk to the the kitchen, prep and cook your own meal, then walk it back to your table! And what if you cant cook??

Self Esteem Leveler

API’s make the request/response cycle possible, and efficient using routes and Hyper Text Transfer Protocols(HTTP). They stream line our experiences on the web and help us get the most out of whatever query we pass into Google.

--

--