MyPlate Energy & macros API

BMR, TDEE, calorie deficits, macronutrient splits, protein and ideal weight.

GitHub OpenAPI

Operations 7

GET /calculate/calorie-needs BMR, TDEE, deficit tiers, macros, protein & ideal-weight (everything-energy) #
GET /calculate/bmr Basal metabolic rate (Mifflin-St Jeor + Harris-Benedict) #
GET /calculate/tdee Total daily energy expenditure #
GET /calculate/calorie-deficit Calorie-deficit tiers for weight loss #
GET /calculate/macros Macronutrient split (protein / carbs / fat) #
GET /calculate/protein Daily protein target #
GET /calculate/ideal-weight Ideal / healthy body-weight range #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/myplate-food:myplate-food-energy-macros-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

myplate-food-energy-macros-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: MyPlate.food nutrition Energy & macros API
  version: 1.0.0
  summary: Free, no-key JSON API for USDA nutrition calculators and the MyPlate Kitchen recipe collection.
  description: 'Free, open, GET-only JSON API for USDA-based nutrition calculators (BMI, BMR/TDEE, macros, protein, body fat, ideal weight, the MyPlate food-group plan, the full DRI table, and more) and the public-domain USDA MyPlate Kitchen recipe collection.


    No API key. Open CORS. Every calculator response carries a citation envelope — `source` (the published formula + reference) and `canonical_url` (the matching myplate.food page), with a `disclaimer` on health math — so consumers and AI agents can cite the number.


    Rate limited to 20 requests/minute per IP on the free tier; over that returns HTTP 429 with a Retry-After header. Independent; not affiliated with the USDA.


    The free tier is for live, per-request use inside your app or agent. It is not a bulk-download channel: systematically retrieving or mirroring the recipe collection into your own database or storage is outside the free tier and requires a license agreement (https://myplate.food/for-professionals). Full recipe fetches are additionally capped at 100/day per IP (one budget shared with the MCP get_recipe tool). Full terms: https://myplate.food/terms.'
  termsOfService: https://myplate.food/terms
  contact:
    name: MyPlate.food
    email: hello@myplate.food
    url: https://myplate.food/api
  license:
    name: Free for live per-request use, no API key — rate-limited; bulk export / data feeds require a license
    url: https://myplate.food/for-professionals
servers:
- url: https://myplate.food/api/v1
  description: Production v1 API
tags:
- name: Energy & macros
  description: BMR, TDEE, calorie deficits, macronutrient splits, protein and ideal weight.
paths:
  /calculate/calorie-needs:
    get:
      operationId: calculate_calorie_needs
      summary: BMR, TDEE, deficit tiers, macros, protein & ideal-weight (everything-energy)
      description: 'One call for the full energy picture: resting metabolic rate (Mifflin-St Jeor), revised Harris-Benedict, TDEE at every activity level, up to three weight-loss deficit tiers, macronutrient splits, protein targets and healthy-weight ranges. Adult equations: ages 18 to 120. A younger age returns 400; for a child or teenager use myplate-plan or dri, whose energy equations have child forms. weight_loss_targets lists only the paces myplate.food itself offers: a pace whose target is under 1,200 kcal a day for women or 1,500 for men (the low end of the calorie prescriptions in the 2013 AHA/ACC/TOS obesity guideline) is left out and named, without a figure, in weight_loss_not_offered. weight_loss_default is the pace the calculator page opens on and weight_loss_floor_kcal is the floor that was applied. In pregnancy and while breastfeeding no targets are returned, and weight_loss_withheld gives the reason (pregnancy or lactation). Above the healthy-BMI band, ideal_weight also carries firstGoal (the weights 5 to 10% under the current weight, the first goal in the 2013 AHA/ACC/TOS obesity guideline) and adjusted (the Hamwi ideal weight plus 25% of the weight above it). Both are null at or under the band, and in pregnancy and while breastfeeding.


        Cites its source in every response: `source` (the formula + published reference) and `canonical_url` (https://myplate.food/tdee-calculator), plus a `disclaimer`.'
      tags:
      - Energy & macros
      parameters:
      - name: age
        in: query
        required: true
        description: Age in years (18 to 120). These are adult equations.
        schema:
          type: integer
          minimum: 18
          maximum: 120
        example: 30
      - name: sex
        in: query
        required: true
        description: Biological sex, used in the equation.
        schema:
          type: string
          enum:
          - male
          - female
        example: male
      - name: activity
        in: query
        required: false
        description: Physical activity level. Defaults to sedentary.
        schema:
          type: string
          enum:
          - sedentary
          - moderately-active
          - active
          - very-active
        example: active
      - name: height_cm
        in: query
        required: false
        description: Height in centimeters (metric). Provide height_cm OR height_ft (+ optional height_in).
        schema:
          type: number
        example: 180
      - name: height_ft
        in: query
        required: false
        description: Height, feet component (imperial).
        schema:
          type: number
        example: 5
      - name: height_in
        in: query
        required: false
        description: Height, inches component (imperial).
        schema:
          type: number
        example: 10
      - name: weight_kg
        in: query
        required: false
        description: Weight in kilograms (metric). Provide weight_kg OR weight_lb.
        schema:
          type: number
        example: 80
      - name: weight_lb
        in: query
        required: false
        description: Weight in pounds (imperial).
        schema:
          type: number
        example: 176
      - name: pregnancy
        in: query
        required: false
        description: Pregnancy status. Weight-loss figures are withheld during pregnancy, and the protein RDA follows it.
        schema:
          type: string
          enum:
          - not-pregnant
          - 1st-trimester
          - 2nd-trimester
          - 3rd-trimester
      - name: lactation
        in: query
        required: false
        description: Breastfeeding status. Weight-loss figures are withheld while breastfeeding, and the protein RDA follows it.
        schema:
          type: string
          enum:
          - not-lactating
          - 0-6-months
          - 7-12-months
      x-example-request: https://myplate.food/api/v1/calculate/calorie-needs?age=30&sex=male&activity=active&height_cm=180&weight_kg=80
      responses:
        '200':
          description: Calculation result with citation envelope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CitedResult'
              example:
                calculator: calorie-needs
                inputs: {}
                source: Mifflin-St Jeor resting metabolic rate × the conventional activity multipliers (1.2 sedentary to 1.9 very active) for TDEE + IOM AMDR macronutrient ranges, computed by myplate.food
                canonical_url: https://myplate.food/tdee-calculator
        '400':
          description: Invalid or missing parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /calculate/bmr:
    get:
      operationId: calculate_bmr
      summary: Basal metabolic rate (Mifflin-St Jeor + Harris-Benedict)
      description: 'Resting/basal metabolic rate: the calories your body burns at rest. Returns the headline Mifflin-St Jeor (1990) value plus the revised Harris-Benedict (Roza & Shizgal 1984) estimate for comparison. Adult equations: ages 18 to 120. A younger age returns 400; for a child or teenager use myplate-plan or dri, whose energy equations have child forms.


        Cites its source in every response: `source` (the formula + published reference) and `canonical_url` (https://myplate.food/bmr-calculator), plus a `disclaimer`.'
      tags:
      - Energy & macros
      parameters:
      - name: age
        in: query
        required: true
        description: Age in years (18 to 120). These are adult equations.
        schema:
          type: integer
          minimum: 18
          maximum: 120
        example: 30
      - name: sex
        in: query
        required: true
        description: Biological sex, used in the equation.
        schema:
          type: string
          enum:
          - male
          - female
        example: male
      - name: height_cm
        in: query
        required: false
        description: Height in centimeters (metric). Provide height_cm OR height_ft (+ optional height_in).
        schema:
          type: number
        example: 180
      - name: height_ft
        in: query
        required: false
        description: Height, feet component (imperial).
        schema:
          type: number
        example: 5
      - name: height_in
        in: query
        required: false
        description: Height, inches component (imperial).
        schema:
          type: number
        example: 10
      - name: weight_kg
        in: query
        required: false
        description: Weight in kilograms (metric). Provide weight_kg OR weight_lb.
        schema:
          type: number
        example: 80
      - name: weight_lb
        in: query
        required: false
        description: Weight in pounds (imperial).
        schema:
          type: number
        example: 176
      x-example-request: https://myplate.food/api/v1/calculate/bmr?age=35&sex=male&height_ft=5&height_in=10&weight_lb=170
      responses:
        '200':
          description: Calculation result with citation envelope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CitedResult'
              example:
                calculator: bmr
                inputs: {}
                source: 'Basal metabolic rate: Mifflin-St Jeor (1990) headline with the revised Harris-Benedict (Roza & Shizgal 1984) for comparison, computed by myplate.food'
                canonical_url: https://myplate.food/bmr-calculator
        '400':
          description: Invalid or missing parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /calculate/tdee:
    get:
      operationId: calculate_tdee
      summary: Total daily energy expenditure
      description: 'Total daily energy expenditure (maintenance calories): Mifflin-St Jeor resting metabolic rate scaled by a physical-activity multiplier. Returns TDEE at the selected activity level plus a table across all four levels. Adult equations: ages 18 to 120. A younger age returns 400; for a child or teenager use myplate-plan or dri, whose energy equations have child forms.


        Cites its source in every response: `source` (the formula + published reference) and `canonical_url` (https://myplate.food/tdee-calculator), plus a `disclaimer`.'
      tags:
      - Energy & macros
      parameters:
      - name: age
        in: query
        required: true
        description: Age in years (18 to 120). These are adult equations.
        schema:
          type: integer
          minimum: 18
          maximum: 120
        example: 30
      - name: sex
        in: query
        required: true
        description: Biological sex, used in the equation.
        schema:
          type: string
          enum:
          - male
          - female
        example: male
      - name: activity
        in: query
        required: false
        description: Physical activity level. Defaults to sedentary.
        schema:
          type: string
          enum:
          - sedentary
          - moderately-active
          - active
          - very-active
        example: active
      - name: height_cm
        in: query
        required: false
        description: Height in centimeters (metric). Provide height_cm OR height_ft (+ optional height_in).
        schema:
          type: number
        example: 180
      - name: height_ft
        in: query
        required: false
        description: Height, feet component (imperial).
        schema:
          type: number
        example: 5
      - name: height_in
        in: query
        required: false
        description: Height, inches component (imperial).
        schema:
          type: number
        example: 10
      - name: weight_kg
        in: query
        required: false
        description: Weight in kilograms (metric). Provide weight_kg OR weight_lb.
        schema:
          type: number
        example: 80
      - name: weight_lb
        in: query
        required: false
        description: Weight in pounds (imperial).
        schema:
          type: number
        example: 176
      x-example-request: https://myplate.food/api/v1/calculate/tdee?age=30&sex=male&activity=active&height_cm=180&weight_kg=80
      responses:
        '200':
          description: Calculation result with citation envelope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CitedResult'
              example:
                calculator: tdee
                inputs: {}
                source: 'Total daily energy expenditure: Mifflin-St Jeor (1990) resting metabolic rate × the conventional activity multipliers (1.2 sedentary to 1.9 very active), computed by myplate.food'
                canonical_url: https://myplate.food/tdee-calculator
        '400':
          description: Invalid or missing parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /calculate/calorie-deficit:
    get:
      operationId: calculate_calorie_deficit
      summary: Calorie-deficit tiers for weight loss
      description: 'Maintenance calories (TDEE) and up to three deficit tiers: mild (−250), standard (−500) and aggressive (−750 kcal/day), with the realistic weekly rate each buys and a flag when a target dips below BMR. Adult equations: ages 18 to 120. A younger age returns 400; for a child or teenager use myplate-plan or dri, whose energy equations have child forms. weight_loss_targets lists only the paces myplate.food itself offers: a pace whose target is under 1,200 kcal a day for women or 1,500 for men (the low end of the calorie prescriptions in the 2013 AHA/ACC/TOS obesity guideline) is left out and named, without a figure, in weight_loss_not_offered. weight_loss_default is the pace the calculator page opens on and weight_loss_floor_kcal is the floor that was applied. In pregnancy and while breastfeeding no targets are returned, and weight_loss_withheld gives the reason (pregnancy or lactation).


        Cites its source in every response: `source` (the formula + published reference) and `canonical_url` (https://myplate.food/calorie-deficit-calculator), plus a `disclaimer`.'
      tags:
      - Energy & macros
      parameters:
      - name: age
        in: query
        required: true
        description: Age in years (18 to 120). These are adult equations.
        schema:
          type: integer
          minimum: 18
          maximum: 120
        example: 30
      - name: sex
        in: query
        required: true
        description: Biological sex, used in the equation.
        schema:
          type: string
          enum:
          - male
          - female
        example: male
      - name: activity
        in: query
        required: false
        description: Physical activity level. Defaults to sedentary.
        schema:
          type: string
          enum:
          - sedentary
          - moderately-active
          - active
          - very-active
        example: active
      - name: height_cm
        in: query
        required: false
        description: Height in centimeters (metric). Provide height_cm OR height_ft (+ optional height_in).
        schema:
          type: number
        example: 180
      - name: height_ft
        in: query
        required: false
        description: Height, feet component (imperial).
        schema:
          type: number
        example: 5
      - name: height_in
        in: query
        required: false
        description: Height, inches component (imperial).
        schema:
          type: number
        example: 10
      - name: weight_kg
        in: query
        required: false
        description: Weight in kilograms (metric). Provide weight_kg OR weight_lb.
        schema:
          type: number
        example: 80
      - name: weight_lb
        in: query
        required: false
        description: Weight in pounds (imperial).
        schema:
          type: number
        example: 176
      - name: pregnancy
        in: query
        required: false
        description: Pregnancy status. Weight-loss figures are withheld during pregnancy.
        schema:
          type: string
          enum:
          - not-pregnant
          - 1st-trimester
          - 2nd-trimester
          - 3rd-trimester
      - name: lactation
        in: query
        required: false
        description: Breastfeeding status. Weight-loss figures are withheld while breastfeeding.
        schema:
          type: string
          enum:
          - not-lactating
          - 0-6-months
          - 7-12-months
      x-example-request: https://myplate.food/api/v1/calculate/calorie-deficit?age=30&sex=female&activity=moderately-active&height_cm=165&weight_kg=70
      responses:
        '200':
          description: Calculation result with citation envelope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CitedResult'
              example:
                calculator: calorie-deficit
                inputs: {}
                source: Maintenance calories (Mifflin-St Jeor × activity) minus a deficit, using the conventional ~7,700 kcal/kg body-fat approximation, computed by myplate.food
                canonical_url: https://myplate.food/calorie-deficit-calculator
        '400':
          description: Invalid or missing parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /calculate/macros:
    get:
      operationId: calculate_macros
      summary: Macronutrient split (protein / carbs / fat)
      description: 'Split a calorie budget into protein, carbohydrate and fat grams across three common presets (balanced, higher-protein, lower-carb). Pass a calorie total directly, or a full profile to derive TDEE first. With a profile: Adult equations: ages 18 to 120. A younger age returns 400; for a child or teenager use myplate-plan or dri, whose energy equations have child forms.


        Cites its source in every response: `source` (the formula + published reference) and `canonical_url` (https://myplate.food/macro-calculator), plus a `disclaimer`.'
      tags:
      - Energy & macros
      parameters:
      - name: calories
        in: query
        required: false
        description: Daily calorie budget to split. Omit to derive TDEE from a profile.
        schema:
          type: number
          minimum: 500
          maximum: 8000
        example: 2000
      - name: age
        in: query
        required: false
        description: Age in years (18 to 120). These are adult equations.
        schema:
          type: integer
          minimum: 18
          maximum: 120
        example: 30
      - name: sex
        in: query
        required: false
        description: Biological sex, used in the equation.
        schema:
          type: string
          enum:
          - male
          - female
        example: male
      - name: activity
        in: query
        required: false
        description: Physical activity level. Defaults to sedentary.
        schema:
          type: string
          enum:
          - sedentary
          - moderately-active
          - active
          - very-active
        example: active
      - name: height_cm
        in: query
        required: false
        description: Height in centimeters (metric). Provide height_cm OR height_ft (+ optional height_in).
        schema:
          type: number
        example: 180
      - name: height_ft
        in: query
        required: false
        description: Height, feet component (imperial).
        schema:
          type: number
        example: 5
      - name: height_in
        in: query
        required: false
        description: Height, inches component (imperial).
        schema:
          type: number
        example: 10
      - name: weight_kg
        in: query
        required: false
        description: Weight in kilograms (metric). Provide weight_kg OR weight_lb.
        schema:
          type: number
        example: 80
      - name: weight_lb
        in: query
        required: false
        description: Weight in pounds (imperial).
        schema:
          type: number
        example: 176
      x-example-request: https://myplate.food/api/v1/calculate/macros?calories=2000
      responses:
        '200':
          description: Calculation result with citation envelope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CitedResult'
              example:
                calculator: macros
                inputs: {}
                source: 'Macronutrient split at 4/4/9 kcal per gram, each preset flagged (withinAmdr) against the IOM acceptable macronutrient distribution ranges (protein 10 to 35%, carbohydrate 45 to 65%, fat 20 to 35%): balanced sits inside all three; higher-protein and lower-carb are below the carbohydrate range; computed by myplate.food'
                canonical_url: https://myplate.food/macro-calculator
        '400':
          description: Invalid or missing parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /calculate/protein:
    get:
      operationId: calculate_protein
      summary: Daily protein target
      description: 'Daily protein target from body weight and activity: the IOM RDA for the life stage (0.8 g/kg for adults; 0.85 at 14 to 18, 1.1 in the second half of pregnancy, 1.3 while breastfeeding) and a g/kg range scaled to activity level (up to the 1.2 to 2.0 g/kg athlete range, and never under the RDA), in grams per day. Under 18 the answer is the RDA alone: range is null, byActivity is empty and activity_range_withheld is "under_18", because the activity ranges are adult sports-nutrition guidance.


        Cites its source in every response: `source` (the formula + published reference) and `canonical_url` (https://myplate.food/protein-calculator), plus a `disclaimer`.'
      tags:
      - Energy & macros
      parameters:
      - name: age
        in: query
        required: true
        description: Age in years.
        schema:
          type: integer
          minimum: 1
          maximum: 120
        example: 30
      - name: sex
        in: query
        required: true
        description: Biological sex, used in the equation.
        schema:
          type: string
          enum:
          - male
          - female
        example: male
      - name: activity
        in: query
        required: false
        description: Physical activity level. Defaults to sedentary.
        schema:
          type: string
          enum:
          - sedentary
          - moderately-active
          - active
          - very-active
        example: active
      - name: height_cm
        in: query
        required: false
        description: Height in centimeters (metric). Provide height_cm OR height_ft (+ optional height_in).
        schema:
          type: number
        example: 180
      - name: height_ft
        in: query
        required: false
        description: Height, feet component (imperial).
        schema:
          type: number
        example: 5
      - name: height_in
        in: query
        required: false
        description: Height, inches component (imperial).
        schema:
          type: number
        example: 10
      - name: weight_kg
        in: query
        required: false
        description: Weight in kilograms (metric). Provide weight_kg OR weight_lb.
        schema:
          type: number
        example: 80
      - name: weight_lb
        in: query
        required: false
        description: Weight in pounds (imperial).
        schema:
          type: number
        example: 176
      - name: pregnancy
        in: query
        required: false
        description: Pregnancy status. The protein RDA follows it.
        schema:
          type: string
          enum:
          - not-pregnant
          - 1st-trimester
          - 2nd-trimester
          - 3rd-trimester
      - name: lactation
        in: query
        required: false
        description: Breastfeeding status. The protein RDA follows it.
        schema:
          type: string
          enum:
          - not-lactating
          - 0-6-months
          - 7-12-months
      x-example-request: https://myplate.food/api/v1/calculate/protein?age=35&sex=male&activity=moderately-active&height_cm=178&weight_kg=77
      responses:
        '200':
          description: Calculation result with citation envelope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CitedResult'
              example:
                calculator: protein
                inputs: {}
                source: 'Protein targets: the IOM protein RDA per kg for the life stage (0.8 g/kg for adults) with the Academy of Nutrition and Dietetics / Dietitians of Canada / ACSM (2016) 1.2 to 2.0 g/kg activity ranges, computed by myplate.food'
                canonical_url: https://myplate.food/protein-calculator
        '400':
          description: Invalid or missing parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /calculate/ideal-weight:
    get:
      operationId: calculate_ideal_weight
      summary: Ideal / healthy body-weight range
      description: 'Estimated ideal body weight from height and sex via four classic clinical formulas (Devine, Robinson, Miller, Hamwi), plus the healthy-BMI (18.5–24.9) weight band and your current BMI for context. Adult equations: ages 18 to 120. A younger age returns 400; for a child or teenager use myplate-plan or dri, whose energy equations have child forms. Above the healthy-BMI band, ideal_weight also carries firstGoal (the weights 5 to 10% under the current weight, the first goal in the 2013 AHA/ACC/TOS obesity guideline) and adjusted (the Hamwi ideal weight plus 25% of the weight above it). Both are null at or under the band, and in pregnancy and while breastfeeding. weight_loss_withheld gives the reason when they are withheld (pregnancy or lactation).


        Cites its source in every response: `source` (the formula + published reference) and `canonical_url` (https://myplate.food/ideal-weight-calculator), plus a `disclaimer`.'
      tags:
      - Energy & macros
      parameters:
      - name: age
        in: query
        required: true
        description: Age in years (18 to 120). These are adult equations.
        schema:
          type: integer
          minimum: 18
          maximum: 120
        example: 30
      - name: sex
        in: query
        required: true
        description: Biological sex, used in the equation.
        schema:
          type: string
          enum:
          - male
          - female
        example: male
      - name: height_cm
        in: query
        required: false
        description: Height in centimeters (metric). Provide height_cm OR height_ft (+ optional height_in).
        schema:
          type: number
        example: 180
      - name: height_ft
        in: query
        required: false
        description: Height, feet component (imperial).
        schema:
          type: number
        example: 5
      - name: height_in
        in: query
        required: false
        description: Height, inches component (imperial).
        schema:
          type: number
        example: 10
      - name: weight_kg
        in: query
        required: false
        description: Weight in kilograms (metric). Provide weight_kg OR weight_lb.
        schema:
          type: number
        example: 80
      - name: weight_lb
        in: query
        required: false
        description: Weight in pounds (imperial).
        schema:
          type: number
        example: 176
      - name: pregnancy
        in: query
        required: false
        description: Pregnancy status. Weight-loss figures are withheld during pregnancy.
        schema:
          type: string
          enum:
          - not-pregnant
          - 1st-trimester
          - 2nd-trimester
          - 3rd-trimester
      - name: lactation
        in: query
        required: false
        description: Breastfeeding status. Weight-loss figures are withheld while breastfeeding.
        schema:
          type: string
          enum:
          - not-lactating
          - 0-6-months
          - 7-12-months
      x-example-request: https://myplate.food/api/v1/calculate/ideal-weight?age=35&sex=male&height_ft=5&height_in=10&weight_lb=170
      responses:
        '200':
          description: Calculation result with citation envelope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CitedResult'
              example:
                calculator: ideal-weight
                inputs: {}
                source: 'Ideal body-weight estimates: Devine (1974), Robinson (1983), Miller (1983) and Hamwi (1964) formulas plus the healthy-BMI (18.5–24.9) weight band, computed by myplate.food'
                canonical_url: https://myplate.food/ideal-weight-calculator
        '400':
          description: Invalid or missing parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
          description: Human-readable error message.
        details:
          description: Optional structured detail.
      required:
      - error
    CitedResult:
      type: object
      description: Calculation result. Shape varies by endpoint, but every result carries the citation envelope fields below alongside the calculator's own numbers.
      properties:
        calculator:
          type: string
          description: The endpoint name.
        inputs:
          type: object
          description: The parsed, normalized inputs the result was computed from.
        source:
          type: string
          description: The formula and published reference behind the number.
        canonical_url:
          type: string
          format: uri
          description: The matching myplate.food page.
        disclaimer:
          type: string
          description: Present on health calculators.
      required:
      - calculator
      - source
      - canonical_url
      additionalProperties: true
x-rate-limit:
  free_tier_per_minute: 20
  on_exceeded: HTTP 429 with a Retry-After header
  contact_email: hello@myplate.food
  contact_url: https://myplate.food/for-professionals