You are currently browsing the archives for the api tag.

A universal API

The web is currently living a silent revolution, with platforms such as MySpace or FaceBook. I don't really want to talk about those, but let me just say a few word about their future.

Recently, Jeff Hubber (Google) has said the the web is the platform. Whereas this might seem prententious, there is some truth to it : closed platforms will attain their limits one day or another. Those platforms actually believe that transposing to the internet the model of environment based applications will work on the long term. This is nonsense, we are currently evolving in the so called Web 2.0, which aims to be interoperable and based on content flow.

So, I thought about this idea of web as a platform, and I believe that some kind of universal, open source, API should exist. Here is the context in which we are :

actuel.png

There are a great number of services, each providing their own API.

On the other hand, a universal API would look like this :

api.png

This would free the developers from the service, as they would have access to a few primitives in charge of getting the information from the right place, and they could concentrate on the features of their application.

Basically, most current web services provide APIs, so it would really be nothing more that some glue

A modular architecture :

  • A core containing generic functions (get_user, get_bla)
  • A lot of interfaces between the core and foreign APIs

For example, if someone want to write a photo widget, he could the use the following (without bothering about which service is actually used) :

$my_widget = new UAPI(UAPI::PICTURES);
$my_widget->import("flickr", "fotki", "zoomr");
$my_widget->flickr->connect("login", "pass");
$my_widget->fotki->connect("login2", "pass2");
$my_widget->zoomr->connect("login3", "pass3");
$pics = $my_widget->get_pics();
foreach ($pics as $pic)
{
  echo $pic->url;
  foreach ($pic->tags as $tag)
  {
    echo $tag;
  }
}

Of course, this can be extended to any service, not only image hosting.

I think that the day this kind of abstraction will exist, then the web will become the platform de facto