DEV Community

Cover image for API
Dantechdevs
Dantechdevs

Posted on

API

WHAT IS AN API?

A lot of people use the term API without knowing exactly what it means and what it is used for. We will debunk what an API is.

An API which stands for Application Programming interface is a mechanism which enables two software components to communicate with each other using a set of definitions and protocols. For example an app in your phone like a news app at any point in time contains the data about the latest news or even old news. This data is being served to your app by an API. So your phone talks to the servers containing the data via an API and shows you the latest news.

How do API’s work. API architecture is usually explained in terms of client and server. The application sending the request is called the client, and the application sending the response is called the server. So in the news app example, the news bureau’s database is called the server and the mobile app is the client.

There are four different ways that APIs can work depending on when and why they were created.
SOAP APIs
These APIs use Simple Object Access Protocol. Client and server exchange messages using XML. This is a less flexible API that was more popular in the past.
RPC APIs
These APIs are called Remote Procedure Calls. The client completes a function (or procedure) on the server, and the server sends the output back to the client.
Websocket APIs
Websocket API is another modern web API development that uses JSON objects to pass data. A WebSocket API supports two-way communication between client apps and the server. The server can send callback messages to connected clients, making it more efficient than REST API.
REST APIs
These are the most popular and flexible APIs found on the web today. The client sends requests to the server as data. The server uses this client input to start internal functions and returns output data back to the client.

Sign up now at orralearn.com to get started with your coding career and learn top in-demand skills like Python, android development, JavaScript and more.

Top comments (0)