===========
This is a .NET client for the Nutritionix API. It is also available as a NuGet package.
Nutritionix NuGet Package
Nutritionix.Sample NuGet Package
using Nutritionix;
namespace MyApp
{
public class FooBar
{
private const string myApiId = "xxx";
private const string myApiKey = "abc123";
public NutritionixSearchResult[] Search(string query)
{
var nutritionix = new NutritionixClient();
nutritionix.Initialize(myApiId, myApiKey);
var request = new NutritionixSearchRequest { Query = query };
NutritionixSearchResponse response = nutritionix.SearchItems(request);
return response.Results;
}
public NutritionixItem Retrieve(string id)
{
var nutritionix = new NutritionixClient();
nutritionix.Initialize(myApiId, myApiKey);
return nutritionix.RetrieveItem(id);
}
}
}