What Is API || Why we use API

in Zero to Infinity2 years ago

image.png
Source

Today I will discuss what API is, and try to explain API with its usage and some examples.

Topics at a glance:
What is API?
Here are some examples of APIs
Use of API

There are so many programmers in this modern world right now. But it is not clear to many what API is, and when it comes to API development. Many people end up with the example of Google or Facebook API.
API's interest in software firms is palpable, but there is little response to API development at the varsity level. So about the API development of the newcomers.

"What is API?"

API is the Application Program Interface (API) through which a program can share some data [data] with another program.
So why do we need so much talk, why so much love between programs? Why should I share my program data or resources with other programs? Let's try to understand through examples and see if we can understand: MS Word to API to Printer.

"API Example"

image.png
Source

Suppose the Canon company made printers for printing but they did not make Microsoft Word or a text editor. So how will Microsoft Word print on that printer?

Surely there is a secret deal between Microsoft and Canon? If there is an auction, then what will Open Office or other editors, Google Chrome, or other programs do?
Or what would you do if you created an editor? There are many more printers besides Canon, and there are thousands of applications that can be printed from.
So how do these programs exchange information or functions with the printer? How can a program ask a printer to print a document?

API is nothing new. No application software has anything to do with Canon or any other printer. Both programs communicate using an interface or medium.
This medium is called API. When Microsoft commands print word, it requests the printer status from the API, and if all goes well, allows the API to print the document.
API asks the printer to print the document. The printer needs to know which program he is asking to print, the document is coming to him, and he will read and print it.

"Public use of APIs"

image.png
Source

Individual platforms are preferred by different types of users. Some people prefer to do most of their work on a smartphone while some on a PC. Someone using Android or iPhone or Windows, Firefox, Linux.
The use of smartphones is constantly increasing, as well as new OS. . Now if you want the system you build to offer to as many people as possible,
Then you must make your system suitable for multi-platforms.

Example: You create a daily accounting program that works on laptops, Android, and iPhones. Etc. and the accounting will always be updated on all devices.
At the same time, you will want to be able to easily integrate into a new operating system in the near future or re-develop your PHP web app in Angular JS or ASP.

image.png
Source

In this case, you can easily connect to a new frontend API and sleep peacefully. API is a lot of different functions in your body and body such as, walking, talking, feeding, sleeping, etc.
You look different in each dress from time to time. Whatever your dress or style, your inner workings are the same.
Since your system will do the same thing for Android, iPhone, and PC, you created a brain for all of them without writing a separate code for each, the technical name of which is API.
A lot of you cut off your head and added a few different styles of the body through the internet. Now if you bring any change in this brain then that update is going on all the platforms or your designated platform.

This means that the API does not just use Bigboss-Rai, because it is constantly used by developers, and its use is not limited to hardware and OS.

Examples of some APIs:

SOAP XML-RPC JSON-RPC REST, Access to the file system, Access to User Interface, Video Acceleration, Hard disk drivers, PCI Busses, etc.

Coin Marketplace

STEEM 0.20
TRX 0.13
JST 0.030
BTC 66976.31
ETH 3509.07
USDT 1.00
SBD 2.70