An application programming interface, or API, is a piece of code that allows two applications to share information.
A good example of an API is an aggregator site for hotel bookings. The aggregator site uses APIs to request information from different hotel chains in response to a customer’s request.
The API enables the information to be exchanged quickly and easily despite the aggregator site and the hotel system being built with different technology and by different companies.
In this scenario, the hotel is the API provider. It has built the API to enable other Apps to access the information. The hotel does this because it wants to make it easy for users to find out about its available rooms. The aggregator site is the consumer of the API. It uses the API because it would be either impossible or too much work to obtain the data it needs without one.
What can APIs be used for?
APIs exist wherever different pieces of software need to interact, and because making data available is good for business, many of them are free to use.
Blockchain, for example, provide free APIs that enable developers to access Bitcoin payment processing, wallet services, transaction data, and market data for use on their websites and applications.
Cryptocurrency exchanges also provide APIs. Traders can use these APIs to supply market data to trading bots, enabling them to make trades (according to preset instructions) on behalf of the traders. This form of trading is known as algorithmic trading (or bot trading).