.Net components for OpenFoodFacts (API Client, CSV data reader, ...)
Target Platform : .Net Standard 2.0
Before you can use OpenFoodFacts4Net.ApiClient in your application, you need to add the NuGet package. You can do it using your IDE or the command line:
dotnet add package OpenFoodFacts4Net.ApiClient
(See Samples.ApiClient.ConsoleApp)
Client client = new Client();
string barcode = "3017620422003";
GetProductResponse productResponse = await client.GetProductAsync(barcode);
If you want to set the User-Agent
header :
String userAgent = UserAgentHelper.GetUserAgent("applicationName", "system", "version", "projectUrl");
Client client = new Client(userAgent);
string barcode = "3017620422003";
GetProductResponse productResponse = await client.GetProductAsync(barcode);
- Amael BERTEAU
This project is licensed under the Apache 2.0 License - see the LICENSE file for details
Available on NuGet Gallery :