DEV Community

Gaurav Sharma
Gaurav Sharma

Posted on

1 | What is an API

šŸ“˜ Understanding What an API Is

šŸ”¤ The Meaning of API

Let’s go over the definition of what an API is. API is an acronym. An acronym means a bunch of letters, and those three letters in API are A, P, and I. Each one of these letters stands for a word:

  • A stands for Application
  • P stands for Programming
  • I stands for Interface

🧠 Breaking Down Each Word

🧩 Application

Now, what does each one of these words mean?

Application means a piece of software that does a task.

For example:

  • eBay has software that sells you items.
  • Pandora plays music.
  • WAZE provides you with directions.
  • Skype provides you with conversations.
  • Google provides you with search results.

These are examples of pieces of software that do tasks for you.


🧠 Programming

And how do they do these tasks?

They do these tasks through programs. So, programming is the program that does the task within the application.

For example:

  • The Pandora application uses a program to play music for you.
  • It doesn’t just do it by itself—you have to run a program, the ā€œplay musicā€ program, to play the music for you.

🧠 Interface

And lastly is interface.

Now, what is an interface?

Interface is a place where you can tell that program to run within that application.


šŸ“± Examples of Interfaces

So what are examples of interfaces?

Well, on your cell phone, you have apps—and each one of these apps is actually an interface. Think about it.

For example:

  • I have the WAZE app that provides me with directions.
  • By using this WAZE interface, when I click on this app, I use this interface that tells a program to run in the WAZE piece of software.
  • That program will give me back directions.

Another example:

  • Google Translate.
  • I have it here—this is my interface, the Google Translate app.
  • I put in a word and say I want it translated in Spanish.
  • That word then gets sent to a program in a Google server somewhere, and that program sends me back the translation.

So each one of these is actually an API interface. Interface is a place where you tell the program to run. And here’s a place where we can tell the program to run for us.

This is an example on my cell phone.


šŸ’» APIs Beyond Mobile Phones

But there are other examples of APIs—not just on your cell phone, but everywhere.

For example:

  • If you have a computer and you want to do a Google search, you have the interface that is the search page—the Google search page.
  • From this interface—the Google search page—you tell Google (that is, the Google application) to run a program which does the search for you and provides you back the web page with results.

šŸ”„ Reversing the Acronym: IPA

You can look at it not just as API but as IPA—look at it the other way around.

If you look at it the other way around and start with the interface:

  • You start with the Interface (I), and at the interface is where you tell a Program (P) to run in an Application (A).

Right?

So that’s what an API is.


🌟 What Makes APIs Great?

āœ… 1. You Don’t Have to Write the Program

What are the advantages of APIs? What makes them so great?

Because they are great.

Well, first—you don’t have to write the program. You just use it.

Alright?

For example:

  • I have my Pandora app to play music here.
  • Here is my interface right here to tell Pandora to play music for me.
  • And I don’t have to write the program to play music.
  • I don’t have to pay the artist fees.
  • I don’t have to do any of this.
  • All I have to do is just say, ā€œHey, run the program to play music.ā€

🌐 2. Platform Independent

Let’s look at another reason that makes APIs great: it’s platform independent.

In other words, you can run this interface from anywhere.

For example:

  • I could download this Viber app on my cell phone.
  • I could also download the same Viber interface on a Windows computer or an Apple computer.

So whatever platform you’re on—whether it’s a cell phone or it’s a computer or whatever it is that you have—you can still run this program.

You just tell the program to run.

So it doesn’t depend on where it’s coming from.

You just tell it to run.


šŸ”§ 3. Upgrade Safe

And the third thing that makes APIs great is that it’s upgrade safe.

You don’t have to worry about the upgrades because technology is going so fast.

This cell phone is going to be—say—it’s new today, in two years it’s going to be old. Right?

That’s how fast it’s going.

They need to upgrade the program.

You don’t have to worry about that.


šŸ§‘ā€šŸ’» A Note on API Usage in Tech

Now, one more thing I would like to go over is that when people talk about APIs, they’re generally not talking about simple APIs.

Now, these are all APIs—Application Programming Interfaces.

These are places where you tell a program to run in a piece of software.

However, when people talk about APIs, they’re generally talking about going to the interface where the server is located that runs the program.


šŸ–„ļø Server-Based APIs

For example:

  • This Google Translate app—it’s real easy to use because the interface here is located on my cell phone.
  • But when people talk about APIs, they’re generally talking about this interface not located on my cell phone.
  • I would have to—if it’s the Google Translate—go to the Google server and call the interface at the Google server.

And the reason why they say APIs have to be located at the server level is because in the technology world, unfortunately, we have a lot of geeks and we want to try to make it complicated.

But it’s not really complicated.


šŸŽ‰ Final Thoughts

APIs are great, and I’m excited that you’re learning about them.

They allow you to interact with powerful programs without needing to build them yourself.

Whether on your phone, your computer, or through a server, APIs are the bridges between you and the software that gets things done.


Top comments (0)