FitChef Logo
Partner API

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.

2.4M+
Meal Plans Generated
40K+
Active Users
100+
Partner Integrations
99.9%
Uptime SLA

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:

Request
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:

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:

Recommended API Flow
1
Get Macro Factors
2
Calculate Macros
3
Get Exclusion Data
4
Get Recipes
5
Generate Mealplan

API Endpoints

GET /api/v2/macro-factors

Retrieve all macro factors including goals, activity levels, and sports. Use these values when collecting user preferences and calculating macros.

Response

JSON
{
  "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
POST /api/v2/macros

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

JSON
{
  "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
Input Limits

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

JSON
[
  {
    "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
    }
  }
]
GET /api/v2/exclusion-diets

Retrieve all available exclusion diets. Using these diets in other calls will filter out incompatible ingredients automatically.

Response

JSON
[
  { "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" }
]
GET /api/v2/excludable-sets

Retrieve all excludable product sets that can be used in diet restrictions. These allow fine-grained ingredient exclusions.

Response

JSON
[
  { "slug": "bacon", "label": "Bacon" },
  { "slug": "bread", "label": "Bread" },
  { "slug": "eggs", "label": "Eggs" },
  { "slug": "chicken", "label": "Chicken" },
  { "slug": "nuts", "label": "Nuts" },
  { "slug": "apple", "label": "Apple" }
]
GET /api/v2/exclusion-data

Retrieve both exclusion diets and excludable sets in a single request. This is the recommended endpoint for fetching all diet restriction options.

Response

JSON
{
  "diets": [
    { "slug": "vegan", "label": "Plant-based" }
  ],
  "excludableSets": [
    { "slug": "bacon", "label": "Bacon" },
    { "slug": "bread", "label": "Bread" },
    { "slug": "eggs", "label": "Eggs" }
  ]
}
POST /api/v2/excluded-sets-breakdown

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

JSON
{
  "diets": ["vegan"],
  "excludedSets": ["chocolate", "honey"],
  "includedSets": ["eggs"]
}

Response

JSON
[
  {
    "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": []
  }
]
POST /api/v2/recipes

Retrieve recipes organized by eating moment (slot) and meal type, filtered by diet restrictions and macros.

Request Body

JSON
{
  "dietRestrictions": {
    "diets": [],
    "excludedSets": [],
    "includedSets": []
  },
  "macros": {
    "carbohydrate": 200,
    "fat": 70,
    "protein": 140,
    "kcal": 2000
  }
}
Recipe Count Thresholds

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

JSON
[
  {
    "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": [...]
  }
]
GET /api/v2/recipe/{id}

Retrieve detailed information about a specific recipe, including ingredients, macros, and diet profile variations.

Path Parameters

Parameter Description
idintegerrequired Recipe ID

Response

JSON
{
  "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"
}
POST /api/v2/mealplan

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

JSON
{
  "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

JSON
{
  "status": "OK",
  "errors": [],
  "identifier": 12345
}
Asynchronous Processing

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.

Error Response
{
  "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.

Technical Questions
Vincent Knol
[email protected]
Partnerships
Partnership Team
[email protected]