Interesse an einer wissenschaftlichen Studie?Mehr erfahren

Utility API

Get Decode Foods API

Available

Get Decode Foods resolves an existing decode_food_id into the food_ids and food item names it represents.

Endpoint

GET/functions/v1/get_decode_foods?decode_food_id=decode_food_...

Inputs

  • decode_food_id query parameter

Returns

  • The original decode_food_id
  • food_ids extracted from the identifier
  • Resolved food_names grouped by food_id

Request details

  • Send decode_food_id as a query parameter.
  • decodeFoodId is accepted as a compatibility alias, but decode_food_id is preferred.
  • The identifier must be a valid Decode Food ID returned by Decode or Get Decode Food ID.

Response details

  • This is a synchronous GET endpoint.
  • items preserves the food_id order from the Decode Food ID.
  • A food_id can return an empty food_names array when no public name is available.

Operational notes

  • Requires x-api-key with the edge:get_decode_foods scope.
  • Usage is counted and quota headers are returned when available.
  • Use this endpoint for lookup and joins, not for molecular analysis.

Examples

Request

GET /functions/v1/get_decode_foods?decode_food_id=decode_food_...

Response JSON

{
  "decode_food_id": "decode_food_...",
  "food_ids": ["food_123", "food_456"],
  "items": [
    { "food_id": "food_123", "food_names": ["Greek yogurt"] },
    { "food_id": "food_456", "food_names": ["Blueberries"] }
  ]
}

Code examples

curl 'https://tirqjzahcinadeulfylj.supabase.co/functions/v1/get_decode_foods?decode_food_id=decode_food_...' \
  -H 'x-api-key: $MYMOLECULES_API_KEY'