What is an API?


What exactly is an API? API stands for Application Programming Interface. Perhaps some of you may have already used APIs in your software applications, which you may think that API is an already written piece of code dedicated to perform a specific task.

Yes it is, but hold on! The API itself gives the actual meaning when it is read backwards.  an Interface used by Programs to interact with an Application. Essentially, an API could be anything in any form that is used by 2 software components to communicate with each other.

Basically an API allows one application to talk to another, directly and securely.

Some important facts about APIs will be listed below,
  • No direct human usage of APIs. That is an API is normally invoked by some other code which is running on a computer. Normally this code is written by a developer to talk to the API.
  • APIs expose something useful.
  • You have APIs on your computer itself. (eg: when you type a key in the keyboard it gives the signal to the curl) - web APIs are just a subset of APIs.
  • Web APIs - APIs you can talk through HTTP

APIs vs Web Services

These 2 words are being used interchangeably, since a very long time. Normally, an API is a way of communication between 2 software components, A web service is also a type of  API, which enables 2 components on the web to talk to each other. 

That is in the web all the web services can also be named as web APIs. But in general, not every API is a web service.

When it comes to web services, HTTP is the most preferably used protocol in communication, but it also could use SOAP, REST and XML-RPC. In contrast APIs could use any means of communication between the software components.

REST API, What is it?

Though APIs are of two different types, namely SOAP (Simple Object Access Protocol) and REST    (REprsentational State Transfer), today almost all the APIs are REST APIs.

Because REST is easier to use, efficient and definitely more flexible compared to SOAP.

REST works very much similar to a web site, it makes a call from a client to a server and get data back over the HTTP protocol. Here the client says the service provider , which operation it wants to perform and what data to operate on.

Comments

Popular posts from this blog

Microservices

API Gateway