This is a .NET client for the Nutritionix API
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.nuget
Nutritionix.Samples
Nutritionix.Tests
Nutritionix
nuget
packages/Microsoft.Bcl.Build.1.0.7/tools
.gitignore
MIT-License.txt
Nutritionix.sln
README.md

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