# Search foods

> Finds foods to log in one library, by name, brand or barcode.

`GET /foods`

Needs the **Read** permission. Use a result's `library` and `key` as `food` when you [create a meal](https://splot.health/docs/api/meals/create).

## Query parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `query` | string | Words from the name or brand, or a whole barcode. Generic ingredients need three characters or more. Up to 200 characters. Defaults to ``. |
| `library` | string | The library to search. One of `off`, `splot`, `mine` or `composition`. Defaults to `mine`. |
| `limit` | integer | How many to return. From 1 to 100. Defaults to 30. |
| `offset` | integer | How many to skip. Send the previous page's `nextOffset`. Defaults to 0. |
| `locale` | string | A language, such as `de`. Generic ingredients are named in it where they can be. Up to 80 characters. |
| `region` | string | A two-letter country, such as `DE`. Open Food Facts lists its products first. |

The libraries are described in [the food object](https://splot.health/docs/api/foods/object#libraries). Without a query, `mine` lists your foods, those you eat most first.

## Response

`200` with a page of [foods](https://splot.health/docs/api/foods/object) and the offset of the next page, or `null` on the last.

```json
{ "foods": [], "nextOffset": null }
```

## Example

```sh
curl "https://app.splot.health/v1/foods?library=composition&query=salmon&locale=en" \
  -H "Authorization: Bearer $SPLOT_API_KEY"
```
