You all must have heard of the term “API” but all of the non techy out there should have drowned in trying to understand what it is. First of all, a general definition of the term can be found on Wikipedia. But here i will concentrate on web services, as the mass of people out there know it. So what do Twitter, Technocrati, Google and the same mean when they say they have an “API” at the developers’ disposal? What is this magical term that enables many developers to deliver the product to the end user in a more pleasant way?

In order to grasp the idea more clearly i will focus on Twitter which, i believe, we have all used. You must know that there are various ways to check your timeline or tweet, through the official website or through the desktop applications (Tweetdeck, Seesmic etc) or other websites that are frontends to it (TwitterFeed, Hootsuit etc). But what’s the main difference? Well take a look at the diagram below.


The actual data (your tweets, followers, settings etc) are stored in Twitter’s database. When you are on their website the data are retrieved from the database, rendered with their scripts and outputed on your web browser. But when a developer wants to create his own application to interact with Twitter, if there was no API, he would have to create a program that acts like a browser on the backend, which is very hard and adds a big unneeded overhead to both his application and the servers. That’s why, these kind of services, provide an API.

But what is it really? Simply put, it’s a batch of methods that output raw data (i.e. not for displaying in a browser) thus giving the end developer an easy way of interacting with the service. Let’s take twitter for instance. If you visit your home page you will see your timeline. If someone wanted to have his timeline as raw data in order to process it as he pleases he could use Twitter’s API call on this URL ““. Please notice these:

  • The reply you get is rather different from the one in your homepage. Notice that all the information is encoded in a special way so the program that requested it can interpret it and process it as it pleases.
  • You have to log in if you are requested to.
  • The information was encoded in a special format called an XML which is actually a descriptive way to represent data.
  • You can see more on Twitter’s API here.

It is not that scary now is it? In fact, for most of the popular services out there, many programmers have wasted countless hours studying API’s and trying to figure out how they can accomplish things.

One more thing you might have heard of are “credits”. This is nothing more than how many requests to the API (like the one above) can be done from that user in a given period of time. It’s a way for the service providers to control their traffic and try to avoid extra overhead to their servers.

All in all, you can say that an API is a shell wrapping around the service and giving the outsiders a way to access data in a raw way.