Ingredients API
Access our comprehensive database of 100,000+ ingredients with detailed nutritional profiles, allergen information, and sustainability data.
Endpoints
| Endpoint | Description |
|---|---|
GET /v1/ingredients | List all ingredients |
GET /v1/ingredients/:id | Retrieve an ingredient |
POST /v1/ingredients/search | Search ingredients |
GET /v1/ingredients/:id/nutrients | Get nutrient profile |
GET /v1/ingredients/:id/allergens | Get allergen information |
List Ingredients
GET
/v1/ingredientsReturns a paginated list of ingredients. Use query parameters to filter and sort results.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| limit | integer | 20 | Number of results to return (1-100) |
| offset | integer | 0 | Number of results to skip |
| category | string | - | Filter by category (e.g., "vegetables", "proteins") |
| sort | string | name | Sort field (name, calories, protein) |
| order | string | asc | Sort order (asc, desc) |
curl "https://api.journeyfoods.com/v1/ingredients?limit=10&category=vegetables" \
-H "Authorization: Bearer $JOURNEYFOODS_API_KEY"Response200 OK
{
"data": [
{
"id": "ing_tomato_001",
"name": "Tomato, raw",
"category": "vegetables",
"calories": 18,
"protein": 0.9
},
{
"id": "ing_spinach_001",
"name": "Spinach, raw",
"category": "vegetables",
"calories": 23,
"protein": 2.9
}
],
"has_more": true,
"total": 1250
}Retrieve an Ingredient
GET
/v1/ingredients/:idRetrieves detailed information about a specific ingredient by its ID.
curl "https://api.journeyfoods.com/v1/ingredients/ing_tomato_001" \
-H "Authorization: Bearer $JOURNEYFOODS_API_KEY"Response200 OK
{
"id": "ing_tomato_001",
"name": "Tomato, raw",
"category": "vegetables",
"scientific_name": "Solanum lycopersicum",
"description": "Fresh raw tomato",
"nutrients": {
"calories": 18,
"protein": 0.9,
"carbohydrates": 3.9,
"fiber": 1.2,
"sugar": 2.6,
"fat": 0.2,
"saturated_fat": 0.03,
"sodium": 5,
"potassium": 237,
"vitamin_a": 42,
"vitamin_c": 13.7,
"calcium": 10,
"iron": 0.27
},
"allergens": [],
"sustainability_score": 8.5,
"seasonality": ["summer", "fall"],
"origin_countries": ["USA", "Mexico", "Spain", "Italy"],
"unit": "per 100g",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-06-20T14:45:00Z"
}Search Ingredients
POST
/v1/ingredients/searchSearch for ingredients using natural language queries and filters. Powered by AI for intelligent matching.
The search endpoint uses semantic search to understand your query intent. For example, searching for "high protein vegetable" will return vegetables with high protein content.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| query | string | Yes | Search query string |
| filters | object | No | Additional filters to apply |
| filters.category | string[] | No | Filter by categories |
| filters.max_calories | number | No | Maximum calories per 100g |
| filters.allergen_free | string[] | No | Exclude allergens |
curl -X POST "https://api.journeyfoods.com/v1/ingredients/search" \
-H "Authorization: Bearer $JOURNEYFOODS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "high protein vegetable",
"filters": {
"category": ["vegetables", "legumes"],
"max_calories": 100
}
}'