Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
This is a .NET client for the Nutritionix API
C#
branch: master
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);
        }
    }
}
Something went wrong with that request. Please try again.