Utility API

Energy Expenditure API

Available

Daily Energy Expenditure calculates basal metabolic rate and total daily energy expenditure from body profile and activity level.

Endpoint

POST/functions/v1/daily_energy_expenditure_calculation

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.
  • Content-Type required application/json - Required for JSON request bodies.

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

  • gender: male or female
  • height in cm, weight in kg and age in years
  • activity: sedentary, office, light_sedentary, walking_standing or physically_demanding

Returns

  • status ok and formula label
  • Echoed normalized inputs including pal_factor
  • BMR in kcal and TDEE in kcal with minus10% and plus10% range

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

  • All numeric fields must be positive numbers.
  • activity maps to a PAL factor used for total daily energy expenditure.
  • Use the direct public fields gender, height, weight, age and activity.

Response details

  • This is a synchronous POST endpoint.
  • Calculations use the classic Harris-Benedict formula.
  • Invalid input returns a 400 response with a concise error string.

Operational notes

  • Requires x-api-key with the edge:daily_energy_expenditure_calculation scope.
  • Usage is counted and rate-limit headers are returned when quota data is available.
  • This utility provides an energy baseline, not a medical or diagnostic recommendation.

Examples

Request JSON

{
  "gender": "female",
  "height": 168,
  "weight": 62,
  "age": 34,
  "activity": "office"
}

Response JSON

{
  "data": {
    "status": "ok",
    "formula": "Harris-Benedict",
    "inputs": {
      "gender": "female",
      "height_cm": 168,
      "weight_kg": 62,
      "age_years": 34,
      "activity": "office",
      "pal_factor": 1.4
    },
    "results": {
      "basal_metabolic_rate_kcal": 1403,
      "total_daily_energy_expenditure_kcal": 1964,
      "total_daily_energy_expenditure_range_kcal": {
        "minus10%": 1768,
        "plus10%": 2160
      }
    }
  },
  "meta": {
    "request_id": "req_...",
    "api_version": "2026-07-10"
  }
}

Code examples

curl -X POST 'https://api.mymolecules.de/functions/v1/daily_energy_expenditure_calculation' \
  -H 'x-api-key: $MYMOLECULES_API_KEY' \
  -H 'mymolecules-api-version: 2026-07-10' \
  -H 'Content-Type: application/json' \
  --data '{  "gender": "female",  "height": 168,  "weight": 62,  "age": 34,  "activity": "office"      }'