USDA FoodData Central API: It's Free, But Here's Why Developers Switch
Published July 17, 2026
The USDA FoodData Central API (often called the FDC API) is a free government service that returns nutrition data for foods sourced from USDA datasets. It is the canonical source many commercial food APIs are built on. This guide covers how to get an API key, the core endpoints, rate limits, data types, and the practical limits that lead teams to a managed food database API.
Getting a FoodData Central API Key
FoodData Central uses the shared api.data.gov key system. You can experiment with DEMO_KEY, but production apps should sign up for a free key at api.data.gov to lift the rate limit. The key is passed as a query parameter, not a header.
curl "https://api.nal.usda.gov/fdc/v1/foods/search?query=banana&api_key=DEMO_KEY"
Core Endpoints
FoodData Central exposes two endpoints most apps use:
| Endpoint | Purpose |
|---|---|
GET /fdc/v1/foods/search | Full-text search across foods, returns FDC IDs |
GET /fdc/v1/food/{fdcId} | Fetch the full nutrient breakdown for one food |
Look Up a Single Food by FDC ID
curl "https://api.nal.usda.gov/fdc/v1/food/1097473?api_key=YOUR_KEY"
The response returns a foodNutrients array where each nutrient is keyed by a USDA nutrient number (for example, 1008 for energy in kcal, 1003 for protein). Your code has to map those numeric IDs to the fields your app displays.
FoodData Central Data Types
Search results mix several dataset types, and you usually filter by the one you need:
- Foundation and SR Legacy — analyzed generic foods (most accurate for whole foods)
- Branded — manufacturer-submitted packaged foods, includes UPC/GTIN
- Survey (FNDDS) — foods as reported in dietary surveys
Rate Limits and Practical Limits
- Rate limit:
DEMO_KEYis heavily throttled; a signed-up key allows roughly 1,000 requests per hour per IP. High-traffic apps hit this ceiling quickly. - Raw nutrient IDs: you must translate USDA nutrient numbers into calories, protein, carbs, and fat yourself.
- No per-serving scaling: values come per 100g or per portion object; scaling to an arbitrary gram weight is your job.
- Barcode lookup is indirect: branded foods carry a GTIN/UPC, but there is no clean "search by barcode" endpoint.
FoodData Central vs a Managed Calorie API
| Capability | USDA FDC API | Calorie API |
|---|---|---|
| Cost | Free | Free tier, no card |
| Nutrient format | Raw USDA nutrient IDs | Clean calories, protein_g, carbohydrates_g, fat_g |
| Barcode lookup | Indirect (GTIN in payload) | Dedicated /search/barcode/{upc} |
| Per-serving scaling | Manual | Built-in /calc/portion |
| Rate limit | ~1,000/hr per IP | Published per-plan quota |
| Branded + generic + restaurant | Partial | 1M+ foods combined |
The verdict: FoodData Central is excellent free raw data, but you inherit the engineering — nutrient-ID mapping, portion scaling, a barcode layer, and caching around a 1,000/hr limit. If you would rather ship than build that plumbing, the Calorie API wraps USDA and branded data behind one clean JSON schema, with named macro fields, a real barcode endpoint, and built-in scaling.
curl "https://api.calorieapi.com/api/v1/search/foods?q=banana" \
-H "X-API-Key: YOUR_API_KEY"
Start Building
- Get a free API key — no credit card
- Read the docs and test in the playground
- Related: USDA vs a commercial food database
Frequently Asked Questions
Is the USDA FoodData Central API free?
Yes. FoodData Central is a free U.S. government API. You can use DEMO_KEY for testing or sign up at api.data.gov for a free production key with a higher rate limit.
Do I need an API key for FoodData Central?
You can call it with DEMO_KEY, but that key is heavily rate-limited. For any real app you should register a free api.data.gov key, which allows roughly 1,000 requests per hour per IP.
What is the rate limit for the FDC API?
A signed-up api.data.gov key permits about 1,000 requests per hour per IP address. High-traffic apps typically cache responses or move to a managed API to avoid throttling.
Does FoodData Central support barcode lookup?
Branded foods include a GTIN/UPC in the payload, but there is no dedicated search-by-barcode endpoint. Apps that need reliable barcode scanning usually use an API with a dedicated barcode endpoint.
How do I get calories from the FDC API response?
Nutrients are returned in a foodNutrients array keyed by USDA nutrient numbers. Energy in kcal is nutrient number 1008, protein is 1003. You map those IDs to your fields yourself, or use an API that returns named fields.
