Getting Started
1. Get Your API Key
Sign up for a MealFlight account and generate your API key from the developer dashboard.
Create Account2. Read the Docs
Explore our comprehensive documentation to understand endpoints, parameters, and response formats.
View Endpoints3. Make Your First Call
Use our code examples to quickly integrate MealFlight into your application.
See ExamplesAuthentication
Bearer Token Authentication
All API requests require authentication using a Bearer token. Include your API key in the Authorization header of every request.
Authorization: Bearer YOUR_API_KEYRate Limits: Free tier: 100 requests/day. Pro tier: 10,000 requests/day. Enterprise: Unlimited.
API Endpoints
| Method | Endpoint | Description | Category |
|---|---|---|---|
| GET | /v1/meals/plan | Generate a personalized meal plan | Meal Planning |
| POST | /v1/meals/generate | Create a new AI-generated meal plan | Meal Planning |
| GET | /v1/recipes | Search and retrieve recipes | Recipes |
| GET | /v1/recipes/{id} | Get detailed recipe information | Recipes |
| POST | /v1/nutrition/analyze | Analyze nutritional content of foods | Nutrition |
| GET | /v1/user/preferences | Retrieve user dietary preferences | User |
| PUT | /v1/user/preferences | Update user dietary preferences | User |
| GET | /v1/shopping/list | Generate shopping list from meal plan | Shopping |
Code Examples
Request
const response = await fetch('https://api.mealflight.com/v1/meals/generate', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
calories: 2000,
diet: 'balanced',
restrictions: ['gluten-free'],
meals_per_day: 3
})
});
const mealPlan = await response.json();Response
200 OK{
"success": true,
"data": {
"plan_id": "mp_abc123xyz",
"date": "2026-05-08",
"total_calories": 1987,
"meals": [
{
"type": "breakfast",
"name": "Avocado & Egg Toast",
"calories": 420,
"protein": 18,
"carbs": 32,
"fat": 24,
"recipe_id": "rec_001"
},
{
"type": "lunch",
"name": "Grilled Chicken Salad",
"calories": 580,
"protein": 42,
"carbs": 28,
"fat": 32,
"recipe_id": "rec_002"
},
{
"type": "dinner",
"name": "Salmon with Vegetables",
"calories": 650,
"protein": 45,
"carbs": 35,
"fat": 38,
"recipe_id": "rec_003"
}
],
"macros": {
"protein": 105,
"carbs": 95,
"fat": 94
}
}
}Official SDKs
Get started faster with our official client libraries for popular programming languages.