---
title: "Search own food history + favourites, falling back to the FatSecret/AI catalog when needed"
method: GET
path: "/api/food-log/quick-add-search"
tags: ["Food Log"]
---

# Search own food history + favourites, falling back to the FatSecret/AI catalog when needed

`GET /api/food-log/quick-add-search`

## Request

- Base URL: `https://api.rewritelifestyle.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.rewritelifestyle.ai/api/food-log/quick-add-search`
- Auth: HTTP bearer

Trigram-similarity search over the user's own logged food_logs history and favorite meals, grouped by source and capped at 5 each — always available, no AI, no subscription/quota gate. Omitting `sources` runs all three legs (history, favourites, catalog) — the intended default. The catalog leg (AI/FatSecret pipeline) being enabled does NOT mean it runs: it only actually executes when history/favourites did NOT already return a confident match (a strong history similarity score, or any favourite hit) OR the query names a specific measured amount (e.g. "200g chicken", "12 oz steak") that a local logged row can't answer precisely; otherwise it is skipped for free and `fatsecretCatalogSkipped: true` is returned instead. When it does run, it is manually quota-checked and degrades to `fatsecretCatalog: null, fatsecretCatalogError: "rate_limited" | "forbidden" | "unavailable"` instead of failing the whole request when the user has no AI access left. Pass an explicit `sources` subset omitting "catalog" (e.g. `sources=history,favourites`) only to hard-guarantee zero AI quota spend for a call.

## Query parameters

- `q` string, required
- `sources` string[]
- `timezone` string

## Headers

- `x-timezone` string, required

## Response `200`

- unknown

---

[API](https://skmtc.dev/rewritelifestyle/apis/rewrite-lifestyle-api.md) - [All operations](https://skmtc.dev/rewritelifestyle/apis/rewrite-lifestyle-api/llms.txt) - [OpenAPI document](https://skmtc.dev/rewritelifestyle/apis/rewrite-lifestyle-api/revisions/28695827f27a?raw)
