# Tbca — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Search Brazil's most comprehensive food database to get detailed nutritional profiles, household portion measurements, and statistical composition data for thousands of foods including regional and biodiversity-focused options. Find specific nutrients by component, browse foods by group or type, and access institutional food information all in one place.

**Category:** Food & Dining | **Website:** [tbca.net.br/](https://tbca.net.br/) | **Docs:** [parse.bot/marketplace/d776a04f-b80d-4e68-a9e9-365f2bee2eb0/tbca-net-br-api](https://parse.bot/marketplace/d776a04f-b80d-4e68-a9e9-365f2bee2eb0/tbca-net-br-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-tbca-net-br-api-d776a04f/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_food_composition_household_measures

Get household measure definitions for a food code. Returns the measure names, weights, and units that are used as column headers in the nutritional profile table.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `food_code` | string | Yes | The food code from list_foods results (code field, e.g. 'BRC0012A'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-tbca-net-br-api-d776a04f/get_food_composition_household_measures \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"food_code":"<string>"}'
```

### get_food_nutritional_profile

Get the full nutritional profile of a specific food item. Returns metadata (name, group, scientific name) and a list of nutrients with values per 100g and per household measure. Nutrient columns are dynamic and vary per food item depending on its household measures.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `detail_id` | string | Yes | The encrypted ID from list_foods results (detail_id field). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-tbca-net-br-api-d776a04f/get_food_nutritional_profile \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"detail_id":"<string>"}'
```

### get_food_statistical_info

Get statistical information for a food item including standard deviation, min/max values, number of data points, references, and data type (analytical vs calculated) for each nutrient component.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `detail_id` | string | Yes | The encrypted ID from list_foods results (detail_id field). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-tbca-net-br-api-d776a04f/get_food_statistical_info \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"detail_id":"<string>"}'
```

### list_biodiversity_regional_foods

List regional and biodiversity foods from the TBCA database. These foods use a different detail_id format (cod_produto=XXXC) than the main database.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-tbca-net-br-api-d776a04f/list_biodiversity_regional_foods \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### list_food_groups

List all available food groups. Returns group IDs and names that can be used as the group_id filter in list_foods and search_by_component.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-tbca-net-br-api-d776a04f/list_food_groups \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### list_food_types

List all available food types. Returns type IDs and names that can be used as the food_type filter in list_foods and search_by_component.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-tbca-net-br-api-d776a04f/list_food_types \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### list_foods

Search for food items with filters and pagination. Returns a paginated list of foods matching the query, group, and type filters. Use list_food_groups and list_food_types to discover valid filter IDs. Paginates via integer page counter.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `food_type` | string | No | Filter by food type ID from list_food_types (e.g. '70' for PREPARO SIMPLES DO ALIMENTO). Omitting returns all types. |
| `group_id` | string | No | Filter by food group ID from list_food_groups (e.g. '65' for CEREAIS E DERIVADOS). Omitting returns all groups. |
| `page` | integer | No | Page number for pagination (1-based). |
| `query` | string | No | Search query for food name or code (e.g. 'arroz'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-tbca-net-br-api-d776a04f/list_foods \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"food_type":"<string>","group_id":"<string>","page":"<integer>","query":"<string>"}'
```

### list_institutional_foods

List institutional foods from the TBCA database. These foods use the standard encrypted detail_id format and typically have BRD-prefixed food codes.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-tbca-net-br-api-d776a04f/list_institutional_foods \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### search_by_component

Search foods by nutritional component. Returns foods sorted by the specified nutrient value. The component parameter uses a pipe-delimited format of unit|tagname that must match exact internal identifiers from the TBCA database. Use list_food_groups and list_food_types to discover valid group_id and food_type values.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `component` | string | No | Nutrient component identifier in 'unit\|TAGNAME' format. Verified working value: 'kJ\|ENERGIA'. |
| `food_type` | string | No | Food type ID from list_food_types (e.g. '70' for PREPARO SIMPLES DO ALIMENTO). |
| `group_id` | string | No | Food group ID from list_food_groups (e.g. '65' for CEREAIS E DERIVADOS). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-tbca-net-br-api-d776a04f/search_by_component \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"component":"<string>","food_type":"<string>","group_id":"<string>"}'
```
