Normalize

Canonicalize inconsistent nutrition inputs into a single canonical schema — consistent field names and units, ready to store or compare across sources.

Endpoint

POST /v1/normalize

Requests are made to:

Base URL

https://api.nutritionsignals.com

Authentication

All requests require an API key sent as a Bearer token in the Authorization header.

Authorization header

Authorization: Bearer YOUR_API_KEY

Request body

Send any reasonable nutrition payload. Normalize accepts multiple shapes and aliases.

Example request body

{
  "calories": "110",
  "protein": "11g",
  "carbs_g": 15,
  "fat": 0,
  "sodium": "0.12",
  "sodium_unit": "g",
  "serving": "5.3 oz"
}

Supported inputs (examples)

  • calories / kcal / energy_kcal
  • energy_kj (converted to kcal)
  • protein_g / protein
  • carbs_g / carbohydrates_g / carbs
  • fat_g / fat
  • fiber_g / fiber
  • sugar_g / sugar
  • sodium_mg / sodium + optional sodium_unit (mg or g)
  • serving as:
    • string like "5.3 oz" or "100 g"
    • object like { "amount": 5.3, "unit": "oz" }

Try it

Paste your API key, edit the JSON payload, click Run, and you’ll see the canonical output.

Try it
POST /v1/normalize
Tip: Get a key in Authentication.
Calling:
https://api.nutritionsignals.com/v1/normalize
Tip: Press /Ctrl + Enter to run.
Notes
  • No OpenAI calls — this endpoint is fast and deterministic.
  • Accepts many aliases like calories/kcal or nested nutrition.
  • Sodium is normalized to mg (supports sodium_unit: "g").
Response
{}

Examples

curl https://api.nutritionsignals.com/v1/normalize \
  -H "Authorization: Bearer $NUTRITIONSIGNALS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"calories":"110","protein":"11g","carbs_g":15,"fat":0,"sodium":"0.12","sodium_unit":"g","serving":"5.3 oz"}'

Response

Canonical response:

Canonical response

{
  "serving": { "amount": 5.3, "unit": "oz" },
  "calories_kcal_total": 110,
  "protein_g": 11,
  "carbs_g": 15,
  "fat_g": 0,
  "fiber_g": 0,
  "sugar_g": 0,
  "sodium_mg": 120,
  "warnings": []
}

Errors

  • 401 — Missing/invalid API key
  • 422 — Invalid request body
  • 429 — Rate limited
  • 5xx — Server error

Was this page helpful?