Sunday, February 28, 2010

GREAT service to ease introducing and monetizing an API

I highly recommend the following company's product and concept.

http://www.webservius.com/

It handles the APP_id sign up, authentication, bandwidth throttling, and many other issuses. They said that they use cloud servers so they shouldn't provide much dealy between your users and your api.

There's a free version for you and your clients.

Tell them that I sent you? I get nothing but a warm fuzzy feeling when he calls me thanking me.

Success in API development and concepts learned

Our company had a succesful introduction of our API at a 'Hackathon' in Mountain View, CA yesterday. Lot's of great ideas are brewing at the 'Hacker Dojo'. Problems that we have solved, or found solutions for are:

1/ How to indicate the format of a feed/api in a REST URL. The old standard of putting the file type extension at the end seems to be universal and easiest to implement. Examples: (format can be 'json','xml','txt','html','pdf',etc)

create new resource in collection called 'resource_name'
POST http://sub.domain.tld/resource_name.format
POST http://api.yahoo.com/calendar.json (made this up)
(returns 'resource_id')

get resource in collection called 'resource_name'
GET http://sub.domain.tld/resource_name/resource_id.format
GET http://api.yahoo.com/calendar/a8e5b892c0024ead.json (made this up)

get resources in collection called 'resource_name'
GET http://sub.domain.tld/resource_name.format?query_string
GET http://api.yahoo.com/calendar.json?search_text=danc&from_date=2010-03-01&to_date=2010-03-07 (made this up)

2/ It's an INSANE consumer of memory and speed to format outgoing JSON/XML/etc for human readability. Rely on the user's viewing software application for that. DON'T format your output data for human readability. (On a shared hosting account, for 250 records returned in JSON, it would time out @ 30 seconds while formatted while returning nothing. Taking the formatting out the started the 'transferring data from site-name' message after 1 second, and it was basically my wireless holding up that transfer which took 5 seconds for 500kbytes. There may also have been some time for the browser to render the JSON using the 'JSONView' plugin, nicely formatting it :-)

There are some other things we have learned lately. I will post them over time.

All the best out there.