What is API?

468 viewsEngineeringOther

What is exactly API and why we call it like that? I am learning web development, and always come across APIs. I would love to learn it through an analogy.

In: Engineering

32 Answers

Anonymous 0 Comments

It’s simply the set of functions you use to access someone else’s code, or maybe a separate module in your own code. It gets thrown around and can mean slightly different things in different contexts.

In web development it usually is referring to the interface to a web service running on a server somewhere. Say there’s a service that gives you weather. The API might tell you to send a certain request to the server to get the current temperature, or some other request to get the current precipitation.

If you download a software library it will hopefully have an API telling you how to use it. What functions exist. What data types do they expect.

Or if you’re working on a large code base at work and you want to utilize code maintained by a different team, they might have an API that tells you how to use their code.

It’s discussed so much because it’s important to have a clean, easy to use, and well documented API when you give someone else your code. This makes it easy for them to pick it up and use it.

You are viewing 1 out of 32 answers, click here to view all answers.