What is an API?

Platforuma India
2 min readJul 27, 2021

API stands for Application Programming Interface.

Yeah! Whatever.

OK, in simpler terms,

An API is any tool that helps connect your program to someone else’s program.

However, this is a vague definition because an API can do multiple things, but just to put it in simpler words this is it.

The restaurant analogy

The Restaurant Analogy

In this analogy customer is a client, and the kitchen is a server. Waiter/Waitress is analogous to the API who receives the order from the clients and serves their food. Here receiving an order is analogous to the client request and serving the food is analogous to the server response.

I hope this analogy makes you understand the basic concept of API and not confuse you.

Things an API can do

  1. Getting data from a server

The server hosts “an API” — exposed “endpoints” which we can access for getting data from the server. Note that the server doesn’t give us access to everything, just the things they want us to have.

2. Accessing pre-written code that does cool stuff

let us start with an example the methods we use for DOM manipulation in javascript are APIs which let us use the pre-written code of javascript to do some cool stuff such as ‘getElementById’ is an API that gets the HTML element with an ID you pass in the method. So in the case of APIs, we don’t need to know how it’s doing what it’s doing. We only need to know what it can do and use it at our convenience.

Here is the link to the MDN page for Web APIs, which you can visit to learn more about the web APIs.

This is my first blog of a series on API. If you found it useful then please hit the 👏🏻 clap button or leave a comment💭.

Try this, press and hold the clap button and see the magic.

Visit Our Website:

https://platforuma.com/

Author: Devendra Patidar

Originally published at https://medium.com on July 27, 2021.

--

--