FoodDataCentralSDK 1.0.5

dotnet add package FoodDataCentralSDK --version 1.0.5
                    
NuGet\Install-Package FoodDataCentralSDK -Version 1.0.5
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FoodDataCentralSDK" Version="1.0.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FoodDataCentralSDK" Version="1.0.5" />
                    
Directory.Packages.props
<PackageReference Include="FoodDataCentralSDK" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FoodDataCentralSDK --version 1.0.5
                    
#r "nuget: FoodDataCentralSDK, 1.0.5"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package FoodDataCentralSDK@1.0.5
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FoodDataCentralSDK&version=1.0.5
                    
Install as a Cake Addin
#tool nuget:?package=FoodDataCentralSDK&version=1.0.5
                    
Install as a Cake Tool

FoodDataCentral.NET

A .NET Standard library for interacting with the US Department of Agriculture's FoodData Central API

Installation

You can use FoodDataCentral.NET in your package by installing the NuGet package.

Install-Package FoodDataCentralSDK

Note you will need a data.gov API key. You can obtain a key here.

Usage

using IO.FoodDataCentralSDK;
using IO.FoodDataCentral.Models;

...

// Create the API client
var api = new FoodDataCentralAPI("YOUR_API_KEY");

// Search for foods with the query "big mac"
SearchResult searchResults = await api.Search("big mac");

// Get details of a food
Food food = await api.GetFoodById(170720);
// Get protein of selected food
float proteinGrams = food.FoodNutrients[NutrientType.Protein].Amount;

Licence

MIT

Product Compatible and additional computed target framework versions.
.NET Framework net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.5 210 4/6/2024
1.0.4 171 4/6/2024