This is a .NET client for the Nutritionix API
C# Batchfile
Switch branches/tags
Latest commit 73cc8fc Feb 17, 2017 @carolynvs Bump version to 1.3.1

README.md

Nutritionix Client Library for .NET

===========

This is a .NET client for the Nutritionix API. It is also available as a NuGet package.

Nutritionix NuGet Package
Nutritionix.Sample NuGet Package

Use

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);
        }
    }
}