tbca.net.br APItbca.net.br ↗
Access Brazil's TBCA food composition database via API. Get nutritional profiles, statistical data, household measures, and regional foods for thousands of items.
curl -X GET 'https://api.parse.bot/scraper/f3f96c01-69e8-48d9-8e26-b6765980f9d6/list_foods?page=1&query=arroz' \ -H 'X-API-Key: $PARSE_API_KEY'
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.
| Param | Type | Description |
|---|---|---|
| page | string | Page number for pagination. |
| query | string | Search query for food name or code (e.g. 'arroz'). |
| group_id | string | Filter by food group ID from list_food_groups (e.g. '65' for CEREAIS E DERIVADOS). Omitting returns all groups. |
| food_type | string | Filter by food type ID from list_food_types (e.g. '70' for PREPARO SIMPLES DO ALIMENTO). Omitting returns all types. |
{
"type": "object",
"fields": {
"foods": "array of food objects each containing code, name, scientific_name, group, brand, and detail_id",
"total_pages": "integer total number of pages available"
},
"sample": {
"data": {
"foods": [
{
"code": "BRC0012A",
"name": "Arroz, creme, cozido, s/ tempero, Brasil",
"brand": "",
"group": "Cereais e derivados",
"detail_id": "n0REd3kv7e86D%2BViXWYUnQ%3D%3D=qVFrIUJyMsGsU0SmbrckEQ%3D%3D",
"scientific_name": "Orysa sativa L."
}
],
"total_pages": 1
},
"status": "success"
}
}About the tbca.net.br API
The TBCA API exposes 9 endpoints covering the Tabela Brasileira de Composição de Alimentos, Brazil's national food composition database. You can search thousands of food items by name or code with list_foods, retrieve per-100g nutrient values and household measure breakdowns with get_food_nutritional_profile, and run component-based queries to rank foods by a specific nutrient using search_by_component. Regional biodiversity foods and institutional foods each have dedicated listing endpoints.
Searching and Filtering Foods
The list_foods endpoint accepts a free-text query (food name or code such as arroz), a group_id from list_food_groups, and a food_type from list_food_types. Results are paginated and each item in the foods array includes code, name, scientific_name, group, brand, and a detail_id used to fetch deeper data. list_food_groups and list_food_types return plain id/name arrays that act as the filter vocabulary for both list_foods and search_by_component.
Nutritional Profiles and Statistical Data
get_food_nutritional_profile takes a detail_id and returns a metadata object (código, grupo, tipo_de_alimento, nome_científico, descrição, name_en, name_es) plus a nutrients array. Each nutrient row has component, units, value_per_100g, and dynamic columns for each household measure defined for that food. The columns vary per item, so get_food_composition_household_measures (which accepts a food_code) is useful for understanding the measure names and weights before parsing those dynamic columns.
get_food_statistical_info surfaces the analytical depth of the database: for each nutrient component it returns desvio_padrão (standard deviation), valor_mínimo, valor_máximo, número_de_dados (data point count), plus a references field and a flag distinguishing analytical from calculated values. This is relevant for research applications where measurement uncertainty matters.
Specialty Food Lists and Component Search
list_biodiversity_regional_foods and list_institutional_foods expose two subsets of the database that are not reachable through list_foods. Regional/biodiversity foods use a cod_produto=XXXC format for detail_id, while institutional foods use the standard encrypted format with BRD-prefixed codes. search_by_component accepts a component in unit|TAGNAME pipe-delimited format (e.g. kJ|ENERGIA), an optional group_id, and an optional food_type, returning foods ranked by that nutrient's value_per_100g.
- Build a Brazilian diet tracker that displays per-100g and household-portion nutrient values for thousands of foods.
- Rank foods within a specific group (e.g. cereals) by energy or protein content using
search_by_component. - Research regional and biodiversity foods native to Brazil via
list_biodiversity_regional_foodsfor food security studies. - Generate nutrient comparison tables for institutional meal planning using
list_institutional_foodsand nutritional profiles. - Display standard deviation and data-point counts from
get_food_statistical_infoin scientific nutrition publications. - Build a household-measure converter by combining
get_food_composition_household_measureswith nutrient profile data. - Filter and export food composition data by group and type for academic food science databases.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 250 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does TBCA have an official developer API?+
How does the `search_by_component` endpoint work, and what format does the `component` parameter require?+
component value in unit|TAGNAME pipe-delimited format — for example kJ|ENERGIA. The tagname and unit must match identifiers used in the TBCA database; kJ|ENERGIA is a verified working value. You can optionally narrow results with group_id and food_type. The response returns foods sorted by value_per_100g for that nutrient, each with a detail_id you can pass to get_food_nutritional_profile.Why do household measure columns in nutritional profiles vary between foods?+
get_food_nutritional_profile response reflects these as dynamic columns on each nutrient row. To know the measure names and their gram weights before parsing those columns, call get_food_composition_household_measures with the food's code field first.Does the API expose preparation method details or recipe-level ingredient breakdowns?+
Are there any quirks with `detail_id` values for regional foods versus standard foods?+
list_biodiversity_regional_foods use a cod_produto=XXXC string as their detail_id, which is a different format from the encrypted IDs returned by list_foods and list_institutional_foods. If you are iterating across multiple listing endpoints, you need to handle both formats when passing detail_id to profile or statistical endpoints.