What is an API? Explained in simple terms

What is API and why is it so popular among programmers, not everyone can explain what an API is, but everyone uses it.

Maria Gusarova
4 min readJun 20, 2022
Image by author

An application programming interface(API) is a connection between computers or between computer programs. (ref.)

In a more simple way — API is a set of ways and rules for interaction and data exchange between different programs and computers. The API is used for other programs and information systems where information is exchanged in a strictly specified format, which allows systems with completely incompatible configurations to interact (written in different programming languages, located locally or remotely, etc.).

Example: You are in a restaurant. You are a client, you choose an order from the menu. The kitchen is the executor of your order. You need an intermediary who will report the order to the kitchen and delivery your food to your table. It could not be a chef because he is busy cooking in the kitchen. You need someone to connect the client and the chef. And here the waiter could help us — API. The waiter takes your order, report it to the kitchen and then delivers the answer, or food to you.

Drawing by the author using free icons

One more real simple example is a quick registration on a website using a social media account. The application can use the social network API to provide the user with simplified access. This is possible thanks to the APIs that Google, Facebook, Apple, Twitter and other companies have.

Join Medium page screenshot

To put it simply, using the capabilities of the API is like hiring a freelancer to work remotely. One application instructs another to do the necessary work, and its product is provided as its own.

Why is an API called an interface? An interface is like of boundary between two programs, through which they can exchange information and perform functions related to each other. But at the same time, the processes occurring inside each of them are out of reach to another program.

thanks to this interface, it is possible to establish interaction between several programs without wondering about their design, program logic, or data processing method. And it helps programmers not spend their time understanding the program code of other specialists in order to connect their product with others.

API allows you to split large and complex information systems into independent components and work with them separately (by different teams on different platforms). It is easier to scale, unlike monolithic systems created on the basis of a single script (within a single platform).

Types of API

There are two types of API:

  • Public APIs are released by large companies and are available to all users. But a public API can be with authorization (each of the requests is accompanied by a secret token to the request), or completely public, which is available to everyone (authorization is not required). Public APIs are intended to be shared with the outside world, such as the YouTube API. Third-party developers can create applications to take advantage of these interfaces.
  • Private APIs are internal applications developed for a specific audience or user base. They are often used in businesses and within companies. To work with such an API, you need to get access.

What is the API used for?

  • Simplify communications between different systems and services. Developers can embed support for third-party services into their products without even thinking about who created them;
  • conduct transactions;
  • Make development more secure. API helps to put into a separate application the functionality that must be protected from outside influences. This reduces the likelihood of its incorrect use by third-party programs;
  • integrate data flow with clients and partner systems;
  • Save money. Buying a ready-made API is sometimes more profitable than spending time creating functionality from scratch with all the ensuing consequences;
  • Earn on your developed functionality, which other developers are using it to finish a product or to improve their own developments.
  • Improve the safety of automated processes

Conclusion

APIs are widely used for the interaction of programs and applications with operating systems or Internet sites. If the API were to go down, then almost all services on the Internet and most computer programs would stop working.

___________________________________________________________________

Thank you for the read. 📚

Do you want to taste what it feels like to be a data scientist? I am creating an end-to-end data science project for those who never experienced data science before. By completing this project: 1) you will experience the entire data science cycle yourself, and you will be able to understand if you want to become a data scientist, 2) you will develop a project that you can use for interviews, or your own freelance work as a portfolio, and 3) you will answer most popular interview questions, in case you decide to pursue the career of a data scientist.

What do you struggle with in your early journey? Share it with me here, and I am happy to help! I listen to your stories carefully and want to produce content that helps you in this journey.

For more content like this, sign up for my newsletter.

--

--