Utility API

Decode Foods API

Available

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_...

Contract

Send mymolecules-api-version with 2026-07-10 to use the documented response contract.

{
  "data": {},
  "meta": {
    "request_id": "req_...",
    "api_version": "2026-07-10"
  }
}

Headers

Request

  • x-api-key required - Server-side API key for your integration.
  • mymolecules-api-version required 2026-07-10 - Use the latest stable API version: 2026-07-10.

Response

  • x-request-id required - Request identifier. Log this value when contacting support.
  • mymolecules-api-version required 2026-07-10 - The API contract version used for the response.
  • x-ratelimit-limit optional - Quota limit for the current key and window when quota data is available.
  • x-ratelimit-remaining optional - Remaining requests in the current quota window when quota data is available.
  • x-ratelimit-reset optional - ISO timestamp for the current quota window reset when quota data is available.
  • retry-after optional - Seconds to wait before retrying when the request is rate-limited or temporarily unavailable.

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

Error codes

  • missing_api_key
  • invalid_api_key
  • scope_not_allowed
  • quota_exceeded
  • invalid_json
  • invalid_request
  • validation_error
  • method_not_allowed
  • unsupported_api_version
  • job_not_found
  • backlog_high
  • upstream_timeout
  • upstream_error
  • internal_error

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 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 rate-limit headers are returned when quota data is 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

{
  "data": {
    "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"] }
    ]
  },
  "meta": {
    "request_id": "req_...",
    "api_version": "2026-07-10"
  }
}

Code examples

curl 'https://api.mymolecules.de/functions/v1/get_decode_foods?decode_food_id=decode_food_...' \
  -H 'x-api-key: $MYMOLECULES_API_KEY' \
  -H 'mymolecules-api-version: 2026-07-10'