About API

Saritha
3 min readApr 27, 2021

What is API?

API stands for application programming interface. It allows two applications to communicate with one another to access data.

How does API work ?

An application programming interface is a set of rules that define how computers, applications, or machines can talk to each other. Most web APIs sit between the application and the web server. The API is the middleman between the application and the web server, and the API call is the request. And every time you use software to communicate with other software or online web servers, you’re using APIs to request the information you need.

For example, when you type a URL into the browser to visit a webpage, you’re effectively sending a request to a server for all the data needed to display that webpage. When you click play to start streaming video content, you send a request to a server to access a video file and start playing its contents.

Why API is Important?

APIs make development work easier. They offer businesses access to a vast array of resources and functionality, enabling them to add value to their applications and ultimately improve their profitability. Innovative use of APIs helps firms stand out from the crowd and gives consumers a compelling reason to choose them.

Types of API’s:

Open/Public APIs: There are no restrictions to access these types of APIs because they are publicly available.

Partner APIs: A developer needs specific rights or licenses to access this type of API because they are not available to the public.

Internal/Private APIs: These are usually designed for internal use within a company. The company uses this type of API among the different internal teams to be able to improve its products and services.

Composite APIs: API combines different data & service APIs to run sequence tasks and speed up the process of execution that leads to performance improvement.

Types of API Protocols:

To leverage all different types of APIs, we must follow certain protocols. A protocol provides set of rules for API calls. It specifies the accepted data types and commands. Let’s look at the major types of protocols for APIs:

REST (Representational State Transfer) is a web services API. REST APIs are a key part of modern web applications, including Netflix, Uber, Amazon, and many others. For an API to be RESTful, it must adhere to the following rules:

Ø Stateless : A REST API is stateless in nature, Client-Server Architecture.

Ø Uniform Interface : A client and server should communicate with one another via HTTP using URIs (Unique Resource Identifiers), CRUD (Create, Read, Update, Delete), and JSON (JavaScript Object Notation) conventions.

Ø Client-Server: The client and server should be independent of each other. The changes you make on the server should not affect the client and vice versa.

Ø Cache : The client should cache the responses as this improves the user experience by making them faster and more efficient.

Ø Layered : The API should support a layered architecture, with each layer contributing to a clear hierarchy. Each layer should be loosely coupled and allow for encapsulation.

SOAP is an envelope, which defines the message structure. SOAP (simple object access protocol) is a well-established protocol like REST in that it’s a type of Web API. SOAP has been leveraged since the late 1990s. SOAP was the first to standardize the way applications should use network connections to manage services.

But SOAP came with strict rules, rigid standards were too heavy and, in some situations, very resource intensive. Except for existing on-premises scenarios, most developers now prefer developing in REST over SOAP.

Originally published at https://www.numpyninja.com on April 27, 2021.

--

--