USDA Food Nutrition Scraper - Calories, Macros & Nutrients avatar

USDA Food Nutrition Scraper - Calories, Macros & Nutrients

Pricing

from $0.50 / 1,000 results

Go to Apify Store
USDA Food Nutrition Scraper - Calories, Macros & Nutrients

USDA Food Nutrition Scraper - Calories, Macros & Nutrients

$0.5/1K ๐Ÿ”ฅ USDA food nutrition scraper! Calories, macros & 100+ nutrients for any food. No signup. JSON, CSV, Excel or API in seconds. Power nutrition apps & diet trackers โšก

Pricing

from $0.50 / 1,000 results

Rating

0.0

(0)

Developer

ninhothedev

ninhothedev

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

4 days ago

Last modified

Share

USDA Food Nutrition Scraper โ€” Calories, Macros & 100+ Nutrients

Get official USDA nutrition data for any food โ€” calories, protein, carbs, fat, fiber, sugars, sodium, vitamins and minerals โ€” straight from the U.S. Department of Agriculture's FoodData Central database (600,000+ foods, including branded supermarket products).

Search by keyword (banana, greek yogurt, Cheerios) or pull full nutrient records by FDC ID. No signup needed โ€” the actor ships with the shared USDA DEMO_KEY and works out of the box. Add your own free key for higher limits.


What you get

One dataset item per food, ready for a nutrition app, a diet tracker or a training set:

FieldDescription
fdc_idFoodData Central ID (stable identifier)
descriptionFood name, e.g. Bananas, raw
data_typeFoundation, SR Legacy, Survey (FNDDS) or Branded
food_categorye.g. Fruits and Fruit Juices
brand_owner / brand_nameManufacturer and brand (branded foods)
ingredientsFull ingredient statement (capped at 2,000 chars)
serving_size / serving_size_unite.g. 32 / g
publication_dateISO date (2019-04-01)
calories_kcalEnergy in kcal (never kJ)
protein_g, fat_g, carbs_gCore macros per 100 g
fiber_g, sugars_g, saturated_fat_g, cholesterol_mgExtended macros
sodium_mg, calcium_mg, iron_mg, potassium_mg, vitamin_c_mgKey micronutrients
nutrient_countHow many nutrients the record carries (up to 114)
all_nutrientsCompact {name, value, unit} list (first 40)
urlLink to the food on fdc.nal.usda.gov
source, scraped_atusda-fdc + UTC timestamp

Every field is nullable โ€” USDA records vary a lot between branded and lab-analysed foods, so missing nutrients come back as null instead of silently becoming 0.

Sample output

{
"fdc_id": 173944,
"description": "Bananas, raw",
"data_type": "SR Legacy",
"food_category": "Fruits and Fruit Juices",
"serving_size": null,
"publication_date": "2019-04-01",
"calories_kcal": 89.0,
"protein_g": 1.09,
"fat_g": 0.33,
"carbs_g": 22.84,
"fiber_g": 2.6,
"sugars_g": 12.23,
"sodium_mg": 1.0,
"potassium_mg": 358.0,
"vitamin_c_mg": 8.7,
"nutrient_count": 114,
"url": "https://fdc.nal.usda.gov/food-details/173944/nutrients",
"source": "usda-fdc"
}

Input

FieldTypeDefaultDescription
modeselectsearchsearch = find foods by keyword, foods = fetch details by FDC ID
queriesarray["banana", "chicken breast"]Search terms (search mode)
fdcIdsarray[]FoodData Central IDs (foods mode)
apiKeystringDEMO_KEYOptional personal USDA API key
maxItemsinteger100Hard cap on dataset items (max 1,000)
{
"mode": "search",
"queries": ["banana", "greek yogurt", "chicken breast"],
"maxItems": 150,
"apiKey": "DEMO_KEY"
}

Fetching specific foods:

{
"mode": "foods",
"fdcIds": ["173944", "171077", "2012128"],
"apiKey": "DEMO_KEY"
}

About the DEMO_KEY (and how to get a free key)

The USDA FoodData Central API is free, but every request needs an API key. It accepts the shared DEMO_KEY, which is why this actor runs with zero setup.

Verified limits (measured against the live API): with DEMO_KEY the API returns X-RateLimit-Limit: 10 โ€” roughly 10 requests per hour per IP address, with a daily ceiling on top. That is enough for a few hundred foods per run (search returns 50 foods per request, detail lookups return 20 foods per request), but it is shared with everyone else using the demo key, so it can be exhausted.

Get your own free key in 30 seconds โ€” no credit card, no approval wait:

  1. Go to https://fdc.nal.usda.gov/api-key-signup
  2. Enter your name and email.
  3. The key arrives instantly by email.
  4. Paste it into the USDA API key input field.

A personal key raises the limit to 1,000 requests/hour, i.e. up to 50,000 foods per hour.

If the demo key is exhausted, the run fails with a clear message telling you to add your own key or retry in an hour โ€” it never returns a half-empty dataset silently.


Use cases

  • Nutrition apps โ€” back a calorie counter or macro tracker with authoritative government data instead of crowd-sourced entries.
  • Recipe analysis โ€” resolve every recipe ingredient to calories and macros to compute per-serving nutrition automatically.
  • Diet tracking & coaching โ€” build meal plans, check micronutrient coverage, generate client-facing nutrient reports.
  • Food datasets & research โ€” assemble branded-product datasets with ingredient statements for ML, market research or labelling compliance work.

Pricing

Pay only for Apify platform usage โ€” roughly $0.5 per 1,000 foods. Runs on 512 MB, no proxies required (the USDA API is public), and the actor batches requests to keep API and compute cost minimal.


How it works

  1. Search mode calls /fdc/v1/foods/search with 50 results per page and walks pages until maxItems is reached.
  2. Foods mode calls the bulk /fdc/v1/foods endpoint in batches of 20 IDs (the USDA maximum), falling back to single /fdc/v1/food/{id} requests if the bulk call fails.
  3. Nutrients are resolved by USDA nutrientId first, then nutrientNumber, then by name โ€” so both the flat search shape and the nested detail shape map into one consistent schema.
  4. Duplicate FDC IDs across queries are deduplicated automatically.

Requests use curl_cffi with a Chrome 124 TLS fingerprint and fall back to plain urllib if that is unavailable.



Data comes from the U.S. Department of Agriculture's FoodData Central, a public-domain U.S. government dataset. USDA does not endorse any product or service. This actor only reads the official public API and stores no personal data.