marcortola / food-data-central Goto Github PK
View Code? Open in Web Editor NEWPHP library for the FoodData Central FDC API (USDA nutrient database)
License: MIT License
PHP library for the FoodData Central FDC API (USDA nutrient database)
License: MIT License
Hey, just found out about your USDA API client SDK. Looks great!
Are you planning to support PHP "^8.0"?
I run composer require marcortola/food-data-central
and created my on file run.php like this:
<?php
require_once 'vendor/autoload.php';
$foodDataCentralClient = FoodDataCentralClient::create('MY_API');
// Find food by FDC ID.
$foodItem = $foodDataCentralClient->food()->food(781125);
// Find food nutrients. See the FoodItem interface for more nutrient finders.
$calcium = $foodDataCentralClient->food()->food(781125)->getCalcium();
?>
Command line execution of the file failed due to following error:
PHP Fatal error: Uncaught Error: Class 'FoodDataCentralClient' not found in /home/tomek/Dokumenty/food_data/run.php:5 Stack trace: #0 {main} thrown in /home/tomek/Dokumenty/food_data/run.php on line 5
Here is my php:
PHP 7.4.3 (cli) (built: Oct 6 2020 15:47:56) ( NTS )
Please help me to have this working. You did a great job with the API client anyway!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.