If you are an experienced programmer, you are already probably familiar with the concept of APIs.

But, for those of you who aren’t as clued up on this topichere is a simple and relaxed explication of what they are:

Let’s imagine I have a fantastic computer program, for example one which conjugates verbs. Using this program, I create a web page that allows you to conjugate verbs. In this way, any person who has access to the web can consult my program. This is great!

However, perhaps there are other people out there who are creating programs and applications, and it would be useful for them to integrate my conjugator into their services. For example, there may be a programmer, a company or a research group who are interested in being able to access the conjugated forms taken from an infinitive, that is to say, people who would be interested in accessing a program like mine. They could create their own conjugator, but why waste time reinventing the wheel when my program already covers what it is they need? In this case, we need to be able to integrate the answers from my program into the other program. To do this, it is necessary to have an API which they can access.

An API basically consists of an entry point to my program through which other programs can gain access to it. Through this door (the famous API), other programmers can use my conjugator:they only have to “call” my program indicating the infinitive that they wish to conjugate and my program will give them the corresponding conjugation in a clear and practical format for the program as well as the programmer. In this way, other programmers can benefit from the one that I created.

However … pay attention! The API does not allow access to the inner working of the program. The internal code of my conjugator continues to remain private; the API only provides a door through which other people can use my program without letting the code be discovered. To use a metaphor, let’s say that my program (in this case, the conjugator) is a kitchen. The API is the small window where the waiters (that is to say, the programmers), who are in the bar, ask for the meals from the kitchen. The kitchen receives the requests from the waiters through the window (my program receives the commands from other programs via the API) and provides the desired dishes (my program supplies the requested conjugations); but the kitchen (that is to say, the inner works of the program) is hidden from the waiters. They can only make requests and receive the dishes, they never see what happens inside the kitchen, nor do they know how the dishes are made.

Share →