Thursday, January 29, 2009

Okay, so what *is* an API?

This is an excellent question, and one I get asked a fair amount. The not-very-useful answer is "it's an Application Programming Interface," which tells you what it's an acronym for but not what that means. If you're not familiar with the term, the words are just a different kind of meaningless noise. 

If you want to read the Wikipedia entry on APIs, knock yourself out. You might also find the entry on Web Services interesting. I'll wait here. 

Done? Okay, welcome back. There's a lot of really dense information over there, and I find it useful to fasten on two key concepts: One, an API is a way for computers to talk to one another, and two, a web service is (kind of) a web site with the skin taken off. 

Remix, for example (hey, what other example am I going to use?), replicates pretty much what you can get from BestBuy.com on the "product detail page" for a given item. Here's an Insignia TV at BestBuy.com:
And here's the same TV in the Remix API:
http://api.remix.bestbuy.com/v1/products/8632875.xml?apiKey=fqbvt96fpczdv4wesx4s62sd

Notice that pretty much all of the information that is in the pretty BestBuy.com version is also in the texty Remix version? That's because Remix is more or less just BestBuy.com with the skin off. 

So why do you care? What's the point of taking the skin off a web site? Well, when you do that, it becomes possible to put a different skin on. For example, in the sidebar of this blog is a list of games, showing names, images and prices. All of that information is coming from Remix; I just put the list of SKU IDs into a control panel and it created a chunk of javascript that does the work. 

So what you're seeing is information from BestBuy.com, but not at BestBuy.com. When prices change on BestBuy.com, they'll change in that sidebar gadget. 

What do we hope to get out of this? Something cool that we can't imagine. Yellow Tag Productions, our internal video production team, did a great video that summarizes the thinking behind this and the potential we see, called "Open for Business." It's worth 4:50 of your day, I think. Of course, I would, since I'm in it. Give it a try. 



5 comments:

by Chuck Densinger said...

You are the master of simple, clear analogies! This is the best lay explanation of API I've ever read. Bravo!

Anonymous said...

For the sake of argument and a little fun, I'll respectfully challenge the term "API" in this case. When I think of APIs, I think of the sage Java APIs (swing, JDBC, etc.) which are sets of functions/ methods that can be used and extended for building applications. What we have here is a REST query, which is still very powerful, but we aren't calling any specific methods with Remix, we're querying for data. My two cents. Discuss amongst yourselves...

Kevin said...

Chuck -- thank you!

Anonymous -- good point, Remix is not a "true" API in that sense, although it does expose multiple methods.

I should point out that discussion is easier when you're not Anonymous.

Anonymous said...

Language, she's a bitch...no? If we're going with an academic definition of REST, it's a software/network architectural principle, while API is a set of methods and Remix is all about data.

However, current standard usage indicates that most open RESTful data infrastructures are referred to as APIs. Change pipes the tune we all must dance to, my friend.

TootsNYC said...

Doesn't that stripped down version ALSO take less bandwidth, and load faster, etc.? Maybe that's not as big a concern w/ today's computing power. But I thought that was part of the goal.