Keto Calculator API¶
Generate keto macros for cut, maintain, or gain scenarios with current-weight and target-weight calorie context.
Endpoint¶
GET /api/v1/keto-calculatorPOST /api/v1/keto-calculator/post
Parameters¶
| Name | Type | Required | In | Description |
|---|---|---|---|---|
sex | string | Yes | Query/Body | male or female. |
weight | number | Yes | Query/Body | Weight in kg (metric) or lb (imperial). |
height | number | Yes | Query/Body | Height in cm (metric) or inches (imperial). |
age | integer | Yes | Query/Body | Age in years. |
activity_level | string | No | Query/Body | sedentary,lightly_active,moderately_active,very_active,extra_active,athlete. |
target_weight | number | No | Query/Body | Target body weight; defaults to current weight. |
diet | string | No | Query/Body | normal or strict. |
unit | string | No | Query/Body | metric (default) or imperial. |
lang | string | No | Query | Response language (en,es,de,fr,pt,ja,hi,ar). |
Why Use This Endpoint¶
- Automate keto macros with activity-adjusted calorie logic.
- Compare current-weight maintenance vs target-weight recommendation.
- Plug directly into meal planning and tracking products.
Request Example¶
curl -X GET "https://api.hefitapi.com/api/v1/keto-calculator?sex=female&weight=68&height=167&age=31&activity_level=moderately_active&target_weight=63&diet=strict&unit=metric&lang=en" \
-H "X-API-Key: YOUR_API_KEY"
curl -X POST "https://api.hefitapi.com/api/v1/keto-calculator/post?lang=en" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{"sex":"male","weight":186,"height":71,"age":36,"activity_level":"very_active","target_weight":180,"diet":"normal","unit":"imperial"}'
Response Example¶
Info
The response example below is for demonstration purposes only. Make a live request to this endpoint to receive the full, real-time, and potentially richer JSON structure.
{
"recommended_calories": {
"target_weight": "1760 kcal/day",
"current_weight": "2200 kcal/day"
},
"fats": {
"percentage": "70 %",
"kcal_per_day": "1232 kcal/day",
"grams_per_day": "136.9 g/day",
"grams_per_day_tdee": "171.1 g/day"
},
"carbohydrates": {
"percentage": "5 %",
"kcal_per_day": "88 kcal/day",
"grams_per_day": "22.0 g/day",
"grams_per_day_tdee": "27.5 g/day"
},
"proteins": {
"percentage": "25 %",
"kcal_per_day": "440 kcal/day",
"grams_per_day": "110.0 g/day",
"grams_per_day_tdee": "137.5 g/day"
},
"goal_mode": "cut",
"goal_mode_label": "Fat Loss",
"diet_profile": "Strict keto profile.",
"activity_context": "Moderate activity workload.",
"action_plan": ["Keep carbs tightly controlled around schedule"],
"monitoring_plan": "Audit adherence and trend weekly.",
"_enterprise": {
"client": "Acme Health",
"plan": "pro",
"request_id": "8fe037e14926af3b",
"quota": 120,
"usage_tracking": true
},
"_api_metadata_": {
"endpoint_name": "keto_calculator",
"response_language": "en"
}
}
Product Positioning¶
Production-ready for keto coaches, meal planning SaaS platforms, and enterprise nutrition workflows.
Note
Invalid activity_level, diet, or unit values return HTTP 400.
Recommended Endpoints¶
GET /api/v1/6mwt-calculator- 6Mwt Calculator APIGET /api/v1/abi-calculator- Abi Calculator APIGET /api/v1/ava-calculator- Ava Calculator APIGET /api/v1/bri-calculator- Bri Calculator APIGET /api/v1/bsa-calculator- Bsa Calculator APIGET /api/v1/carbs-calculator- Carbs Calculator API