Halo Reach API demo -- enhanced by JQuery and YQL
The recent launch of the major new video game, Halo: Reach, was a HUGE event. It's been the biggest event this year in the entertainment industry, making $200 million on the first day, and clocking 2,000 man-years of gameplay time in the first week! It's difficult to over-state the importance of Reach. It sets new benchmarks in gaming, interactive entertainment, and the web.
Through the Halo game franchise, Bungie has proclaimed a new era of web-integration for console gaming. Their latest game, Reach, continues that tradition, with the launch of the official Halo Reach API. This exciting new web service API opens-up game data like never before, including stats and content from played games (videos, screenshots, etc) for easy usage. Data from the game can now be surfaced on the web and used, analysed, and presented in creative new ways, like never before. If you're a web developer looking for a cool mash-up opportunity for your next hack-day, look no further!
Halo Reach API demo
In this demo, I'll make a call to the Halo Reach API to get data about video clips from some of my recent games, and use that data to display thumbnail images linking though to web pages where these rendered videos can be viewed online. We could obviously do much more in this demo, e.g. embedding HD video right here on the web page! I may update this demo later, or create other demos, with richer functionality, so watch this space... For the source code behind the demo, just view the source of this page. Enjoy! ;)
Live working demo!
Demo status: Ready!
About the Halo Reach API
Wow! With the launch of Halo Reach the market-leading game studio, Bungie, are opening a public API for Halo game data!
The Halo Reach API is a WCF web service (powered by .NET technology from Microsoft), supports SOAP, and also provides RESTful endpoints with data in JSON or XML format. There's an official Halo Reach API User Group that developers can join on the game studio's community website.
This is seriously exciting stuff for techies. Bungie already leads the way in this field -- Halo has by FAR the best game stats in the industry, with unbelievable detail, as well as screenshots and videos. Halo already offers by FAR the best integrated web experience of any game! I feel a gaming hack-day mashup coming on...
I first noted and applauded the Reach API in a comment on my blog post about the launch of the game. (I was at the premiere in London in the week before the launch.)
Harness the full power of the Halo Reach API, by using YQL
YQL is probably the best kept secret in the world of web development. YQL has loads of useful features, and allows you to query a web service using nice and readable SQL-like syntax, and set-up new and potentially advanced queries (filters, sorts, joins, etc) that can be accessed on a permament URL. In fact, with YQL you can treat the whole web, even ordinary web pages, as a giant database engine, but that's another story!
Example: a working YQL Query (just 3 lines of code)
The following YQL query gets a list of my rendered videos.
SET identifier="ABCDEFGHIJ1234567890abcdefghiABCDEFGHIJj123=" on bungie.reach.videos;
SELECT * FROM bungie.reach.videos WHERE gamertag="cbjoe" AND iPage=0;
Note: in order to work, his query needs a real API key (called "identifier" in the API). The one in this example (highlighted red) is fake. You can generate your Halo Reach API key in the game settings in your account on Bungie.net (create a new account if you don't have one). You can replace my gamertag ("cbjoe") with your own or any player's gamertag.
This simple 3-line YQL query is probably self-explanatory. The first line "USE ..." configures YQL to recognise the Reach API, and soon this step will not be necessary when my open data table definitions have been adopted by YQL. The second line "SET ..." makes the query use your own API key. The third line "SELECT ..."
*** DEMO 1: Try this query yourself right now in the YQL Console! (you need to replace my API key with yours) ***
*** DEMO 2: Try a working demo in the YQL Console (uses a query alias incorporating my own API key) ***
The YQL Console is a convenient to query a web service or API.
YQL Open Data Tables for the Halo Reach API
I've created open data table definitions for importing Halo Reach API data into YQL, and you're welcome to use them -- they're just XML files. I've contributed these open data tables to the official community data tables, as well as uploading them to public my public SkyDrive.
If you want to try creating your own data tables, you can start by checking the official YQL documentation -- particularly the YQL Open Data Table dev guide, and the Open Data Tables reference document. There's a good a good blog post about creating a new open data table for YQL. There's a good blog post about using YQL Storage to keep private data secret.
05 October 2010