##Soapi.JS2 var ctx = new Soapi.ApiContext(apiKey); ctx.initialize(function() { // get a page of users ctx.official.stackApps.Users().invoke(function(users) { users.ForEach(function(user) { // get a page of each user's questions w/answers user.Questions().withAnswers(true).invoke(function(questions) { // for each of the user's questions questions.ForEach(function(question) { // enumerate it's answers, if any question.answers.ForEach(function(answer) { // and get a page of the answer's owner's favorites answer.owner.Favorites().invoke(function(favorites) { favorites.ForEach(function(favorite) { // shall I go on? ;-) }); }); }); }); }); }); }); }); ##About Soapi.JS2 is being released separately from [Soapi.JS][1] as it is a completely different take on accessing the API via JavaScript. [Soapi.JS][1] is a very lightweight library that provides full API coverage. Soapi.JS2 takes it to 11 with a complete paradigm shift. It is a bit heavier and revolves around a fluent, relational query approach similar to that of the [Soapi.CS][2] library, providing a seamless view on the data served by the API. ###License MIT-X11/GPL ###Download ***Alpha*** version available at [http://soapi.info/Downloads/Soapi.JS2-alpha-08-20-2010.zip][3] ChangeLog: Soapi.JS2-alpha-08-20-2010 - implemented paging fully - implemented .total method Soapi.JS2-alpha-08-19-2010 - initial release ###Platform JavaScript - Any browser that doesn't burn oil. ##Contact code poet ##Code Included in the alpha zip is a full coverage test suite and a rather detailed walkthrough. Not yet implemented: Caching and Throttling - so be careful with those paged requests! ###Documentation and Samples [building list now] [1]: http://stackapps.com/questions/494/soapi-js-v1-0-fluent-javascript-wrapper-for-the-stackoverflow-api [2]: http://stackapps.com/questions/386/soapi-cs-a-fully-relational-fluent-net-stack-exchange-api-client-library [3]: http://soapi.info/Downloads/Soapi.JS2-alpha-08-20-2010.zip