Interested in joining a scientific study?Learn more

Core API

Decode API

Available

Decode turns everyday food input into structured food items, quantities, reusable Decode Food IDs and molecular nutrition output. It is the base layer for products that need to understand what a person ate beyond calories and macros.

POST/functions/v1/decode

Inputs

  • Natural language meal descriptions, food images or voice input
  • Structured food items with names and quantities
  • Existing decode_food_id values for repeat analysis

Returns

  • Recognized foods and estimated quantities
  • Reusable decode_food_id references
  • Molecular analysis with compounds, values, units and references

Request JSON

{
  "input_mode": "unstructured",
  "foodText": "Greek yogurt with blueberries, walnuts and honey"
}

Response JSON

{
  "job_id": "8a93f4...",
  "status": "queued",
  "status_url": "https://tirqjzahcinadeulfylj.supabase.co/functions/v1/decode?job_id=8a93f4..."
}
curl -X POST 'https://tirqjzahcinadeulfylj.supabase.co/functions/v1/decode' \
  -H 'x-api-key: $MYMOLECULES_API_KEY' \
  -H 'Content-Type: application/json' \
  --data '{  "input_mode": "unstructured",  "foodText": "Greek yogurt with blueberries, walnuts and honey"}'