Quickstart
Get your first nutrition estimate in under 5 minutes.
1. Get your API key
Sign up for an account at portal.macroestimator.com and create an API key from the dashboard.
2. Make your first request
Use the /v1/estimate/sync endpoint to get nutrition estimates for any food description.
Estimate nutrition for a food
curl -X POST https://api.macroestimator.com/v1/estimate/sync \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"role": "user",
"content": "2 scrambled eggs with 2 slices of whole wheat toast"
}
]
}'3. Parse the response
The API returns a structured response with nutrition estimates for each food item:
Example Responsejson
{
"items": [
{
"name": "Scrambled eggs",
"quantity": 2,
"unit": "large eggs",
"calories": 182,
"protein": 12,
"carbs": 2,
"fat": 14
},
{
"name": "Whole wheat toast",
"quantity": 2,
"unit": "slices",
"calories": 160,
"protein": 8,
"carbs": 28,
"fat": 2
}
],
"totals": {
"calories": 342,
"protein": 20,
"carbs": 30,
"fat": 16
}
}Using images
You can also estimate nutrition from images. First upload your image, then reference it in your request:
Upload an imagebash
# Upload the image
curl -X POST https://api.macroestimator.com/v1/upload/base64 \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"image": "data:image/jpeg;base64,/9j/4AAQSkZJRg..."
}'
# Response: { "url": "https://api.macroestimator.com/images/abc123.jpg" }Use the image in an estimatebash
curl -X POST https://api.macroestimator.com/v1/estimate/sync \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"role": "user",
"content": [
{
"type": "image_url",
"image_url": {
"url": "https://api.macroestimator.com/images/abc123.jpg"
}
},
{
"type": "text",
"text": "What are the macros for this meal?"
}
]
}
]
}'Next steps
- Learn about authentication - Understand API keys and rate limits
- Explore the Estimate endpoint - Full reference with all parameters
- Manage custom recipes - Save recipes for consistent tracking
- View more examples - Code samples in multiple languages