An API, which stands for Application Programming Interface, is a simple bit of programming code that allows applications to communicate with one another using data transmission. APIs are not a kind of server but a set of standards that either permit or deny requests during data exchange by governing the access points of a server.
Think about a backend application that we want to connect and communicate with and a user who will use another application as his proxy. In this case, the API is the messenger between the user and the backend application. It delivers requests from the user to the servers and responds to the server to the user. The response format is a dataset, likely in JSON or XML.
Types of APIs
It is a software architectural style created to guide the design and development of the architecture for the World Wide Web. It is stateless and separates the concerns of the client and server.
> Service Object Access Protocol (SOAP)
It is an XML-based protocol for accessing web services over HTTP. It is used to accomplish data exchanges between heterogeneous applications like web applications designed in different programming languages. The information is delivered by using XML (Extensible Markup Language) as an intermediate language of data exchange between the different applications. Like REST it is also designed to work over HTTP but it differs because of using only CML as data format.
The current trend in the industry is largely toward REST APIs and away from SOAP-based APIs.-
These application software interfaces, also called public APIs, are publicly available to any software developer. The Open API Definition suggests that all features of such an API are public with relatively few restrictions. Restrictions might include the necessity to register with the service providing the API.
> Private APIs
These APIs are providing an interface that opens parts of an organization’s backend data and application functionality for use by developers for improving solutions and services within an organization.
Examples of API usage
There is a wide range of companies that are using APIs for their operations.
One common usage of APIs is the Online Payments Systems. For example, PayPal is a well-known organization that utilizes a collection of APIs to transfer the user’s money.
Another technological sector where there is high usage of APIs is in Analytics. For example, a very famous service known as “Google Analytics” is part of the used by many people platform called “Google Cloud API” where the most used part is the Management API and the Core Reporting API.
Pros and Cons of consuming APIs
You don’t have to know all the structure of the system you want to get some data. You only have to use the documentation to identify which endpoint of the API could provide you with the appropriate information.
Because of the response format, a REST API seems to return all the information needed without any extra load of unnecessary metadata or repetitive descriptions
It is pretty clear that when we have to consume a web service that may be public, the performance is affected by many factors such as user load, network performance, and packet size.
Because of the predefined routes that we have to use to get data we can’t create a response based on our needs if it is not provided as an option from the API.
To sum up
As mentioned above, using a rest API for getting data from a third-party system is the best practice if it meets your needs. Also, it is the fastest implementation because of the easy installation. But if you need more customized data and without the risk of performance instability maybe you have to avoid this solution.
Giannis Simantirakis, Business Intelligence Consultant, WITSIDE