---
title: "Search foods"
method: GET
path: "/search"
tags: ["Foods"]
---

# Search foods

`GET /search`

Fuzzy food and brand search across 4.7M+ indexed foods. Results combine textual relevance with an internal confidence signal to help stronger records appear above sparse matches. Actual response time varies by network, location and workload.

## Query parameters

- `q` string, required
- `limit` integer
- `source` 'off' | 'usda' | 'claude'

## Response `200`

Ranked list of matching foods

- FoodResult[]
  - `id` integer
  - `name` string
  - `brand` string, nullable
  - `barcode` string, nullable
  - `category` string, nullable
  - `serving_size_g` number, nullable — Grams in one manufacturer serving, where the source declares one. Descriptive only: the nutrient fields below are not scaled to it. Null on roughly a third of records.
  - `serving_desc` string, nullable — Human-readable label for one serving, e.g. '3/4 cup (170 g)'.
  - `calories_kcal` number, nullable — Energy in kcal per 100 g
  - `protein_g` number, nullable — Protein in grams per 100 g
  - `fat_g` number, nullable — Total fat in grams per 100 g
  - `carbs_g` number, nullable — Carbohydrate in grams per 100 g
  - `fiber_g` number, nullable — Fibre in grams per 100 g
  - `sugar_g` number, nullable — Sugars in grams per 100 g
  - `sodium_mg` number, nullable — Sodium in mg per 100 g
  - `saturated_fat_g` number, nullable — Saturated fat in grams per 100 g
  - `cholesterol_mg` number, nullable — Cholesterol in mg per 100 g
  - `potassium_mg` number, nullable — Potassium in mg per 100 g
  - `image_url` string, nullable
  - `image_thumb_url` string, nullable
  - `source` string — Data source: off (Open Food Facts), usda (USDA FoodData Central), claude (labeled AI estimate) or community
  - `confidence` number — Data confidence score, 0–1
  - `static_url` string, nullable — Path of the human-readable page on www.getdietly.com

## Other responses

- `429` — Rate limit exceeded. Check the Retry-After and X-RateLimit-* headers.

---

[API](https://skmtc.net/getdietly/apis/dietlyapi.md) · [All operations](https://skmtc.net/getdietly/apis/dietlyapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/getdietly/dietlyapi/versions/52a57a48ae8d/schema)
