There was a fun discussion at Mashup Camp about Microformats for APIs. It started as a question about using microformats for documenting APIs, which I think was resolved fairly quickly by deciding to try it using XMDP. There’s a short example on the wiki now that I came up with. It’s not complete and doesn’t contain eveything I think should be in it (error codes, response format, etc), but its a start. (Christine Herron posted some notes as well)
The discussion turned into a plea (from me) to start thinking about using microformats instead of coming up with new XML languages for APIs. There are already competing formats that replicate, in entirely new markup, structures available in HTML. Why not just use XHTML?
For example, instead of the various formats returned by the different search engines (and I’ve used several by now), why not return this (inside an XHTML document)?
<ol start="1"> <li><a href="http://url">Document Title</a> <p class="description">Description goes here</p> <blockquote>Snippet goes here</blockquote> </li> </ol>
I think there’s a lot of room for discussion here, and I don’t think that we can reasonably replace all XML-based APIs with microformatted XHTML, but it’s a discussion worth having.