The Almost Universal API is a culmination – or at least a local maxima – of several projects I’ve been working on for the last few months: in particular, Web Object Records, Pipe Cleaner and PyBM. The AUAPI is:
- a way of presenting results returned from many popular APIs
- a Python library to actual do this
I’ll be making several posts about how to use the AUAPI, including installation instructions. The plan is to make an easy_install version, but initially this will be a SVN from Google Code thing.
The AUAPI is mainly about how to present results returned from APIs, not how to send data to APIs nor how to encode requests. The encoding is designed to “look good” in JSON and be easily and algorithmically encoded into XML. The AUAPI data model is based on:
- Atom, the “core” vocabulary, particularly providing
title,content,summary,updated,category,linkand links - MediaRSS, for encoding images
- hCard, for encoding information about people
- hCalendar, for encoding information about events
There are several “maybe” standards too:
- hProduct, for encoding information about things
- Google’s SGN URLs, for providing a universal way of talking about accounts
I have already worked a fair number of APIs into the AUAPI. These are documented on the Mashematica Wiki:
- api_csv – download and interpret CSV documents
- api_delicious – get information from Delicious.com API
- api_download – download HTML, XML and JSON documents
- api_feed – download Atom and RSS feeds
- api_feeds – find feeds on a page
- api_foaf – read FOAF files
- api_flickr – Flickr API
- api_geocode – geocode
- api_google – get information from Google AJAX Search API
- api_lastfm – return results from Last.fm
- api_microformat – get microformatted information on a page
- api_opml – download OPML documents
- api_whitepages – look up phone numbers
[...] quickly review, the AUAPI sees API results as composing of two parts. A “response” (formerly the [...]
[...] is a brief outline of how one would “naively” transform Almost Universal API’s (AUAPI) JSON into XML. We say “naive” because in general one wants to make a [...]
[...] community has adapted the vCard standard for serialization into HTML using hCard. In the Almost Universal API (AUAPI), people and organizations should almost always be described using a JSON-encoded [...]
[...] is the way to encode images in the Almost Universal API (AUAPI). Because MediaRSS encodes its values in attributes, we use the @ symbol to prefix [...]
[...] location is a little more problematic to encode than other data types we’ve looked at for the Almost Universal API. The issue is that standards for adding geographic information are either overly complicated or [...]