FitChef Meal Plan API
Power your product with personalized nutrition. Generate dynamic meal plans, calculate macros, and deliver recipes — all through a single, proven API that has generated over 2.4 million meal plans.
White-Label Ready
Embed FitChef's meal-planning engine under your brand. Every plan and recipe appears as your own.
Macro Precision
Calculate personalized macros based on goals, activity level, and body metrics with scientific accuracy.
Async Generation
Mealplans generate asynchronously with webhook callbacks. Built for scale and reliability.
Enterprise Security
OAuth2 authentication, encrypted endpoints, and GDPR-compliant data handling.
Authentication
All API endpoints require OAuth2 authentication. Obtain an access token by making a POST request to the token endpoint:
POST /oauth/token Content-Type: application/x-www-form-urlencoded grant_type=client_credentials &client_id=YOUR_CLIENT_ID &client_secret=YOUR_CLIENT_SECRET &scope=dynamic
Include the access token in subsequent requests using the Authorization header:
Authorization: Bearer YOUR_ACCESS_TOKEN
Typical Integration Flow
The API endpoints follow a typical registration and configuration flow. Here's how most integrations work:
API Endpoints
Retrieve all macro factors including goals, activity levels, and sports. Use these values when collecting user preferences and calculating macros.
Response
{
"goals": [
{ "slug": "lose_weight", "label": "Lose weight" },
{ "slug": "maintain_weight", "label": "Maintain weight" },
{ "slug": "gain_weight", "label": "Gain weight" }
],
"activity_levels": [
{ "slug": "none", "label": "Low to none" },
{ "slug": "mild", "label": "Light exercise" },
{ "slug": "moderate", "label": "Moderate exercise" },
{ "slug": "active", "label": "Very active" },
{ "slug": "very_active", "label": "Extremely active" }
],
"sports": [
{ "slug": "low_intensity", "label": "Low-Intensity Sports" },
{ "slug": "high_intensity", "label": "High-Intensity Sports" },
{ "slug": "strength_sports", "label": "Strength Sports" }
]
}
Response Fields
| Field | Description |
|---|---|
| goalsarray | Available goal options with slug and label |
| activity_levelsarray | Activity level options with slug and label |
| sportsarray | Sport type options with slug and label |
Calculate macro values for all available macro-affecting diets based on user parameters. These diets affect macro calculations by modifying protein per kg, fat per kg, and kcal correction values.
Request Body
{
"gender": "male",
"activity_level": "moderate",
"goal": "lose_weight",
"sports": ["strength_sports"],
"weight": 80,
"height": 180,
"age": 30
}
Request Fields
| Field | Description |
|---|---|
| genderstringrequired | "male" or "female" |
| activity_levelstringrequired | Slug from activity levels (e.g., "moderate") |
| goalstringrequired | Slug from goals (e.g., "lose_weight") |
| sportsarrayrequired | Array of 0-3 sport slugs |
| weightintegerrequired | Weight in kilograms |
| heightintegerrequired | Height in centimeters |
| ageintegerrequired | Age in years |
For best results, ensure values fall within these ranges:
- Weight: 65-100 kg (143-220 lbs)
- Height: 150-200 cm (59-79 inches)
- Age: 18-80 years
Response
[
{
"diet": {
"slug": "default",
"label": "Recommended"
},
"macros": {
"carbohydrate": 200,
"fat": 70,
"protein": 140,
"kcal": 2000
}
},
{
"diet": {
"slug": "high_protein",
"label": "High Protein"
},
"macros": {
"carbohydrate": 180,
"fat": 65,
"protein": 160,
"kcal": 2000
}
}
]
Retrieve all available exclusion diets. Using these diets in other calls will filter out incompatible ingredients automatically.
Response
[
{ "slug": "pregnant", "label": "I am pregnant" },
{ "slug": "gluten_free", "label": "Gluten-free" },
{ "slug": "lactose_free", "label": "Lactose-free" },
{ "slug": "nut_free", "label": "No nuts" },
{ "slug": "meat_free", "label": "No meat" },
{ "slug": "fish_free", "label": "No fish" },
{ "slug": "vegan", "label": "Plant-based" }
]
Retrieve all excludable product sets that can be used in diet restrictions. These allow fine-grained ingredient exclusions.
Response
[
{ "slug": "bacon", "label": "Bacon" },
{ "slug": "bread", "label": "Bread" },
{ "slug": "eggs", "label": "Eggs" },
{ "slug": "chicken", "label": "Chicken" },
{ "slug": "nuts", "label": "Nuts" },
{ "slug": "apple", "label": "Apple" }
]
Retrieve both exclusion diets and excludable sets in a single request. This is the recommended endpoint for fetching all diet restriction options.
Response
{
"diets": [
{ "slug": "vegan", "label": "Plant-based" }
],
"excludableSets": [
{ "slug": "bacon", "label": "Bacon" },
{ "slug": "bread", "label": "Bread" },
{ "slug": "eggs", "label": "Eggs" }
]
}
Get a detailed breakdown of which product sets are excluded and why, based on diet restrictions. Useful for showing users exactly what's being filtered.
Request Body
{
"diets": ["vegan"],
"excludedSets": ["chocolate", "honey"],
"includedSets": ["eggs"]
}
Response
[
{
"title": "Excluded by the vegan diet",
"slug": "vegan",
"sets": [
{ "slug": "chicken", "label": "Chicken" },
{ "slug": "cheese", "label": "Cheese" }
],
"overridden": [
{ "slug": "eggs", "label": "Eggs" }
]
},
{
"title": "Your own excluded sets",
"slug": null,
"sets": [
{ "slug": "chocolate", "label": "Chocolate" },
{ "slug": "honey", "label": "Honey" }
],
"overridden": []
}
]
Retrieve recipes organized by eating moment (slot) and meal type, filtered by diet restrictions and macros.
Request Body
{
"dietRestrictions": {
"diets": [],
"excludedSets": [],
"includedSets": []
},
"macros": {
"carbohydrate": 200,
"fat": 70,
"protein": 140,
"kcal": 2000
}
}
Consider showing warnings based on recipeCount:
- ≤10 recipes: Very limited variety — show danger alert
- ≤25 recipes: Limited variety — show warning
- <4 recipes: Insufficient — advise changing preferences
Response
[
{
"slot": {
"slug": "breakfast",
"title": "Breakfast"
},
"types": [
{
"label": "Omelette and stir fry",
"slug": "omelette_and_stir_fry",
"mealCount": 3,
"recipeCount": 12,
"recipes": [
{ "title": "Omelette wrap with vegetables", "id": 2125 }
]
}
]
},
{
"slot": {
"slug": "lunch",
"title": "Lunch"
},
"types": [...]
}
]
Retrieve detailed information about a specific recipe, including ingredients, macros, and diet profile variations.
Path Parameters
| Parameter | Description |
|---|---|
| idintegerrequired | Recipe ID |
Response
{
"title": "Omelette wrap with vegetables",
"preparationTime": 10,
"products": [
"Egg",
"Italian herbs, dried",
"Olive oil",
"Carrot",
"Cucumber",
"Red bell pepper"
],
"macros": {
"carbohydrate": 14.71,
"fat": 20.04,
"protein": 16.22,
"kcal": 304.08
},
"owner": "fitchef"
}
Generate a mealplan based on macros and diet restrictions. This endpoint creates a mealplan asynchronously and calls back to the provided URL when complete.
Request Body
{
"dietRestrictions": {
"diets": [],
"excludedSets": [],
"includedSets": []
},
"carbohydrate": 200,
"protein": 140,
"fat": 70,
"callback": "https://your-app.com/webhook",
"configuredDays": [
{
"validOn": [0, 1],
"eatingMoments": [
{ "slot": "breakfast", "skipped": true },
{ "slot": "lunch", "recipeId": 2125 }
]
}
]
}
Request Fields
| Field | Description |
|---|---|
| dietRestrictionsobjectrequired | Contains diets, excludedSets, and includedSets arrays |
| carbohydrateintegerrequired | Target carbohydrates in grams |
| proteinintegerrequired | Target protein in grams |
| fatintegerrequired | Target fat in grams |
| callbackstringrequired | Webhook URL for mealplan delivery |
| configuredDaysarray | Optional day-specific configurations |
| excludedRecipesarray | Recipe IDs to exclude from generation |
| recipeHistorystring | JSON string from previous mealplan to avoid repetition |
Immediate Response
{
"status": "OK",
"errors": [],
"identifier": 12345
}
The mealplan is generated asynchronously. When complete, a webhook will be sent to your callback URL with the full mealplan data including days, meals, ingredients, shopping list, and nutrition totals.
Error Handling
All endpoints return consistent error responses. Check the HTTP status code and the errors array for details.
{
"errors": [
"Invalid access token",
"Missing required field: weight"
]
}
HTTP Status Codes
| Status | Description |
|---|---|
| 200 | Success |
| 400 | Bad Request — validation errors in request body |
| 401 | Unauthorized — invalid or missing access token |
| 403 | Forbidden — insufficient permissions |
| 404 | Not Found — resource doesn't exist |
| 500 | Internal Server Error |
Ready to Integrate?
Get API credentials, access sandbox environments, and start building with FitChef.