What is an API ? | Making Things Easier for Developers
Have you ever heard the word “API” batted about, and wondered exactly what an this is? Do you have a vague idea, but want to know more about what you might do with an API, and how you might build one?
Here i have an example to understand API…
When you type www.facebook.com into your browser, a request goes out to Facebook’s remote server. Once your browser receives the response, it interprets the code and displays the page.
To the browser, also known as the client, Facebook’s server is an API. This means that every time you visit a page on the Web, you interact with some remote server’s API.
An API isn’t the same as the remote server — rather it is the part of the server that receives requests and sends responses.
But why would we need an API?
Imagine the following scenario: You (as in, your application, or your client, this could be a web browser) wants to access another app’s data or functionality. For example, perhaps you want to access all Twitter tweets that mention the #IoTbyHVM hashtag.
You could email Twitter and ask for a spreadsheet of all these tweets. But then you’d have to find a way to import that spreadsheet into your application; and, even if you stored them in a database, as we have been, the data would become outdated very quickly. It would be impossible to keep it up to date.
It would be better and simpler for Twitter to provide you a way to query their application to get that data, so that you can view or use it in your own application. It would stay up to date automatically that way.
An API brokers access to a different application to provide functionality or access to data, so data can be included in different applications.
What is an API?
API stands for Application Programming Interface.
According to Wikipedia, the definition of API or Application Programming Interface is as follows:
“In computer programming, an Application Programming Interface (API) is a set of subroutine definitions, protocols, and tools for building application software.”
To put it simply, an API is to a developer what a GUI is to a computer user. A Graphical User Interface lets you interact with the computer, without actually having to know what happens behind scenes for each and every task you do. It makes things simple for the user by providing buttons, search boxes, a cursor and much more.
An API does the same thing for a developer. It is a set of protocols defined to facilitate communication between software and different software components. It is a complete building block that can be used by a program to complete his programming without having to write a code for every small thing. Not having an API, would have made coding so much more complex and tedious than it already is.
It also helps that an API can help programs in different languages communicate with each other. Otherwise, how could the world stay so effortlessly connected? It would be nearly impossible to restructure every software application or program or piece of code, to be universal, or capable of universal communication.
It is the API that helps developers to interact with other software, and thus eliminates the need for a universal programming language or a universally accepted communication protocol.
It is what makes a library in one language available to a developer coding in another language. It is what helps your computer software to interact with your smart devices. It is also what helps online information aggregator to interact with different websites to present you with a consolidated list. In short, though not appreciated, an API is what helps the world stay connected.
Types of APIs
There are numerous types of APIs. For example, you may have heard of Java APIs, or interfaces within classes that let objects talk to each other in the Java programming language. Along with program-centric APIs, there are also Web APIs such as the Simple Object Access Protocol (SOAP), Remote Procedure Call (RPC), and perhaps the most popular—at least in name— Representational State Transfer (REST).
Application Programming Interface plays a key role in IoT application development. With Application Programming Interface we can make IoT product /Application more Smart with new integrations.
Thanks for reading. If you like this post probably you might like my next ones, so please support me by subscribing my blog.
ESP8266 Tutorials | NodeMCU Programming | Arduino IDE