USDA Nutrition Database Scraper - Food & Calories avatar

USDA Nutrition Database Scraper - Food & Calories

Pricing

from $2.00 / 1,000 results

Go to Apify Store
USDA Nutrition Database Scraper - Food & Calories

USDA Nutrition Database Scraper - Food & Calories

Search the USDA FoodData Central database for nutrition facts. Get calories, protein, fat, carbs, fiber, sodium, and all nutrients for 300K+ foods. Includes branded products with UPC codes.

Pricing

from $2.00 / 1,000 results

Rating

0.0

(0)

Developer

deusex machine

deusex machine

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

17 days ago

Last modified

Categories

Share

USDA Nutrition Scraper

Searches the USDA FoodData Central database and returns nutrition facts for any food item. Gets calories, protein, fat, carbs, fiber, and the full nutrient breakdown.

What data does it extract?

FieldDescription
fdcIdUSDA FoodData Central unique ID
descriptionFood item name (e.g. Chicken breast, raw)
brandNameBrand or manufacturer (for branded items)
ingredientsIngredient list text
servingSizeServing size amount
servingSizeUnitServing size unit (usually g)
caloriesEnergy in kcal
proteinProtein in grams
fatTotal fat in grams
carbsTotal carbohydrates in grams
fiberDietary fiber in grams
sugarTotal sugars in grams
sodiumSodium in milligrams
cholesterolCholesterol in milligrams
allNutrientsFull array of all nutrients with name, amount, and unit
dataTypeUSDA dataset: Foundation, SR Legacy, Branded, or Survey
publishedDateDate the record was published
upcUPC barcode (for branded products)
searchQueryThe search term that matched this item

Use cases

  • Nutrition apps — Build food databases with accurate USDA-sourced macros and micronutrients
  • Meal planning tools — Look up calories and macros for recipe ingredients in bulk
  • Product comparison — Compare nutrition across branded products by searching specific brands
  • Diet research — Pull nutrient data for hundreds of foods to analyze dietary patterns
  • Label verification — Cross-check product nutrition labels against USDA reference data

How to use

Search for basic foods:

{
"searchQueries": ["chicken breast", "brown rice", "avocado"],
"maxResults": 10
}

Get branded products only:

{
"searchQueries": ["Cheerios", "Coca Cola"],
"maxResults": 50,
"dataType": "Branded"
}

Pull large datasets for research:

{
"searchQueries": ["salmon"],
"maxResults": 500,
"dataType": "Foundation"
}

Input parameters

ParameterTypeDefaultDescription
searchQueriesarray[]Food search terms (e.g. "chicken breast", "oatmeal")
maxResultsinteger100Max results per query (1-500). Pagination handled automatically
dataTypestring""Filter by USDA dataset: "" (all), "Foundation", "SR Legacy", "Branded", "Survey"

Output example

{
"fdcId": 171077,
"description": "Chicken, broilers or fryers, breast, skinless, boneless, meat only, raw",
"brandName": null,
"ingredients": null,
"servingSize": 100,
"servingSizeUnit": "g",
"calories": 120,
"protein": 22.5,
"fat": 2.62,
"carbs": 0,
"fiber": 0,
"sugar": 0,
"sodium": 45,
"cholesterol": 73,
"allNutrients": [
{ "name": "Energy", "amount": 120, "unit": "KCAL" },
{ "name": "Protein", "amount": 22.5, "unit": "G" },
{ "name": "Total lipid (fat)", "amount": 2.62, "unit": "G" }
],
"dataType": "Foundation",
"publishedDate": "2024-10-31",
"upc": null,
"searchQuery": "chicken breast"
}

Performance & cost

  • Uses the USDA FoodData Central API (free, no key needed — uses the DEMO_KEY)
  • Rate limited to ~30 requests/hour with the demo key, so large queries take time
  • Pure HTTP requests, no browser — minimal compute cost

FAQ

Do I need a USDA API key? No. The actor uses the free DEMO_KEY which is rate-limited but works without registration. For heavy use, you can get a free key at https://fdc.nal.usda.gov/api-key-signup.html.

What's the difference between the data types? Foundation has lab-analyzed whole foods. SR Legacy is the classic USDA reference database. Branded has commercial products with UPC codes. Survey has foods as consumed in dietary surveys.

Why does maxResults cap at 500? The USDA API returns 50 items per page. The actor paginates automatically, but capping at 500 keeps run times reasonable given the rate limits.

Can I search for specific brands? Yes. Use the brand name as your search query (e.g. "Cheerios") and set dataType to "Branded" to filter out generic foods.