Food

Ingredient Nutrition Detail

0calls
3 credits / call

Get the full nutrition profile of an ingredient by name or code.

GET
uapis.cn
/api/v1/food/ingredient/detail
Query parameters
2
name
string

Ingredient name, e.g. 小白菜. Mutually exclusive with code.

code
string

Ingredient code from the search endpoint. Takes precedence when provided.

What you get

  • Core nutrition: calories (kcal/kJ), protein, fat, carbohydrates, dietary fiber, sodium.
  • Blood sugar metrics (gi / gl): glycemic index and load, useful for diabetic diets.
  • Health rating (health_light / appraise): eating recommendation.
  • Household units (units): conversions like "1 piece ≈ 89g ≈ 12 kcal".

Parameters

Provide either code or name. Recommended flow: search first to obtain code, then query detail. When only name is given, the best search match is used.

Query parameters

name
stringoptional

Ingredient name, e.g. 小白菜. Mutually exclusive with code.

code
stringoptional

Ingredient code from the search endpoint. Takes precedence when provided.

Response

200 / OK

Lookup succeeded. Returns the full nutrition profile.

JSON
{
  "code": "xiaobaicai",
  "name": "小白菜",
  // kcal per 100g
  "calory": "14",
  // kJ per 100g
  "calory_kj": "59",
  "weight": "100",
  "health_light": 1,
  "is_liquid": false,
  "thumb_image_url": "string",
  "large_image_url": "string",
  // g per 100g
  "protein": "1.5",
  // g per 100g
  "fat": "0.3",
  // g per 100g
  "fiber_dietary": "1.1",
  // g per 100g
  "carbohydrate": "2.4",
  // mg per 100g
  "natrium": "73",
  // Glycemic index
  "gi": "15",
  // Glycemic load
  "gl": "0.4",
  "appraise": "推荐食用",
  "units": [
    {
      "amount": "1",
      "unit": "颗",
      "weight": "89",
      "calory": "12"
    }
  ]
}

400 / Bad Request

Invalid parameters. Either name or code is required.

JSON
{
  "code": "INVALID_PARAMETER",
  "message": "name 和 code 至少提供一个"
}

404 / Not Found

Ingredient not found.

JSON
{
  "code": "NO_MATCH",
  "message": "没有找到相关结果: xxx"
}

502 / Bad Gateway

Data service temporarily unavailable. Retry later.

JSON
{
  "code": "SERVICE_UNAVAILABLE",
  "message": "查询服务暂时不可用,请稍后重试"
}