# USDA Food Nutrients: 8,217 foods per 100 g (`phonic_lily/usda-food-nutrients`) Actor

Search 8,217 foods from USDA FoodData Central (Foundation and SR Legacy): energy, protein, fat, carbohydrate, fiber, sugars, sodium and 18 more nutrients per 100 g, with food category. Embedded data, no scraping, pay per record.

- **URL**: https://apify.com/phonic_lily/usda-food-nutrients.md
- **Developed by:** [Henri bousquet](https://apify.com/phonic_lily) (community)
- **Categories:** Business
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$4.00 / 1,000 food record returneds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## USDA Food Nutrients: 8,217 foods per 100 g

Search 8,217 foods from USDA FoodData Central (Foundation and SR Legacy): energy, protein, fat, carbohydrate, fiber, sugars, sodium and 18 more nutrients per 100 g, with food category. Embedded data, no scraping, pay per record.

**No scraping, no live dependency, no login**: the data is embedded in the Actor and searched locally. You pay per record returned (pay-per-event `food-result`), never for empty runs.

### Input

Every filter is optional; combine them freely. `maxResults` caps both the output and the bill.

### Output fields

- `food_id` : Stable identifier (fdc-<FDC id>).
- `fdc_id` : FoodData Central id.
- `description` : Food description.
- `data_type` : Foundation or SR Legacy.
- `food_category` : USDA food category.
- `ndb_number` : SR/NDB number.
- `publication_date` : Publication date of the entry, YYYY-MM-DD.
- `energy_kcal` : Energy (kcal) per 100 g edible portion, null if not reported.
- `energy_kj` : Energy (kJ) per 100 g edible portion, null if not reported.
- `water_g` : Water (g) per 100 g edible portion, null if not reported.
- `protein_g` : Protein (g) per 100 g edible portion, null if not reported.
- `fat_g` : Total fat (g) per 100 g edible portion, null if not reported.
- `saturated_fat_g` : Saturated fat (g) per 100 g edible portion, null if not reported.
- `monounsaturated_fat_g` : Monounsaturated fat (g) per 100 g edible portion, null if not reported.
- `polyunsaturated_fat_g` : Polyunsaturated fat (g) per 100 g edible portion, null if not reported.
- `cholesterol_mg` : Cholesterol (mg) per 100 g edible portion, null if not reported.
- `carbohydrate_g` : Carbohydrate by difference (g) per 100 g edible portion, null if not reported.
- `fiber_g` : Total dietary fiber (g) per 100 g edible portion, null if not reported.
- `sugars_g` : Total sugars (g) per 100 g edible portion, null if not reported.
- `calcium_mg` : Calcium (mg) per 100 g edible portion, null if not reported.
- `iron_mg` : Iron (mg) per 100 g edible portion, null if not reported.
- `magnesium_mg` : Magnesium (mg) per 100 g edible portion, null if not reported.
- `phosphorus_mg` : Phosphorus (mg) per 100 g edible portion, null if not reported.
- `potassium_mg` : Potassium (mg) per 100 g edible portion, null if not reported.
- `sodium_mg` : Sodium (mg) per 100 g edible portion, null if not reported.
- `zinc_mg` : Zinc (mg) per 100 g edible portion, null if not reported.
- `vitamin_c_mg` : Vitamin C (mg) per 100 g edible portion, null if not reported.
- `vitamin_a_rae_ug` : Vitamin A RAE (ug) per 100 g edible portion, null if not reported.
- `vitamin_d_ug` : Vitamin D (ug) per 100 g edible portion, null if not reported.
- `vitamin_e_mg` : Vitamin E (mg) per 100 g edible portion, null if not reported.
- `vitamin_k_ug` : Vitamin K (ug) per 100 g edible portion, null if not reported.
- `vitamin_b12_ug` : Vitamin B-12 (ug) per 100 g edible portion, null if not reported.
- `folate_dfe_ug` : Folate DFE (ug) per 100 g edible portion, null if not reported.

Every record also carries `license` and `attribution` so you can republish with the required credit.

### Data and licence

USDA FoodData Central download datasets (https://fdc.nal.usda.gov/download-datasets/): Foundation Foods (JSON, 2026-10-29, 424 foods) and SR Legacy (JSON, 2018-04, 7,793 foods). Licence stated at https://fdc.nal.usda.gov/ : data are in the public domain, not copyrighted, published under CC0 1.0 Universal; no permission needed, citing FoodData Central as the source is requested. Branded Foods and Survey (FNDDS) datasets are not included. All nutrient values are per 100 g edible portion. Energy kcal falls back to Atwater general then specific factors when the standard value is absent. Null means the nutrient is not reported for that food; it is never 0 (a reported 0 is a real measured zero). SR Legacy is a frozen 2018 release; Foundation is updated by USDA.

Snapshot date: 2026-10-29 (Foundation), 2018-04 (SR Legacy). Empty values are returned as `null` (never as 0).

# Actor input Schema

## `query` (type: `string`):

Food description (accent- and case-insensitive substring).

## `category` (type: `string`):

Food category (substring) (accent- and case-insensitive substring).

## `dataTypes` (type: `array`):

Dataset (Foundation, SR Legacy). Records with an empty value never match.

## `minProteinG` (type: `number`):

Min protein per 100 g (g). Records with an empty value never match.

## `maxProteinG` (type: `number`):

Max protein per 100 g (g). Records with an empty value never match.

## `minFatG` (type: `number`):

Min fat per 100 g (g). Records with an empty value never match.

## `maxFatG` (type: `number`):

Max fat per 100 g (g). Records with an empty value never match.

## `minCarbohydrateG` (type: `number`):

Min carbohydrate per 100 g (g). Records with an empty value never match.

## `maxCarbohydrateG` (type: `number`):

Max carbohydrate per 100 g (g). Records with an empty value never match.

## `minFiberG` (type: `number`):

Min fiber per 100 g (g). Records with an empty value never match.

## `maxFiberG` (type: `number`):

Max fiber per 100 g (g). Records with an empty value never match.

## `minSugarsG` (type: `number`):

Min sugars per 100 g (g). Records with an empty value never match.

## `maxSugarsG` (type: `number`):

Max sugars per 100 g (g). Records with an empty value never match.

## `minSodiumMg` (type: `number`):

Min sodium per 100 g (mg). Records with an empty value never match.

## `maxSodiumMg` (type: `number`):

Max sodium per 100 g (mg). Records with an empty value never match.

## `minEnergyKcal` (type: `number`):

Min energy per 100 g (kcal). Records with an empty value never match.

## `maxEnergyKcal` (type: `number`):

Max energy per 100 g (kcal). Records with an empty value never match.

## `sortBy` (type: `string`):

Sort order of results. Default: file order (or distance when a radius is given).

## `maxResults` (type: `integer`):

Maximum records returned and billed (1..10000).

## Actor input object example

```json
{
  "maxResults": 100
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset items returned by the run.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("phonic_lily/usda-food-nutrients").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("phonic_lily/usda-food-nutrients").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call phonic_lily/usda-food-nutrients --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,phonic_lily/usda-food-nutrients"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/Zkf0hIISnACO1WqCn/builds/OD0IGDn0mDvxFqTrr/openapi.json
