beer.xml

Access your RateBeer data.

RateBeer is probably the best site on the internet for both cataloguing the beer you've been drinking, as well as discovering new beer. I try and use it as often as I can to keep a record of which beers I've been trying. However, I'm interested in using this data in other ways, and RateBeer doesn't provide that sort of data access as an option.

beer.xml makes a rudimentary attempt to solve that problem. I've tried to make the RateBeer data as portable as possible, and offer it up in a variety of formats: XML, JSON, and RSS. (Feel free to ask me for more formats, it's pretty trivial to do implement.)

This web service is RESTful, so all you need to do in order to access your data (or in this example, my data) is make an HTTP GET request using youre RateBeer user name, such as:

http://beer.periphery.org/json/zaschell

...and you will get the following in response:

{
	"username": "zaschell",
	"userid": "83888",
	"userurl": "http://ratebeer.com/user/83888/",
	"beer": [
		{ "name": "Midnight Sun Sockeye Red IPA", "style": "India Pale Ale (IPA)", "rating": "4.5", "url": "http://ratebeer.com/beer/midnight-sun-sockeye-red-ipa/2444/83888/", "date": "Sat, 19 Jun 2010 00:00:00 +0000" },
		{ "name": "Diamond Knot IPA", "style": "India Pale Ale (IPA)", "rating": "4.4", "url": "http://ratebeer.com/beer/diamond-knot-ipa/6026/83888/", "date": "Fri, 01 May 2009 00:00:00 +0000" },
		{ "name": "Dicks Danger Ale", "style": "Brown Ale", "rating": "3.4", "url": "http://ratebeer.com/beer/dicks-danger-ale/5358/83888/", "date": "Sat, 31 Jan 2009 00:00:00 +0000" }
	]
}

Where you see the "json" string in the request above, you can replace with "xml" or "rss" and get properly-formatted results. So if you requested:

http://beer.periphery.org/xml/zaschell

...you would get:

<recentbeer username="zaschell" userid="83888" userurl="http://ratebeer.com/user/83888/"> 
	<beer> 
		<beername>Midnight Sun Sockeye Red IPA</beername> 
		<beerurl>http://ratebeer.com/beer/midnight-sun-sockeye-red-ipa/2444/83888/</beerurl> 
		<style>India Pale Ale &#40;IPA&#41;</style> 
		<rating>4.5</rating> 
		<date>Sat, 19 Jun 2010 00:00:00 +0000</date> 
	</beer> 
	<beer> 
		<beername>Diamond Knot IPA</beername> 
		<beerurl>http://ratebeer.com/beer/diamond-knot-ipa/6026/83888/</beerurl> 
		<style>India Pale Ale &#40;IPA&#41;</style> 
		<rating>4.4</rating> 
		<date>Fri, 01 May 2009 00:00:00 +0000</date> 
	</beer> 
	<beer> 
		<beername>Dicks Danger Ale</beername> 
		<beerurl>http://ratebeer.com/beer/dicks-danger-ale/5358/83888/</beerurl> 
		<style>Brown Ale</style> 
		<rating>3.4</rating> 
		<date>Sat, 31 Jan 2009 00:00:00 +0000</date> 
        </beer>
</recentbeer>

(It's worth pointing out that I totally invented this XML schema in order to use the data I had at hand. If you're looking for something more standard, try the RSS option.)

(It's also worth pointing out that all the results are returned as escaped HTML—eg. you shouldn't see raw ">" brackets or anything. It should all be safely embeddable in other microformats.)

The other potential use of this is to include the RSS feed in your various other services like tumblr, Friendfeed, or ping.fm. Additionally, you can add the RSS link as an alternate on any of your sites, and people can follow you in Google Reader, like so:

Google Reader screenshot

In any case, feel free to use as you please without totally gangraping my server. And let me know if you come up with any interesting implementations!

Service provided by Zac Schellhardt.