Questions tagged [usda-fooddata-central-api]

14 questions
1
vote
1 answer

GZipCodec().decode does not work in flutter for the target web. Is there a workaround?

GZipCodec().decode does not work in flutter for the target web. Is there a workaround? The following snippet works for the target 'android' and it works for the target 'windows'. List gzipped = providerFDC.fdcdata_gzipped.codeUnits; …
K.Karamazen
  • 176
  • 1
  • 8
1
vote
1 answer

Use USDA Food API to search by food name instead of foodID

I am using an API to access the USDA food database and pull some nutrient data for a particular food, do some calculations (with another function partially shown here). I would like to find a way to search by a food name rather than foodID. Then…
0
votes
0 answers

How do I resolve the CORS error when calling a third-party API in Next.js?

In my Next.js application, I'm using the App Router and I want to make a GET request to a third-party API. But I get this error: Access to fetch at 'https://thirdpartyapi.com/search' from origin 'http://localhost:3000' has been blocked by CORS…
0
votes
0 answers

How to prioritize the sub-database in the USDA central food database?

Looking for help with the USDA central food API: I am working on a program that is using the USDA central food database API to collect nutritional information on food. The program takes an input (a food name) and searches the database and returns…
0
votes
0 answers

Fetch Error while getting data from food-data-central API

So I am trying to get some data from the food-data-central API. In my program I console log the data, but I don't get any results on the console. The only thing I get is an error about Fetch Error import fetch from "node-fetch" const params = { …
0
votes
2 answers

I am trying to console log a string and some data from json

The strings that I want to printed in the console earlier than the json data. I am now working with the food data central API const fetch = require("node-fetch"); const params = { api_key: '', query: 'chicken breast raw', …
0
votes
3 answers

How can I get specific data from a REST API in?

So I'm trying to access data frim a rest api using java code and I'm not very experienced in getting data from an api using java. I had found the code below on another question. This code was able to output all the data from the link but I'm a bit…
Quibbs
  • 3
  • 2
0
votes
0 answers

add output to see api result

I'm wondering why the max foods is capped out at 10k foods? There are well over 1 million foods in their DB and no matter how I hit that API it maxes out at 10k for for each type (branded, foundation, legacy). Here is my code to prove it: dataType…
jKraut
  • 2,325
  • 6
  • 35
  • 48
0
votes
0 answers

How to fix Target of URI doesn't exist: 'package:food_recipe/models/recipe.dart'?

I am using Android Studio as IDE. I get an error "Target of URI doesn't exist: 'package:food_recipe/models/recipe.dart'" when I import the package. I tried "flutter pub cache repair"folow by "flutter clean" , "flutter pub get" and "flutter package…
Rfs
  • 1
0
votes
0 answers

Trying to use USDA Farmers' Market API in a Flutter project

I'm trying to use a USDA API for farmers markets in a Flutter project. Here's the API instructions. https://www.usdalocalfoodportal.com/fe/datasharing/ I'm basically following this guidance to build the Flutter app and get the USDA…
Smiles4U
  • 65
  • 1
  • 8
0
votes
2 answers

Is there a way to stop overwriting Object values?

I am trying to pull information from the USDA Food Data Central api. Specifically I would like to pull the "name" found under "nutrient" and the "amount". The information pulled is shown in this snippet: Input- reports[item.fdcId] 1588171:…
0
votes
0 answers

How to put serving size in USDA API?

I am using USDA API for personal use but stuck at a problem on food central website, there is an option to select portion or serving size, but I am not sure how to do this with the API. I have API key as well and have read all its documentation, but…
James
  • 1,124
  • 3
  • 17
  • 37
0
votes
1 answer

Mapping from JSON Get Request. Undefined

I am trying to connect to the USDA Food Central database using an API. let uri = encodeURI(`https://api.nal.usda.gov/fdc/v1/foods/search?api_key=${MY_API_KEY}&query=${search}`) I want to use the API to map certain fields. class AddFoodItemList…
0
votes
1 answer

Using the USDA API

USDA API Link for Reference: https://ndb.nal.usda.gov/ndb/doc/apilist/API-SEARCH.md I'm currently creating a program in Python that references the USDA Search API. I tried to set the data source parameter to "Standard Reference" by adding &ds=SR…