Data Driver

Blog archive

Beer? There's an API for that!

I've been fooling around with REST services, getting JSON data back from free online sources and displaying it in Web or Windows Store apps via a ListView or FlipView, and so on.

After experimenting with the Windows Azure Mobile Services, which simplifies the back-end data-access process and lets you easily set up your own services, I was trying out other APIs and just had to pass on my latest discovery: beer.

Yup, there's an Open Beer Database, described as "a free, public database and API for beer information." Now, that's my kind of information. Not that I'm a lush or anything, but a beer API seems appropriate for these stressful times, what with the end of the world coming—and, worse yet, a holiday stay with the in-laws and family circus if civilization survives the predicted apocalypse. Then there's climate change, earth-destroying asteroids, sovereign insolvency, the fiscal cliff and Gangnam Style (hey, if you're talking Korean madmen druthers, give me that whacky Kim Jong Un and his ballistic missile toys in the North over Psy and his garbage music in the South any day).

Anyway, note that the Open Beer API "is currently a work-in-progress and is subject to change without notice." It returns data in JSON or JSONP (to work around cross-domain calls). It provides the usual CRUD operations via HTTP verbs GET, POST, PUT and DELETE and lets you retrieve breweries or beers, both as aggregates or singly by ID number.

For example, the beer with an ID of 2 is named the Bruin. Its description includes: "At once cuddly and ferocious, it combines a smooth, rich maltiness and mahogany color with a solid hop backbone and stealthy 7.6% alcohol." Hmm, cuddly and ferocious, much like that cute little Kim Jong Un himself (Psy is neither; I can't say here what Psy is).

The Open Beer Database includes an example for retrieving brewery information in JSONP format via JavaScript. It also points to client libraries for Ruby, PHP and Python.

So check it out the next time you're looking for an example REST service to toy around with, maybe over the holiday break. Me? I'll be up in Massachusetts, probably pounding Bruins (and I don't mean the local hockey team up there.)

Do you know of any wild and crazy REST APIs we can play with in our coding adventures? Please share your suggestions here or drop me a line.

Posted by David Ramel on 12/13/2012


comments powered by Disqus

Featured

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube