Last updated:

Get Your Site Submitted for Free in the World's Largest B2B Directory!

Email Address:
* URL:
*
*Indicates Mandatory Field

Terms & Conditions

Submit Your Site To ItalianWebSearch

DevWebProIT
FlashNewz
DevWebPro





Making An API For Your Website

By Mads Kristensen
Expert Author
Article Date: 2008-03-17

Lately I've been thinking a lot about data portability in terms of API's, microformats and standards like SIOC, FOAF, OWL and APML.

What fascinates me is that data portability enables people to share and move their data around the web seamlessly. I wrote about some microformats and standards for the semantic web a few days ago, but what about the API's?

Nowadays, an API most often comes in the form of a REST service that returns JSON or XML, so that both JavaScript and server-side technologies can use them. It makes sense and it promote data portability. Then think about a website. Some parts of it are tagged up with various microformats like XFN, hCard and hCalendar, but what about the rest of the content?

My idea is to render any webpage in either XML or JSON if a certain parameter is added to the URL. It could look like this:

www.example.com/about.aspx?format=xml

Then the about.aspx page would render the output as XML for machines to read and thereby have some sort of read-only API. The standard could be RSS or ATOM or both. Now any machine can read the content of your website easily. Think about how easy it must be for search engines to index an RSS representation of a webpage instead of going through all the excess mark-up and style information.

If any webpage could be served as RSS, ATOM and JSON then the content of that page could be consumed in a multitude of ways. The best thing is that it is relatively easy to implement. Because it is so easy I can't stop wondering if there is a reason no one has done it before.

The question is who would use this and does it make any sense to begin with?

Comments

About the Author:
Mads Kristensen currently works as a Senior Developer at Traceworks located in Copenhagen, Denmark. Mads graduated from Copenhagen Technical Academy with a multimedia degree in 2003, but has been a professional developer since 2000. His main focus is on ASP.NET but is responsible for Winforms, Windows- and web services in his daily work as well. A true .NET developer with great passion for the simple solution.

http://www.madskristensen.dk/


Newsletter Archive | Article Archive | Submit Article | Advertising Information | About Us | Contact

DevWebProItaly is an iEntry.com publication
© iEntry Inc. All Rights Reserved Privacy Policy Legal

Click Here to Return to the Home Page