Codewars.API is a .NET wrapper for the codewars.com REST API. It facilitates easy access to the codewars API with static typing, async programming models, and full xdoc as documented on their site. It lets you do all kinds of interesting things like searching for businesses, getting user comments and ratings, and handling common errors. The library is written C#, and is available on NuGet.
For more information, visit the codewars REST API
In most cases, you're going to want to install the Codewars.API NuGet package. Open up the Package Manager Console in Visual Studio, and run this command:
PM> Install-Package Codewars.API
The source includes a few examples that should help you get started with ASP.NET.
The CodewarsClient
constructor takes an API key which can be found on the account settings page (https://www.codewars.com/users/edit). Keep this keys safe! You can put them in the applicationSettings portion of your web.config (recommended), or store them in an environment variable on your dev machine:
var client = new CodewarsClient("My API Key");
var response = client.GetUser("jacerhea");
Codewars.API uses the ASP.NET Web API client(TPL) to make managing asynchronous requests easier.
var task = y.Search("coffee", "seattle, wa").ContinueWith((searchResults) =>
{
foreach (var business in searchResults.Result.businesses)
{
Console.WriteLine(business.name);
}
});
There are a lot of other ways to search. For more info, the best place to look is the integration tests.
If you want to build the source, clone the repository, and open up Codewars.API.sln.
git clone https://github.com/jacerhea/Codewars.API.git
explorer src\Codewars.API.sln
Codewars.API targets .NET 4.5. If you would like support for other platforms, let me know.
Feel free to submit an issue on the repository, or find me at @jacerhea