##Soapi.CS for .Net / Silverlight / Windows Phone 7 / Mono ***as easy as breathing...*:** var context = new ApiContext(apiKey).Initialize(false); Question thisPost = context.Official .StackApps .Questions.ById(386) .WithComments(true) .First(); Console.WriteLine(thisPost.Title); thisPost .Owner .Questions .PageSize(5) .Sort(PostSort.Votes) .ToList() .ForEach(q=> { Console.WriteLine("\t" + q.Score + "\t" + q.Title); q.Timeline.ToList().ForEach(t=> Console.WriteLine("\t\t" + t.TimelineType + "\t" + t.Owner.DisplayName)); Console.WriteLine(); }); // if you can think it, you can get it. **Output** <pre> Soapi.CS : A fully relational fluent .NET Stack Exchange API client library 21 Soapi.CS : A fully relational fluent .NET Stack Exchange API client library Revision code poet Revision code poet Votes code poet Votes code poet Revision code poet Revision code poet Revision code poet Votes code poet Votes code poet Votes code poet Revision code poet Revision code poet Revision code poet Revision code poet Revision code poet Revision code poet Revision code poet Revision code poet Revision code poet Revision code poet Votes code poet Comment code poet Revision code poet Votes code poet Revision code poet Revision code poet Revision code poet Answer code poet Revision code poet Revision code poet 14 SOAPI-WATCH: A realtime service that notifies subscribers via twitter when the API changes in any way. Votes code poet Revision code poet Votes code poet Comment code poet Comment code poet Comment code poet Votes lfoust Votes code poet Comment code poet Comment code poet Comment code poet Comment code poet Revision code poet Comment lfoust Votes code poet Revision code poet Votes code poet Votes lfoust Votes code poet Revision code poet Comment Dave DeLong Revision code poet Revision code poet Votes code poet Comment lfoust Comment Dave DeLong Comment lfoust Comment lfoust Comment Dave DeLong Revision code poet 11 SOAPI-EXPLORE: Self-updating single page JavaSript API test harness Votes code poet Votes code poet Votes code poet Votes code poet Votes code poet Comment code poet Revision code poet Votes code poet Revision code poet Revision code poet Revision code poet Comment code poet Revision code poet Votes code poet Comment code poet Question code poet Votes code poet 11 Soapi.JS V1.0: fluent JavaScript wrapper for the StackOverflow API Comment George Edison Comment George Edison Comment George Edison Comment George Edison Comment George Edison Comment George Edison Answer George Edison Votes code poet Votes code poet Votes code poet Votes code poet Revision code poet Revision code poet Answer code poet Comment code poet Revision code poet Comment code poet Comment code poet Comment code poet Revision code poet Revision code poet Votes code poet Votes code poet Votes code poet Votes code poet Comment code poet Comment code poet Comment code poet Comment code poet Comment code poet 9 SOAPI-DIFF: Your app broke? Check SOAPI-DIFF to find out what changed in the API Votes code poet Revision code poet Comment Dennis Williamson Answer Dennis Williamson Votes code poet Votes Dennis Williamson Comment code poet Question code poet Votes code poet </pre> --- ##About A robust, fully relational, **easy to use**, strongly typed, end-to-end StackOverflow API Client Library. Out of the box, Soapi provides you with a robust client library that abstracts away most all of the messy details of consuming the API and **lets you concentrate on implementing your ideas**. A few features include: - A fully relational model of the API data set exposed via a fully 'dot navigable' IEnumerable (LINQ) implementation. Simply tell Soapi what you want and it will get it for you. e.g. "On my first question, from the author of the first comment, get the first page of comments by that person on any post" `my.Questions.First().Comments.First().Owner.Comments.ToList();` <sub>(yes this is a real expression that returns the data as expressed!)</sub> - Full coverage of the API, all routes and all parameters with an intuitive syntax. - Strongly typed Domain Data Objects for all API data structures. - **Eager and Lazy Loading** of 'stub' objects. Eager\Lazy loading may be disabled. - When finer grained control of requests is desired, the core RouteMap objects may be leveraged to request data from any of the API paths using all available parameters as documented on the help pages. - A rich Asynchronous implementation. - A **configurable request cache** to reduce unnecessary network traffic and to simplify your usage logic. There is no need to go out of your way to be frugal. You may set a distinct cache duration for any particular route. - **A configurable request throttle** to ensure compliance with the api terms of usage and to simplify your code in that you do not have to worry about and respond to 50X errors. The RequestCache and Throttled Queue are thread-safe, so can make as many requests as you like from as many threads as you like as fast as you like and not worry about abusing the api or having to write reams of management/compensation code. - **Configurable retry threshold** that will, by default, make up to 3 attempts to retrieve a request before failing. Every request made by Soapi is properly formed and directed so most any http error will be the result of a timeout or other network infrastructure. A retry buffer provides a level of fault tolerance that you can rely on. - An almost identical **javascript library**, [Soapi.JS][1], that will enable you to leverage your server cycles and bandwidth for only those tasks that require it and offload things like status updates to the client's browser. ##License Licensed GPL Version 2 license. ##Platforms - .NET 3.5 - .NET 4.0 - Silverlight 3 - Silverlight 4 - Windows Phone 7 - Mono ##Download <strike>Source code lives @ http://soapics.codeplex.com. Binary releases are forthcoming.</strike> codeplex is acting up again. get the source @ [**http://bitbucket.org/bitpusher/soapi.cs**][2] The source is C# 3.5. and includes projects and solutions for the following IDEs - Visual Studio 2008 - Visual Studio 2010 - ModoDevelop 2.4 ##Documentation Full documentation is available at http://soapi.info/help/cs/index.aspx ##Sample Code / Usage Examples Sample code and usage examples will be added as answers to this question. - [Full API Coverage][3] all API routes are covered - [Full Parameter Parity][4] If the API exposes it, Soapi giftwraps it for you. - [Building a simple app with Soapi.CS][5] - a simple app that gathers all traces of a user in the whole stackiverse. - [Fluent Configuration][6] - Setting up a Soapi.ApiContext could not be easier - [Bulk Data Import][7] - A tiny app that quickly loads a SQLite data file with all users in the stackiverse. - [Paged Results][8] - Soapi.CS transparently handles multi-page operations. - [Asynchronous Requests][9] - Soapi.CS provides a rich asynchronous model that is especially useful when writing api apps in Silverlight or Windows Phone 7. - [Caching and Throttling][10] - how and why ##Apps that use Soapi.CS - [Soapi.FindUser][12] - .net utility for locating a user anywhere in the stackiverse - [Soapi.Explore][13] - The entire API at your command The CS/SL/WP7/MONO libraries all compile the same code and with the exception of environmental considerations of Silverlight, the code samples are valid for all libraries. You may also find guidance in the test suites. [More information on the SOAPI eco-system.][11] ##Contact This library is currently the effort of me, Sky Sanders ([code poet][14]) and can be reached at gmail - sky.sanders Any who are interested in improving this library are welcome. ##Support Soapi You can help support this project by voting for [Soapi's Open Source Ad post][15] --- [1]: http://stackapps.com/questions/494/soapi-js-v1-0-fluent-javascript-wrapper-for-the-stackoverflow-api [2]: http://bitbucket.org/bitpusher/soapi.cs [3]: http://stackapps.com/questions/386/soapi-cs-a-rich-fluent-net-stack-overflow-api-client-library-complete-final/690#690 [4]: http://stackapps.com/questions/386/soapi-cs-a-rich-fluent-net-stack-overflow-api-client-library-complete-final/1305#1305 [5]: http://stackapps.com/questions/386/soapi-cs-a-rich-fluent-net-stack-overflow-api-client-library-complete-final/699#699 [6]: http://stackapps.com/questions/386/soapi-cs-a-rich-fluent-net-stack-overflow-api-client-library-complete-final/691#691 [7]: http://stackapps.com/questions/386/soapi-cs-a-rich-fluent-net-stack-overflow-api-client-library-complete-final/704#704 [8]: http://stackapps.com/questions/386/soapi-cs-a-rich-fluent-net-stack-overflow-api-client-library-complete-final/694#694 [9]: http://stackapps.com/questions/386/soapi-cs-a-rich-fluent-net-stack-overflow-api-client-library-complete-final/696#696 [10]: http://stackapps.com/questions/386/soapi-cs-a-fully-relational-fluent-net-stack-exchange-api-client-library/416#416 [11]: http://stackapps.com/questions/1352/what-is-soapi-and-why-should-i-care [12]: http://stackapps.com/questions/1338/finduser-quickly-find-a-any-stack-exchange-user [13]: http://stackapps.com/questions/1377/soapi-explore-silverlight-the-entire-api-at-your-command [14]: http://stackapps.com/users/14/code-poet [15]: http://meta.stackoverflow.com/questions/53346/open-source-advertising-sidebar-2h-2010/60263#60263