Application Programming Interface (API)

Gepubliceerd op 30 juli 2023 om 09:30

API is the acronym for Application Programming Interface. This is a software intermediary that allows two applications to interact with each other. Each time you use an app like Facebook, send an instant message, or check the weather on your phone, you're using an API.


What is an API?
API stands for Application Programming Interface and is a technique that allows developers to link two applications together. This seems obvious, but it is not.

Every application works in a different way. This is because applications are often built by different developers. Each developer uses a different programming language and programming style.

This can be compared to two people speaking a different language. An interpreter is needed to translate. In this way, the two people can communicate with each other. You can connect two people with each other. 

So an API is very similar to an interpreter. It is an application that stands between two applications and ensures that the communication between these two entities is correct.

When you use an application on your cell phone, the application connects to the Internet and sends data to the server. Then the server stores and processes the data and performs the necessary actions and sends it back to the phone. The application looks at the data and shows you the information you had requested. This is in fact what an API is.

Your phone is never fully exposed to the server, nor does the phone have full access to the server. Only necessary bundles of data are sent that are required for communication between the two systems. Check the video below!

Why are APIs useful for developers?

Building apps faster
When a developer wants to use certain data or certain features within his application, he can develop them himself. But that takes a lot of time and effort. It is a waste to spend time and effort on this when someone else has already built this functionality. 

Automation
When you can link applications through APIs, you can automate tasks. For example, it is possible to link a crypto exchange to your trading bot. The trading bot can automatically execute trades on the crypto exchange. And this all happens completely automatically, without you having to do anything else for it.

Use cases
APIs make consumers' lives easier. Consider the example of airline ticket comparison websites. These kinds of websites would not exist if we did not know about APIs. Therefore, we can say that APIs create interesting new products and solutions.

Different types of APIs

  • Java APIs - These are program-oriented APIs and focus on real software applications that you need to install on a device.
  • Simple Object Access Protocol (SOAP) APIs - The SOAP API is used for communication between applications or system components. A SOAP API sends XLM messages over protocols such as HTTP, HTTPS, JMS, FTP and SMTP.
  • Remote Procedure Call (RPC) APIs - An RPC API can be used to execute code on another machine. This way, the developer does not have to move this code to his own or other machine first.
  • Representational State Transfer (REST) APIs - The REST APIs are the most popular and well-known. They are used by Web applications to quickly and easily retrieve data via URLs. 

APIs within the blockchain world
Even within the world of blockchain and crypto, we have APIs. Without these APIs, decentralized applications and cryptocurrencies would look very different. API3 is a project that aims to establish decentralized APIs.

API3
API3 is a protocol that provides for the creation of decentralized APIs (dAPIs) for Web 3.0. It aims to develop powerful dApps that can use decentralized, secure and measurable data feeds.

Oracles
Decentralized APIs must use oracles. Blockchains oracles are techniques that verify data from central systems before moving it to the blockchain. So basically, for example, data from Google is loaded into the blockchain.

Suppose a dApp needs the data from a weather station. The dApp needs to be sure that the data being supplied is correct, and no one is intentionally supplying wrong data.

One can then use an oracle where nodes provide the data. Other nodes can verify that the data is correct. If a node feels that it is not quite correct, that node can raise it within the blockchain network. Then all nodes will vote on the problem. If it turns out that the node in question has indeed provided incorrect data, then this node can be removed from the network.

APIs and blockchain bridges
Sometimes people think API is the same as bridge. They are very similar, yet they are very different from each other.

A bridge is a technique that links blockchains together. Normally, blockchains cannot work together (no interoperability). Each blockchain is built in a different way so they are not interoperable with each other.

Developers benefit greatly from blockchains that can interoperate with each other. For example, they can use dApps running on other blockchains and move tokens between blockchains. That's why there are blockchain bridges. These can be seen as "bridges" between different blockchains.

Often, such a bridge requires a protocol to be built on both blockchains. When someone wants to send BTC from the Bitcoin blockchain to the Ethereum blockchain, a protocol on the Bitcoin blockchain holds the BTC. It then issues a wrapped BTC token on Ethereum that has the same value. So in this way, such blockchains can interact with each other.

An API works quite differently. In fact, an API allows you to use another application directly. However, the developer of the application must himself add this function to his underlying code and application. Only then can other developers use the API. 

Reactie plaatsen

Reacties

Er zijn geen reacties geplaatst.