GETGet Food
https://food-nutrition-information.dataandapis.com/v1/food/{id}
Parâmetros de caminho
| Parâmetro | Exemplo | |
|---|---|---|
| id | 1750340 | Obrigatório |
Exemplo de requisição
curl "https://food-nutrition-information.dataandapis.com/v1/food/1750340" \
-H "X-Api-Key: YOUR_API_KEY"// npm install dataandapis
import { DataAndApis } from "dataandapis";
const client = new DataAndApis(); // reads DATAANDAPIS_API_KEY
const data = await client.foodNutritionInformation.getFood({ id: 1750340 });# pip install dataandapis
from dataandapis import DataAndApis
client = DataAndApis() # reads DATAANDAPIS_API_KEY
data = client.food_nutrition_information.get_food(id=1750340)Exemplo de resposta{
"fdcId": 1750340,
"description": "Cheese, cheddar",
"dataType": "Foundation",
"publicationDate": "4/1/2019",
"foodCategory": {
"description": "Dairy and Egg Products"
},
"foodNutrients": [
{
"nutrient": {
"id": 1008,
"name": "Energy",
"unitName": "kcal"
},
"amount": 403
},
{
"nutrient": {
"id": 1003,
"name": "Protein",
"unitName": "g"
},
"amount": 22.9
},
{
"nutrient": {
"id": 1004,
…
Ver resposta completa
{
"fdcId": 1750340,
"description": "Cheese, cheddar",
"dataType": "Foundation",
"publicationDate": "4/1/2019",
"foodCategory": {
"description": "Dairy and Egg Products"
},
"foodNutrients": [
{
"nutrient": {
"id": 1008,
"name": "Energy",
"unitName": "kcal"
},
"amount": 403
},
{
"nutrient": {
"id": 1003,
"name": "Protein",
"unitName": "g"
},
"amount": 22.9
},
{
"nutrient": {
"id": 1004,
…{
"fdcId": 1750340,
"description": "Cheese, cheddar",
"dataType": "Foundation",
"publicationDate": "4/1/2019",
"foodCategory": {
"description": "Dairy and Egg Products"
},
"foodNutrients": [
{
"nutrient": {
"id": 1008,
"name": "Energy",
"unitName": "kcal"
},
"amount": 403
},
{
"nutrient": {
"id": 1003,
"name": "Protein",
"unitName": "g"
},
"amount": 22.9
},
{
"nutrient": {
"id": 1004,
"name": "Total lipid (fat)",
"unitName": "g"
},
"amount": 33.3
},
{
"nutrient": {
"id": 1005,
"name": "Carbohydrate, by difference",
"unitName": "g"
},
"amount": 3.09
},
{
"nutrient": {
"id": 1087,
"name": "Calcium, Ca",
"unitName": "mg"
},
"amount": 710
}
]
}



