nutrition

USDA FoodData Central nutrition lookup.

USDA FoodData Central nutrition lookup. Two modes: search (query=cheddar cheese) returns matching foods with fdcId, description, data type, category, and brand; detail (fdcId=328637) returns the full analyzed nutrient profile — energy, protein, fats, carbohydrates, vitamins, minerals — with USDA nutrient numbers, amounts, and units (per 100 g/ml unless serving fields indicate otherwise), plus ingredients for branded foods. Filter search by dataType: Foundation and SR Legacy are lab-analyzed generic foods, Branded is the packaged-food label corpus, Survey (FNDDS) is as-consumed dishes. Authoritative USDA data covering ~400k foods — use real analyzed values instead of model-estimated nutrition facts.

get/api/nutrition/food

Request

  • Base URL: https://2s.io
  • URL: https://2s.io/api/nutrition/food
  • Auth: API key in header PAYMENT-SIGNATURE

Query parameters

querystring

Food name to search, e.g. "cheddar cheese". Provide query or fdcId, not both.

fdcIdinteger

FDC food id — returns the full nutrient profile.

dataType'Foundation' | 'SR Legacy' | 'Survey (FNDDS)' | 'Branded'

Restrict search to one data type. Foundation/SR Legacy = analyzed generic foods, Branded = packaged labels, Survey (FNDDS) = as-consumed dishes.

limitinteger

Maximum number of results to return.

pageinteger

Page number (1-based) for paginated results.

trial1

Try before you buy. Set to 1 for one free real call per endpoint per hour — no wallet or payment needed — to verify the endpoint before paying. Equivalent to sending the "X-2s-Trial: 1" request header. Listed only on operations that offer a trial; the others always answer 402.

Response

(unresolved $ref)

Changes

No recorded changes to this operation across all 1 revision of this API.