USDA Food Nutrition Scraper - Calories, Macros & Nutrients
Pricing
from $0.50 / 1,000 results
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
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
4 days ago
Last modified
Categories
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:
| Field | Description |
|---|---|
fdc_id | FoodData Central ID (stable identifier) |
description | Food name, e.g. Bananas, raw |
data_type | Foundation, SR Legacy, Survey (FNDDS) or Branded |
food_category | e.g. Fruits and Fruit Juices |
brand_owner / brand_name | Manufacturer and brand (branded foods) |
ingredients | Full ingredient statement (capped at 2,000 chars) |
serving_size / serving_size_unit | e.g. 32 / g |
publication_date | ISO date (2019-04-01) |
calories_kcal | Energy in kcal (never kJ) |
protein_g, fat_g, carbs_g | Core macros per 100 g |
fiber_g, sugars_g, saturated_fat_g, cholesterol_mg | Extended macros |
sodium_mg, calcium_mg, iron_mg, potassium_mg, vitamin_c_mg | Key micronutrients |
nutrient_count | How many nutrients the record carries (up to 114) |
all_nutrients | Compact {name, value, unit} list (first 40) |
url | Link to the food on fdc.nal.usda.gov |
source, scraped_at | usda-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
| Field | Type | Default | Description |
|---|---|---|---|
mode | select | search | search = find foods by keyword, foods = fetch details by FDC ID |
queries | array | ["banana", "chicken breast"] | Search terms (search mode) |
fdcIds | array | [] | FoodData Central IDs (foods mode) |
apiKey | string | DEMO_KEY | Optional personal USDA API key |
maxItems | integer | 100 | Hard 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:
- Go to https://fdc.nal.usda.gov/api-key-signup
- Enter your name and email.
- The key arrives instantly by email.
- 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
- Search mode calls
/fdc/v1/foods/searchwith 50 results per page and walks pages untilmaxItemsis reached. - Foods mode calls the bulk
/fdc/v1/foodsendpoint in batches of 20 IDs (the USDA maximum), falling back to single/fdc/v1/food/{id}requests if the bulk call fails. - Nutrients are resolved by USDA
nutrientIdfirst, thennutrientNumber, then by name โ so both the flat search shape and the nested detail shape map into one consistent schema. - 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.
Related actors
- Fruityvice Scraper โ fruit nutrition and taxonomy
- Open Food Facts Scraper โ global branded product database
- TheMealDB Scraper โ recipes, ingredients and meal categories
- Recipe Scraper โ structured recipes from recipe sites
Legal & data source
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.