Paginate alternative matches for a multi-ingredient option (powers the mobile "show more" swap control)
The initial fatsecretSearch response for a multi-ingredient query ships 3 options per ingredient (primary + 2 alternatives). This endpoint returns additional options for a single ingredient — positions offset..offset+limit-1 from FatSecret's search results — in the same FoodOption shape so the mobile client can append to the existing alternatives array without re-fetching the original search. Defaults: offset=3 (skip the 3 already shown), limit=5. Stateless; re-runs searchFoodsWithNutrition on each call.
Request
- Base URLhttps://api.rewritelifestyle.ai (the document declares no server; this is the origin it was published from)
- URLhttps://api.rewritelifestyle.ai/api/food-log/ingredient-alternatives
- AuthHTTP bearer
Query parameters
The search term for this ingredient (typically the parsedIngredient / originalName field from a prior fatsecretSearch response).
Quantity the user logged for this ingredient. Needed for correct macro scaling. If omitted, macros scale to FatSecret's default serving.
Unit for the quantity (oz / g / cup / tbsp / etc.).
Optional brand hint — if the parser detected a brand in the original query, pass it here so FatSecret re-ranks toward branded matches.
Zero-based result offset. Defaults to 3 (skip the primary + 2 alternatives already shown). Clamped to [0, 20].
How many additional alternatives to return. Defaults to 5. Clamped to [1, 20].
Response
Example response
{
"success": true,
"searchTerm": "ribeye steak",
"offset": 3,
"limit": 5,
"alternatives": [
{
"id": "...",
"name": "Grass-Fed Beef Ribeye Steak",
"brand": "Butcher Box",
"quantity": 30,
"unit": "oz",
"calories": 2210,
"protein": 170,
"fat": 158
},
{
"id": "...",
"name": "Beef Ribeye Steaks",
"brand": "Great American Steak Company",
"quantity": 30,
"unit": "oz",
"calories": 2310,
"protein": 161,
"fat": 168
}
]
}Changes
No recorded changes to this operation across all 34 revisions of this API.