What is API?

473 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

Not to be mean here, but this is something that is fairly basic and very searchable. Searching for sollutions and documentation is about 30% of what a developer does, with 60% reading code, 5% writing code, and the other 5% making up stats. If you have to ask this sort of question here then development will be tough.

[https://letmegooglethat.com/?q=what+is+an+api](https://letmegooglethat.com/?q=what+is+an+api)

Anonymous 0 Comments

It’s a description of an interface. For example when i use a web API i could send json data in a POST to make the website do something like search for data. The would describe the fields i need to put in that json like (“search”:”<string>”). Once the API is documented and written in stone essentially, I can write code against it because it should not change. Also, extra fields like “uppercase”: True, help to describe the API’s capabilities. There maybe dozens option flags/values to tweak the search results or it could only need the search string. Knowing this you can write your code to take advantage of some all or none of its features. But at the end of the day a human looks at a web page, but an app or a machine does’t need the pretty UI, they can use the API to get the data.

Anonymous 0 Comments

Here’s the analogy I always use with customers when they ask this question:
Think of your DVD/blue ray player. You don’t need to know how to spin the disc you inserted, move the read head, provide power to the optical reader, etc. all you need to know is that if you click this button something happens and the door opens and a gray pops out. If you click this button with a disc inside everything will start playing. Your API to that device is the series of buttons in front of you

Anonymous 0 Comments

It’s the interface to a lot of functionality.

Think of your car. It has a million parts and a LOT going on.

But you don’t care about those million parts. You care about the layer between you and that complexity.

So to you, you have “start the car” as an option. Push the gas, the brake, turn left or right, maybe go in reverse.

Those controls are your API. They let you control the complexity of a car without knowing anything at all about how the car actually works.

In tech it’s the same thing. You don’t need to know how google works, because you can call an API that just says “search” or “get map of location x,y” or “send this email” or whatever. That layer that lets you use those functions is the API.

Anonymous 0 Comments

You when when you go to a public office or to a bank to get something done you often have to fill out a bunch of forms? That’s an API. It is some sort of standardized way of information exchange that whoever performs the service understands. It can be an office, a bank, a utility piece of software, or a computer server. Your program uses APIs to get things done. The API describes what can be done, and what information is required to get it done.

Anonymous 0 Comments

In interview questions I ask people to explain an API to someone non technical. It’s amazing how few great developers can do this.

It’s how computers talk to each other.

For a slightly more complicated answer:

One computer provides a service for others, perhaps translation.

The API is the rules for how to use that service.

So it might say you need to provide text and Lang in a querystring like this:

http://translate.com?text=hello&lang=Spanish

And the computer will reply result=hola

Anonymous 0 Comments

You have 2 softwares and you want these two softwares to communicate or share data , so you create a programmed interface which acts as a middleman for this , that’s Application Programming Interface for ya.

Anonymous 0 Comments

It’s an access point really. You have some server that you want other people to use. This could basically be anything. You need a way for people to get information and put in information. That’s what an API is an interface for others to use.

Anonymous 0 Comments

If I’m a website and I want to get data from somewhere else, maybe information about the weather or something, an API is what I can use to communicate with the weather service

Another use case is when you have a database with information about a school, for example. The API could allow you to ask for information about the teachers, the students, the grades, enter new information into the database, etc., without you having to write the SQL code to get that data yourself (which is great because you don’t really want anyone to be able to interact directly with the database as they might have bad intentions)

Add someone else said, it’s like a menu. The cooks can probably make a huge variety of things that aren’t on the menu, but that’s not what you want the customer to be able to order. An API lets you request the data the service wants you to have access to and nothing else (hopefully)

Anonymous 0 Comments

If I have an application that processes mortgage applications, and as part of that applications logic, I need to access a database of mortgage rates, an API is a middleman application that I can send a message to “give me the rates”, and it will do the querying, filtering and sorting of the data for me before sending it back in the format my application can work with.

It’s a middleman application between different applications or between applications and data sources.

Based on the other replies i guess there are other types if APIs but in my experience as a middleware API developer, that’s what it is.