apyhub
Back

Food Ingredient Information API

What it does

Ingredient Toolkit gives you ingredient lookup, search, substitution, mapping, and recipe-visualization endpoints in one place. Send ingredient IDs, names, or ingredient lists, and get structured ingredient data, matching suggestions, alternate ingredients, or rendered recipe widgets back.

Use GET /food/ingredients/:id/information when you need details for a single ingredient ID. It accepts an id path parameter, with optional unit and amount query parameters, and returns a structured ingredient object with fields such as id, name, aisle, image, nutrition, estimatedCost, possibleUnits, and other metadata from the schema.

For discovery, GET /food/ingredients/search and GET /food/ingredients/autocomplete both accept a query string. Search also supports filters like number, offset, language, addChildren, intolerances, and nutrient percentage bounds, and returns results, offset, number, and totalResults. Autocomplete returns a lightweight array of ingredient matches with id, name, aisle, image, and possibleUnits.

You can also compare and substitute ingredients. GET /food/ingredients/:id/substitutes returns the ingredient, substitutes, and message for an ingredient ID, while GET /food/ingredients/substitutes does the same for an ingredientName. GET /food/ingredients/:id/amount calculates an ingredient amount and unit for a target nutrient, and the recipe widget endpoints return binary or generated widget output for ingredient-list display.

▣ ENDPOINT 02 / 08
GET
Get Ingredient Information
https://api.eu.apyhub.com/skycraft/food-ingredient-information-api/food/ingredients/:id/information

QUICKSTART

GUIDE

Quickstart

Fetch ingredient information for a specific ingredient ID, with optional unit and amount query parameters.

curl -X GET "https://api.eu.apyhub.com/skycraft/food-ingredient-information-api/food/ingredients/:id/information?unit=grams&amount=150" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Returns a JSON object with fields such as id, name, original, originalName, amount, unit, unitShort, unitLong, possibleUnits, estimatedCost, consistency, aisle, image, and meta. It may also include a nested nutrition object with nutrients, properties, caloricBreakdown, and weightPerServing.

{
  "id": 12135,
  "original": "nuts",
  "originalName": "nuts",
  "name": "nuts",
  "amount": 150,
  "unit": "grams",
  "unitShort": "g",
  "unitLong": "grams",
  "possibleUnits": ["handful", "g", "ounce", "oz", "cup", "serving", "tablespoon"],
  "estimatedCost": {
    "value": 182.14,
    "unit": "cents"
  },
  "consistency": "solid",
  "shoppingListUnits": ["ounces", "pounds"],
  "aisle": "Nuts",
  "image": "nuts-mixed.jpg",
  "meta": [],
  "nutrition": {
    "nutrients": [
      {"name": "Calories", "amount": 891, "unit": "kcal", "percentOfDailyNeeds": 44.55},
      {"name": "Protein", "amount": 25.95, "unit": "g", "percentOfDailyNeeds": 51.9},
      {"name": "Carbohydrates", "amount": 38.03, "unit": "g", "percentOfDailyNeeds": 12.68},
      {"name": "Fat", "amount": 77.18, "unit": "g", "percentOfDailyNeeds": 118.73},
      {"name": "Fiber", "amount": 13.5, "unit": "g", "percentOfDailyNeeds": 54}
    ],
    "properties": [
      {"name": "Glycemic Index", "amount": 29.67, "unit": ""},
      {"name": "Glycemic Load", "amount": 7.28, "unit": ""},
      {"name": "Nutrition Score", "amount": 27.72, "unit": "%"}
    ],
    "flavonoids": [],
    "caloricBreakdown": {
      "percentProtein": 10.92,
      "percentFat": 73.08,
      "percentCarbs": 16
    },
    "weightPerServing": {
      "amount": 150,
      "unit": "g"
    }
  },
  "categoryPath": ["snack"]
}
TRY ITLIVE · 20 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.

About this endpoint

What it does

Retrieves information for a specific ingredient by its id. You can optionally supply unit and amount query parameters to request the ingredient information in a particular quantity and unit.

Path Parameter(s)

AttributeTypeMandatoryDescription
idIntegerYesThe ingredient identifier in the path.

Query Parameter(s)

AttributeTypeMandatoryDescription
unitStringNoThe unit to use for the ingredient quantity.
amountNumberNoThe amount to use with unit.

Response

Returns a JSON object with ingredient details, including top-level fields

ParameterTypeMandatoryDescription
idIntegerYesIngredient identifier.
metaString ArrayYesMetadata values associated with the ingredient.
nameStringYesIngredient name.
unitStringYesUnit used in the response.
aisleStringYesAisle name for the ingredient.
imageStringYesImage filename for the ingredient.
amountNumberYesAmount represented by the response.
originalStringYesOriginal ingredient text.
unitLongStringYesLong-form unit name.
nutritionObjectNoNutrition details object. Contains nutrients, properties, caloricBreakdown, and weightPerServing; see schema for nested fields.
unitShortStringYesShort-form unit name.
consistencyStringYesIngredient consistency.
categoryPathString ArrayNoCategory path values for the ingredient.
originalNameStringYesOriginal ingredient name.
estimatedCostObjectYesEstimated cost object with value and unit.
possibleUnitsString ArrayYesUnits supported for this ingredient.
shoppingListUnitsString ArrayNoUnits suitable for shopping lists.
▣ ENDPOINT 03 / 08
GET
Get Ingredient Substitutes by ID
https://api.eu.apyhub.com/skycraft/food-ingredient-information-api/food/ingredients/:id/substitutes

QUICKSTART

GUIDE

Quickstart

Fetch the substitutes for a food ingredient by ID.

curl -X GET "https://api.eu.apyhub.com/skycraft/food-ingredient-information-api/food/ingredients/:id/substitutes" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Returns a JSON object with ingredient and message string fields, plus a substitutes array of strings.

{
  "ingredient": "sugar",
  "substitutes": ["honey", "maple syrup"],
  "message": "Substitutes found"
}
TRY ITLIVE · 20 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.

About this endpoint

What it does

Retrieves substitute ingredients for a specific ingredient ID. The response returns a JSON object containing the ingredient name, a list of substitute ingredient names, and a message.

Path Parameter(s)

AttributeTypeMandatoryDescription
idIntegerYesIngredient identifier.

Response

Returns a JSON object with message as a string, ingredient as a string, and substitutes as a string array.

AttributeTypeMandatoryDescription
messageStringYesA non-empty message string.
ingredientStringYesThe ingredient name.
substitutesString ArrayYesSubstitute ingredient names.
▣ ENDPOINT 04 / 08
GET
Ingredients by ID Image
https://api.eu.apyhub.com/skycraft/food-ingredient-information-api/recipes/:id/ingredientWidget.png

QUICKSTART

GUIDE

Quickstart

Fetch the recipe ingredient widget image for a recipe ID.

curl -X GET "https://api.eu.apyhub.com/skycraft/food-ingredient-information-api/recipes/:id/ingredientWidget.png" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Returns a binary image response (string with format: binary)

TRY ITLIVE · 20 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.

About this endpoint

What it does

Returns the ingredient widget image for a recipe identified by its numeric id. You can optionally choose the measurement system used in the image with the measure query parameter.

Path Parameter(s)

AttributeTypeMandatoryDescription
idIntegerYesThe recipe identifier.

Query Parameter(s)

AttributeTypeMandatoryDescription
measureENUMNoMeasurement system for the image. Allowed values: us, metric.

Response

Returns a binary string response containing the generated ingredient widget image for the requested recipe.

▣ ENDPOINT 05 / 08
POST
Map Ingredients to Grocery Products
https://api.eu.apyhub.com/skycraft/food-ingredient-information-api/food/ingredients/map

QUICKSTART

GUIDE

Quickstart

Map a list of ingredients to product matches by sending the required ingredients and servings fields.

curl -X POST "https://api.eu.apyhub.com/skycraft/food-ingredient-information-api/food/ingredients/map" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "ingredients": ["tomato", "mozzarella"],
    "servings": 2
  }'

What you'll get back

Returns a JSON array of objects. Each item includes original, originalName, ingredientImage, meta (an array of strings), and products (an array of product objects with id, title, and upc).

[
  {
    "original": "tomato",
    "originalName": "Tomato",
    "ingredientImage": "https://example.com/tomato.png",
    "meta": ["fresh"],
    "products": [
      {
        "id": 123,
        "title": "Fresh Tomato",
        "upc": "012345678905"
      }
    ]
  }
]
TRY ITLIVE · 20 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
ingredients*

About this endpoint

What it does

Maps a list of ingredient names to grocery products. You send the ingredients and servings in the request body, and the endpoint returns an array of matched ingredient records with product suggestions.

Request Body

ParameterTypeMandatoryDescription
ingredientsString ArrayYesIngredient names to map to grocery products.
servingsNumberYesNumber of servings used by the mapping operation.

Response

Returns a JSON array of objects. Each object includes original and originalName strings, an ingredientImage string, a meta string array, and a products object array; each product contains id as an integer plus title and upc strings. Success response shape: 200.

ParameterTypeMandatoryDescription
originalStringYesOriginal ingredient value.
originalNameStringYesOriginal ingredient name.
ingredientImageStringYesImage reference for the ingredient.
metaString ArrayYesAssociated metadata strings.
productsObject ArrayYesMatched grocery products for the ingredient. Each item includes id, title, and upc.
products[].idIntegerYesProduct identifier.
products[].titleStringYesProduct title.
products[].upcStringYesProduct UPC.

Notes

The response is a unique array at both levels: the top-level result array is uniqueItems: true, and each products array is also uniqueItems: true.

▣ ENDPOINT 06 / 08
GET
Get Ingredient Substitutes
https://api.eu.apyhub.com/skycraft/food-ingredient-information-api/food/ingredients/substitutes

QUICKSTART

GUIDE

Quickstart

Look up ingredient substitutes by passing the ingredient name as a query parameter.

curl -X GET "https://api.eu.apyhub.com/skycraft/food-ingredient-information-api/food/ingredients/substitutes?ingredientName=butter" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Returns a JSON object with ingredient and message string fields, plus a substitutes array of strings.

{
  "ingredient": "butter",
  "substitutes": ["margarine", "ghee"],
  "message": "Substitutes found successfully"
}
TRY ITLIVE · 20 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.

About this endpoint

What it does

Returns ingredient substitute information for a given ingredient name. You provide the ingredient name as a query parameter, and the response comes back as a JSON object containing the original ingredient, a list of substitutes, and a message.

Query Parameter(s)

AttributeTypeMandatoryDescription
ingredientNameStringYesThe ingredient name to look up.

Response

Returns a JSON object with three required fields: message as a string, ingredient as a string, and substitutes as an array of strings. The success response is a JSON object with these top-level fields.

AttributeTypeMandatoryDescription
messageStringYesA non-empty message string.
ingredientStringYesA non-empty string identifying the ingredient that was looked up.
substitutesString ArrayYesAn array of substitute ingredient names.
▣ ENDPOINT 07 / 08
GET
Compute Ingredient Amount
https://api.eu.apyhub.com/skycraft/food-ingredient-information-api/food/ingredients/:id/amount

QUICKSTART

GUIDE

Quickstart

Get the amount for a food ingredient by ID, using the required nutrient and target query parameters.

curl -X GET "https://api.eu.apyhub.com/skycraft/food-ingredient-information-api/food/ingredients/:id/amount?target=2&nutrient=protein" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Returns a JSON object with amount as a number and unit as a string.

{
  "amount": 0.7,
  "unit": "oz"
}
TRY ITLIVE · 20 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.

About this endpoint

What it does

Computes the amount of the ingredient identified by id for a requested nutrient and target, with an optional unit query parameter. The response returns the calculated amount together with the unit used.

Path Parameter(s)

AttributeTypeMandatoryDescription
idIntegerYesThe ingredient identifier.

Query Parameter(s)

AttributeTypeMandatoryDescription
unitStringNoThe unit to use for the calculation.
targetIntegerYesThe target value for the nutrient calculation.
nutrientStringYesThe nutrient to compute against.

Response

Returns a JSON object with amount as a number and unit as a string. These are the top-level fields in the success response.

AttributeTypeMandatoryDescription
amountNumberYesThe computed amount.
unitStringYesThe unit used in the response.
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.