After several months of hard work, Soapi.CS is finally ready for general distribution.
[from the StackApps announcement page]
A robust, 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();
(yes this is a real expression that returns the data as expressed!)
- Full coverage of the API, all routes and all parameters with an intuitive syntax.
- Strongly typed Domain Data Objects with lazy loaded properties and eager loading collections 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, 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.
Soapi.CS is an entry in the Stack Exchange API contest. So please visit the announcement, download the source, give it a try and give the post an upvote. Not necessarily in that order.