What is an API?

What is an API?

My goal with this posts is to explain technical solutions and services in a way that hopefully a lot of people can understand. I won’t deep dive in to the details, nor bringing up exceptions etc.. The following text is based on my own experience, knowledge research, and then translating it into my own words and context. Please keep that in mind when you read my posts.

What is an API?

Nowadays, and a long time back, everybody is talking about APIs in all forums. But what is actually an API? Let’s get in to it…

An API is a piece of software which tells machines how to communicate with each other. They are often discussed as being machine-readable interfaces (versus human-readable).

Let’s put it into another context – think of a wall socket!

Every time you need power to any of your devices in your home (like the vacuum cleaner or hair dryer), you put it into an electrical socket. You just know that if I plug this cord into the wall socket, I will get power and my device will work. Easy and comfortable! Therefore, we can call the electrical wall sockets an interface to a service, and we can call the devices as consumers of that service.

Wall sockets have predictable patterns (a standard) of openings which electrical plugs can fit into. Of course the socket needs to meet certain specifications, which also we as a consumer assumes… Example: “If I plug my device in to the socket, I expect it to get electricity.” Likewise, the socket expects that the device has the right plug to be able to deliver the electricity. So, the only thing you need to worry about is that your device has the correct plug! You don’t really care what is behind the wall socket, as long as what you get what you want – electricity for your device!

Simply put – if you give the service (the wall socket) what it wants (the correct plug), it will deliver what your consumer (the hair dryer) wants.

So let’s put this back in to an API context.. An API specifies how software components should interact with each other. So, the electricity is the service, the wall socket is the API, and the device is the consumer.

Let’s say you own a database with important and useful information that a lot of people wants access to. You don’t want to just give the whole database to everyone (and they probably wouldn’t know/or be interested in how to use all of it, just like the electricity provider doesn’t want to give access to everything “behind the wall socket”. Instead, you decide what functions you want the consumer to be able to access. The electricity provider has a wall socket (his API) that we can just plug into to get electricity as mentioned before.. In the same way, the database developer can create an API (like the wall socket) that the application developer can “plug in to” to get only the information that he wants and is allowed to access. Of course, this “plug” and API is written in code, but I won’t deep dive in to that here since I promised to keep it simple for now!


I hope this post helped you to understand what an API is, and that you now can explain it to other people! If you have and questions or suggestions of what I can write about in my next article, please send me a message!

Ali Saghai

Driving Purposeful Transformation: Empowering Leaders, Teams, and Organizations to Achieve Meaningful Impact!

3 年

Great post Victoria :)

回复

要查看或添加评论,请登录

Victoria Nordin的更多文章

社区洞察

其他会员也浏览了