What’s an API?

350 views

What’s an API?

In: 38

16 Answers

Anonymous 0 Comments

An application programming interface is a program interface for any other program, it can do any kind of abstraction, like fetching data or providing control by signals, API is a really broad term.
An example would be a API that tells the weather computed in a weather station, all it does is provide ways to interact with the system, fetch weather data or even control the system.

Edit:typo

Anonymous 0 Comments

API stands for Application Programming Interface. Basically, it’s a access point to code that someone else wrote that does things. Many times APIs are made available so that programmers can interface with a program you wrote, which makes your program easier to use and you’ll get more sales or something.

Here is an example of how that would be useful. Lets say I create a device that you plug into the USB adapter on a PC. That device then goes out and sniffs all the wireless signals nearby and gathers basic information about them, like strength, name, security, etc. I include a very basic application that allows you to pull up the information on a very simple screen and view it. But I also include an API that can be accessed programatically.

Now, a company wants to monitor what wireless signals are nearby, and they want to log that information to a database to keep for 5 years. It’s very important to their security because they make some gizmo for the defense department, and they want to make sure nobody is trying to send the information over a cell based wireless network. They go about and search for a wifi sniffer and they find a dozen of them, but of all the ones out there, they notice mine has a documented API that lets them pull the information programatically. So instead of buying the other 11, they buy mine.

Now they install my device and the software, and they pull up my documentation on how to use my API. They implement it on a program that they write that scans for wireless signals every hour and writes them to a database so they can run reports against it.

Hope this help.

Anonymous 0 Comments

If you imagine a microwave oven. A modern fancy one has a few functions.

* A fan.
* A turntable
* A grill/broiler element
* The magnetron that makes the microwaves
* A convection oven element
* A light.
* A timer

Now you could make it so all of those functions are worked by a set of switches on the front panel, so each switch turns a specific thing on or off – turntable, magnetron, heating elements and so on, but in order to use the thing effectively you’d have to have fairly intimate knowledge of how everything works, what needs to work with what to get the functionality you ultimately want.

Instead of that you have a control panel on the front, which bunches things into neatly defined functions – Microwave, Grill/Broil, combination, auto cook for potatoes, or pizza or whatever else.

Think of that as the API. It’s something that sits between you, the user, and the guts of the machine that make its functionality simpler for you to manage.

In software an API, or Application Programming Interface does something similar.

Reddit has one, Imgur has one, a lot of websites have them, and what they do is package up the nuts and bolts of the website’s operation into neat little functions that you can access.

So if you’re writing your all singing-all dancing Reddit app, you don’t actually need to know at a baseline level the way Reddit is built, all you need are the API functions, like (this won’t be accurate but it gives an idea) “view subreddit”, “expand thread”, “submit new”, “save comment”, “view user” etc, so you can work those functions into your app without ever having to touch the raw code underneath.

Note that it doesn’t have to apply to simply websites, many things use API’s. DirectX is a graphics API by Microsoft that is made so that GPU makers and game programmers can agree on a set of standards so one can talk to the other, without every game programmer having to know the ground level basics on how to get a GPU to display something.

*edited for clarity*

Anonymous 0 Comments

It stands for application programming interface.

Imagine you want to make a weather app and you find a website that offers weather data. Their api that they offer could have functions like:

getTodaysTemperature()

getWeeklyForecast()

This is just a shortened contrived example.

But the point is that idk how or care how getTodaysTemperature() works on the inside. I just care about when i want to use it and what data is returned. So I can do something with that data.

Anonymous 0 Comments

Let’s say I write part of a program and my friend Bob helps by writing some of it. An “Application Programming Interface” would be a summary list of Bob’s work so I can use it from my side of the app. More technically, it’s a list of data types and functions that serves as an interface between two pieces of code.

Anonymous 0 Comments

You want to water your garden. So you connect a hose you bought at the store to the spigot and twist the knob and water comes out. This wouldn’t’ve been possible if the spigot wasn’t a standard size and the hose maker made a hose to that size standard.

You want to plug something into the electrical outlet. The electrical item was built to draw a certain amount of electricity out of that outlet, using a standard two or three-prong connection, and it trusts that the wires aren’t giving too much or too little energy.

An “API” is that, except for digital things working with other digital things as opposed to physical goods.

Software creators create standard interfaces to do common tasks, except instead of threaded pipe connections or evenly spaced metal prongs, their standards are verbs, endpoints, and payloads that all programmers can then use to interface with their software to do crazy stuff, like get water from the wall to your thirsty roses or deliver electricity to your light bulb so it gets bright.

Anonymous 0 Comments

It’s a promise between two apps. If one does something, the other promises to do something else. Just like grandma promises to always give you an ice cream when you do the dishes.Note that grandma does not guarantee from which store she bought the icecream from, that’s not part of her promise.
Likewise, apps clearly say what is promised and what is not, to never disappoint.

Anonymous 0 Comments

It’s basically a well defined set of commands to allow two programs to talk to each other. Computer programs don’t interact with the world visually like you and me, so instead of a “user interface”, like buttons and text inputs that you have to use your eyes to see and your hands to interact with, computer programs need a “program interface” to basically send commands to each other. So instead of a button, a program might ask for a list of options, and instead of clicking, a program might send a command. The API is basically the list of commands that can be sent.

Anonymous 0 Comments

I like the restaurant analogy: If the program is the kitchen, and the client is the diner, the API is the waiter.

Anonymous 0 Comments

As most people have said API is an interface between two things, and those two things dont have to be remote or even a a different app.

Library functions define an API, also remote API (rpc remote procedure call or rapi) are a thing.