# USDA FDC Nutrient Observation Matrix (`nexgenwatch/usda-fdc-nutrient-observation-matrix`) Actor

One nutrient_observation per row of USDA FoodData Central's food_nutrient table — the analytical observation as USDA records it: amount, data_points, statistical min / max / median / loq, footnote, min_year_acquired, percent_daily_value.

- **URL**: https://apify.com/nexgenwatch/usda-fdc-nutrient-observation-matrix.md
- **Developed by:** [NexGen Watch](https://apify.com/nexgenwatch) (community)
- **Categories:** Automation, Developer tools, Lead generation
- **Stats:** 2 total users, 1 monthly users, 93.3% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $13.40 / 1,000 nutrient observations

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 FDC Nutrient Observation Matrix

One **nutrient_observation** per row of USDA FoodData Central's `food_nutrient` table — the analytical
observation as USDA records it: `amount`, `data_points`, statistical `min` / `max` / `median` / `loq`,
`footnote`, `min_year_acquired`, `percent_daily_value` — carried **source-native** together with the
source's own **derivation provenance** (`derivation_id`).

**Differentiation:** this is the filtered, provenance-preserving slice of a ~27-million-row analytical
table, not a re-computed nutrition panel. You supply food IDs and/or nutrient IDs; you get the exact
observations USDA published, with their derivation code intact, and pay per delivered observation. The
1.8 GB `food_nutrient.csv` member is streamed out of the ZIP over HTTP range and **never scanned
unfiltered**.

Output is one `nutrient_observation` row per result; billing is pay-per-event, the value event being one nutrient observation (a $0.02 start fee per run, then $0.02 per nutrient observation). Source: fdc.nal.usda.gov.

No login, no API key and no CAPTCHA solving are involved: the source is read logged-out with an identified contact User-Agent.

**Who buys this**

Buyers usually search for **FoodData Central** or **nutrition data**.

- Analysts, researchers and journalists who need FoodData Central as clean rows.
- Risk, insurance and planning teams joining nutrition data to their own data.
- Data teams that want the official source without building a scraper.

### 📊 Sample Output

[![USDA FDC Nutrient Observation Matrix sample output — a table of real nutrient observation rows (id, fdc_id, nutrient_id, observation_id) from run OnDMrLa0zO172lCk8 on build 0.1.5](https://api.apify.com/v2/key-value-stores/80Y7h3rmVN5CWK7Mw/records/usda-fdc-nutrient-observation-matrix-sample-nw)](https://apify.com/nexgenwatch/usda-fdc-nutrient-observation-matrix?fpr=2ayu9b)

Real rows from run `OnDMrLa0zO172lCk8` on build 0.1.5 (2026-09-19), the same input as the Quick start below — every value is as the source published it (emails masked, long text shortened):

| id | fdc_id | nutrient_id | observation_id | release_date | release_checksum |
|---|---|---|---|---|---|
| 13706927 | 1105904 | 1257 | 13706927 | 2026-04-30 | 6a860d85-1cb35fb7 |
| 13706930 | 1105904 | 1293 | 13706930 | 2026-04-30 | 6a860d85-1cb35fb7 |
| 13706926 | 1105904 | 1253 | 13706926 | 2026-04-30 | 6a860d85-1cb35fb7 |
| 13706921 | 1105904 | 1092 | 13706921 | 2026-04-30 | 6a860d85-1cb35fb7 |
| 13706916 | 1105904 | 1008 | 13706916 | 2026-04-30 | 6a860d85-1cb35fb7 |
| 13706920 | 1105904 | 1089 | 13706920 | 2026-04-30 | 6a860d85-1cb35fb7 |
| 13706925 | 1105904 | 1162 | 13706925 | 2026-04-30 | 6a860d85-1cb35fb7 |
| 13706928 | 1105904 | 1258 | 13706928 | 2026-04-30 | 6a860d85-1cb35fb7 |

The run finished with the status message: `PARTIAL: delivered 18 records (PARTIAL: cap not reached within the 20000-row scan bound of food_nutrient.csv (delivered observations are complete and billed))`

### ✅ What you get

Each row is flat JSON with these fields (from the dataset schema and the sample run; a field the source does not publish for a given row is `null`):

- `record_type` (string/null) — e.g. `nutrient_observation`
- `id` (string/null) — e.g. `13706927`
- `fdc_id` (string/null) — e.g. `1105904`
- `nutrient_id` (string/null) — e.g. `1257`
- `amount` (string/null) — e.g. `0.0`
- `data_points` (string/null) — null in every sample row
- `derivation_id` (string/null) — e.g. `71`
- `min` (string/null) — null in every sample row
- `max` (string/null) — null in every sample row
- `median` (string/null) — null in every sample row
- `loq` (string/null) — null in every sample row
- `footnote` (string/null) — null in every sample row
- `min_year_acquired` (string/null) — null in every sample row
- `percent_daily_value` (string/null) — e.g. `0.0`
- `observation_id` (string/null) — e.g. `13706927`
- `source_url` (string/null) — e.g. `https://fdc.nal.usda.gov/food-details/1105904/nutrients`
- `source` (string/null) — e.g. `usda-fdc-nutrient-observation-matrix`
- `release_date` (string/null) — e.g. `2026-04-30`
- `observed_at` (string/null) — e.g. `2026-09-19T00:24:07Z`
- `release_checksum` (string/null) — e.g. `6a860d85-1cb35fb7`
- `license` (string/null) — e.g. `USDA FoodData Central — CC0 1.0 (public domain dedication). Cite: U.S. Departmen`
- `attribution` (string/null) — e.g. `USDA Agricultural Research Service — FoodData Central (https://fdc.nal.usda.gov)`
- `terminal` (string/null) — null in every sample row
- `scope` (string/null) — null in every sample row
- `note` (string/null) — null in every sample row
- `reported_total` (string/integer/null) — null in every sample row
- `raw_seen` (string/integer/null) — null in every sample row
- `duplicates` (string/integer/null) — null in every sample row
- `unique_found` (string/integer/null) — null in every sample row
- `delivered` (string/integer/null) — null in every sample row

**✅ What you get**

- `record_type` (string/null) — e.g. `nutrient_observation`
- `id` (string/null) — e.g. `13706927`
- `fdc_id` (string/null) — e.g. `1105904`
- `nutrient_id` (string/null) — e.g. `1257`
- `amount` (string/null) — e.g. `0.0`
- `data_points` (string/null) — null in every sample row
- `derivation_id` (string/null) — e.g. `71`
- `min` (string/null) — null in every sample row
- `max` (string/null) — null in every sample row
- `median` (string/null) — null in every sample row
- `loq` (string/null) — null in every sample row
- `footnote` (string/null) — null in every sample row
- `min_year_acquired` (string/null) — null in every sample row
- `percent_daily_value` (string/null) — e.g. `0.0`
- `observation_id` (string/null) — e.g. `13706927`
- `source_url` (string/null) — e.g. `https://fdc.nal.usda.gov/food-details/1105904/nutrients`
- `source` (string/null) — e.g. `usda-fdc-nutrient-observation-matrix`
- `release_date` (string/null) — e.g. `2026-04-30`
- `observed_at` (string/null) — e.g. `2026-09-18T23:35:56Z`
- `release_checksum` (string/null) — e.g. `6a860d85-1cb35fb7`
- `license` (string/null) — e.g. `USDA FoodData Central — CC0 1.0 (public domain dedication). Cite: U.S. Departmen`
- `attribution` (string/null) — e.g. `USDA Agricultural Research Service — FoodData Central (https://fdc.nal.usda.gov)`
- `terminal` (string/null) — null in every sample row
- `scope` (string/null) — null in every sample row
- `note` (string/null) — null in every sample row
- `reported_total` (string/integer/null) — null in every sample row
- `raw_seen` (string/integer/null) — null in every sample row
- `duplicates` (string/integer/null) — null in every sample row
- `unique_found` (string/integer/null) — null in every sample row
- `delivered` (string/integer/null) — null in every sample row

### ⚙️ Sample inputs

**1. Quick start — the Store example (this is what the sample above came from)**

```json
{
  "fdcIds": [
    "1105904"
  ],
  "maxRecords": 10,
  "maxScanRows": 20000
}
```

The sample run charged exactly: 1 × $0.02 apify-actor-start + 18 × $0.02 nutrient_observation = **$0.38** on the Free tier — every delivered row was billed.
If you leave `maxRecords` out, the run delivers at most 50 rows (the schema default); pass a number up to 2500 for a bigger export. An explicit value is always honoured up to that maximum.

**2. A smaller, narrowed run**

```json
{
  "fdcIds": [
    "1105904"
  ],
  "maxRecords": 5,
  "maxScanRows": 20000
}
```

Caps the run at 5 rows — about $0.12 on the Free tier ($0.02 start + 5 × $0.02).

**3. A full-size run**

```json
{
  "fdcIds": [
    "1105904"
  ],
  "maxRecords": 2500,
  "maxScanRows": 20000
}
```

Up to 2500 rows — about $50.02 on the Free tier ($0.02 start + 2500 × $0.02) if the source has that many.

### 🧾 JSON sample record

One real record from run `OnDMrLa0zO172lCk8`, exactly as it lands in the dataset (emails masked, long text shortened):

```json
{
  "record_type": "nutrient_observation",
  "id": "13706927",
  "fdc_id": "1105904",
  "nutrient_id": "1257",
  "amount": "0.0",
  "data_points": null,
  "derivation_id": "71",
  "min": null,
  "max": null,
  "median": null,
  "loq": null,
  "footnote": null,
  "min_year_acquired": null,
  "percent_daily_value": null,
  "observation_id": "13706927",
  "source_url": "https://fdc.nal.usda.gov/food-details/1105904/nutrients",
  "source": "usda-fdc-nutrient-observation-matrix",
  "release_date": "2026-04-30",
  "observed_at": "2026-09-19T00:24:07Z",
  "release_checksum": "6a860d85-1cb35fb7",
  "license": "USDA FoodData Central — CC0 1.0 (public domain dedication). Cite: U.S. Department of Agriculture, Agricultural Research Service, FoodData Central.",
  "attribution": "USDA Agricultural Research Service — FoodData Central (https://fdc.nal.usda.gov)"
}
```

### 🔧 How it works

**Source.** The actor reads fdc.nal.usda.gov — endpoints: `https://fdc.nal.usda.gov`, `https://fdc.nal.usda.gov/fdc-datasets/FoodData_Central_csv_`. Public pages and feeds only; nothing behind a login.

**Transport.** Plain HTTPS from the Apify platform, no proxy. robots.txt is read first and a disallowed path is never fetched. Every request carries an identified contact User-Agent. Pacing: `CRAWL_DELAY`=0.0.

**Terminal states.** A run ends NORMAL, CAPPED (your cap was reached), PARTIAL (something was withheld and the message says what), GENUINE_EMPTY (the source was read and truly had nothing in scope) or BLOCKED (the source refused or changed shape — the run FAILS loud and bills nothing). A zero-row run is never reported as a silent success.

**Charging.** Each nutrient observation is charged at the moment it is pushed (`nutrient_observation`); a row that fails to charge is not delivered, so the dataset count always equals the charged count.

**🔧 How it works**

**Source**

The official USDA FoodData Central full-CSV dump only —
`https://fdc.nal.usda.gov/fdc-datasets/FoodData_Central_csv_<release>.zip` (newest release auto-resolved;
`food_nutrient.csv` member). robots.txt is `User-agent: * / Disallow:` (nothing disallowed). The FDC API
and search routes are never touched. Release date + archive checksum (ETag) ride on every record.

**Filters (mandatory — enforced in code)**

`fdcIds` and/or `nutrientIds`. With **neither**, the actor raises a loud, unbilled Block — the 1.8 GB
member is never scanned. Results are capped by `maxRecords` (default and max 2500) and bounded by
`maxScanRows` over the streamed member (PARTIAL if the cap is not reached within the bound).

**What it does NOT do**

**No calculated diet scores, no nutrient math, no interpretation.** Every value is the source figure
carried verbatim; the `derivation_id` tells you how USDA derived it. This actor makes no health or
dietary determination.

**Licence**

USDA FoodData Central — **CC0 1.0 (public domain dedication)**; the dumps add no new rights. Cite:
U.S. Department of Agriculture, Agricultural Research Service, FoodData Central (https://fdc.nal.usda.gov).

**Billing**

Pay-per-event. `nutrient_observation` is charged **once per delivered observation** ($0.02), GOLD-floored
−10 / −20 / −33% volume ladder. `apify-actor-start` ($0.02) is platform-reserved, never charged in code.
A filter that matches nothing is a clean GENUINE_EMPTY — nothing billed.

**What is not done.** No login, no cookie or CAPTCHA bypass, no private or personal-account data, no browser automation.

### 💰 Pricing example

| Event | Free | Bronze | Silver | Gold |
|---|---|---|---|---|
| Actor Start (`apify-actor-start`) | $0.02 | $0.02 | $0.02 | $0.02 |
| Nutrient Observation (`nutrient_observation`) | $0.02 | $0.018 | $0.016 | $0.0134 |

Worked at the live Free-tier price:

- 8 nutrient observations: $0.02 start + 8 × $0.02 = **$0.18**
- 25 nutrient observations: $0.02 start + 25 × $0.02 = **$0.52**
- 50 nutrient observations: $0.02 start + 50 × $0.02 = **$1.02**

A run that delivers zero rows charges the $0.02 start fee only. A BLOCKED run (source refused) fails loud and charges no value event. The start fee is charged once per GB of run memory; the default run memory is 4096 MB.

Yield on the sample run: `PARTIAL: delivered 18 records (PARTIAL: cap not reached within the 20000-row scan bound of food_nutrient.csv (delivered observations are complete and billed))`. `maxRecords` is a hard ceiling on what is delivered and billed, never a target.

### ⚖️ Legal & ToS

This actor reads public, logged-out pages and feeds published by fdc.nal.usda.gov. It collects only what the source publishes to any visitor, keeps to the source's robots rules (checked on every run), identifies itself with a contact User-Agent, and does not access accounts, private data or anything behind authentication. Use the output in line with the source's terms and your local law; the intended use is B2B research and monitoring.

### ❓ FAQ

**Q: Do I need an API key or a login?**\
A: No. The source (fdc.nal.usda.gov) is read logged-out; the input schema has no key field and the actor carries no secrets.

**Q: Why did my run return 0 rows?**\
A: Read the run's status message. GENUINE_EMPTY means the source was read and had nothing in scope for your input; BLOCKED means the source refused and the run failed without billing a value event — retry later or narrow the input. A zero-row run bills the start fee only.

**Q: How many rows can one run return?**\
A: Up to `maxRecords` (default 50). Raise the cap for a bigger run; you pay per delivered row.

**Q: How fresh is the data?**\
A: Every run reads the source live at run time; nothing is cached between runs. Put it on a schedule for a continuous feed.

**Q: What formats can I export?**\
A: The dataset downloads as JSON, CSV, Excel, XML or RSS from the run's Dataset tab or the Apify API, and any run can push to a webhook or integration.

**Q: How is this different from the other NexGen Watch actors actors?**\
A: Same output shape and billing model; this one covers fdc.nal.usda.gov. The siblings under **Related Actors** cover the other sources or slices — run several on one schedule for a combined feed.

**Q: Are there rate limits?**\
A: The actor paces itself against the source (`CRAWL_DELAY`=0.0) and honours its robots rules; there is no per-buyer limit beyond your Apify plan's concurrency.

### 🆘 Troubleshooting

- **Run FAILED with BLOCKED** → the source refused the request or changed its page shape → nothing was billed beyond the start fee; retry after a while, and if it persists open an Issue with the run id.
- **Status says CAPPED** → your cap (`maxRecords`) was reached → raise it for a bigger run.
- **Input validation error on start** → a field is outside the schema's allowed values → start from the Quick start block and change one field at a time.
- **Run TIMED-OUT** → a very wide request on a slow day → raise the run timeout in Run options or narrow the input; what was delivered before the timeout is still in the dataset.

### 🔗 Related Actors

- [UK Licensed Sponsor Register (Workers)](https://apify.com/nexgenwatch/uk-licensed-sponsor-register?fpr=2ayu9b) — Each record carries the organisation, town/city, county, licence type & rating, and immigration route from the newest official CSV, with the register…
- [USDA Branded Food Product Master](https://apify.com/nexgenwatch/usda-branded-food-product-master?fpr=2ayu9b) — One structured branded_food_record per branded product in USDA FoodData Central — GTIN/UPC, brand owner and name, serving size, market country, and p…
- [USDA FDC Ingredient / Label Attribute Index](https://apify.com/nexgenwatch/usda-fdc-ingredient-label-attribute-index?fpr=2ayu9b) — One food_attribute_record per row of USDA FoodData Central's food_attribute table — the heterogeneous per-food attribute values USDA records (an attr…
- [USDA FDC Portion / Serving Weight Master](https://apify.com/nexgenwatch/usda-fdc-portion-serving-weight-master?fpr=2ayu9b) — One food_portion_record per row of USDA FoodData Central's food_portion table — a food's serving/portion definition: portion ID, food FDC ID, serving…
- [USDA FDC Product Update Ledger](https://apify.com/nexgenwatch/usda-fdc-product-update-ledger?fpr=2ayu9b) — One food_update_record per entry in USDA FoodData Central's own product update log — the FDC id, the product description, and the last_updated date,…
- [USDA FNDDS Ingredient-Nutrient Matrix](https://apify.com/nexgenwatch/usda-fndds-ingredient-nutrient-matrix?fpr=2ayu9b) — One fndds_nutrient_record per row of USDA FoodData Central's fndds_ingredient_nutrient_value table — a single nutrient value for an FNDDS ingredient…
- 🏢 **About NexGen Watch** — NexGen Watch is a catalog of more than 300 public data actors built on official sources, pay-per-result. Browse the catalog at [apify.com/nexgenwatch](https://apify.com/nexgenwatch?fpr=2ayu9b).

### ⭐ Found this useful?

If this actor saved you a manual check, a quick **[review on the Apify Store](https://apify.com/nexgenwatch/usda-fdc-nutrient-observation-matrix?fpr=2ayu9b)** helps other teams find it. Feature request or a source that changed? Open it from the **Issues** tab — every one is read.

# Actor input Schema

## `fdcIds` (type: `array`):

FoodData Central fdc_id values, e.g. \["1105904"]. At least one of fdcIds / nutrientIds is REQUIRED — the 1.8 GB food_nutrient member is never scanned unfiltered.

## `nutrientIds` (type: `array`):

FDC nutrient_id values, e.g. \["1008"] (Energy). Combine with fdcIds to narrow.

## `maxRecords` (type: `integer`):

Max nutrient observations delivered (buyer bound; one charge per delivered observation). Hard-capped at 2500.

## `maxScanRows` (type: `integer`):

Hard scan bound over the streamed food_nutrient.csv member — a finite run over the ~27M-row file. Default 500000; PARTIAL if the cap is not reached within it.

## `releaseUrl` (type: `string`):

Pin a specific FoodData_Central_csv\_<date>.zip URL. Default: newest release auto-resolved.

## `userAgent` (type: `string`):

Override the transparent crawler UA.

## `searchText` (type: `string`):

Optional. Keep only rows where any field contains this text (case-insensitive, substring). Applied after the source is read and BEFORE the maxRecords cap, so the cap counts matches and only delivered matches are billed. Zero matches = EMPTY_SELECTION, nothing charged beyond the start fee.

## `fieldMatch` (type: `object`):

Optional. {"column": "text"} keeps rows whose named output column contains the text (case-insensitive); a list of texts means any of them; several columns must all match. Column names are the dataset fields shown in the sample output. Applied BEFORE the maxRecords cap and before billing.

## Actor input object example

```json
{
  "fdcIds": [
    "1105904"
  ],
  "nutrientIds": [],
  "maxRecords": 10,
  "maxScanRows": 20000
}
```

# Actor output Schema

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

No description

# 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 = {
    "fdcIds": [
        "1105904"
    ],
    "maxRecords": 10,
    "maxScanRows": 20000
};

// Run the Actor and wait for it to finish
const run = await client.actor("nexgenwatch/usda-fdc-nutrient-observation-matrix").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 = {
    "fdcIds": ["1105904"],
    "maxRecords": 10,
    "maxScanRows": 20000,
}

# Run the Actor and wait for it to finish
run = client.actor("nexgenwatch/usda-fdc-nutrient-observation-matrix").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 '{
  "fdcIds": [
    "1105904"
  ],
  "maxRecords": 10,
  "maxScanRows": 20000
}' |
apify call nexgenwatch/usda-fdc-nutrient-observation-matrix --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nexgenwatch/usda-fdc-nutrient-observation-matrix"
        }
    }
}
```

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/RaL0QSfu2R1xJ10xe/builds/qaKE6DA77WIE3TcbS/openapi.json
