NutrientsDB · Arazzo Workflow

Resolve a food name to a NutrientsDB record and read its nutrient profile

Version 1.0.0

Two-step flow over the free, keyless NutrientsDB Sample API: search the public 1,000-food sample by name fragment, then re-fetch the chosen record by its stable public_id. Both steps use the single published operation, findFoods, selected by q or by id. No authentication is required.

1 workflow 1 source API 1 provider
View Spec View on GitHub NutritionFoodNutrientsfood-compositionDataSearchSample DataDatasetai-buildersReference DataOpen Datakeyless-apiArazzoWorkflows

Provider

nutrientsdb

Workflows

search-then-lookup-food
Search the sample by food name, then retrieve the selected food by public_id.
Step 1 searches by name fragment and returns up to 20 matches with total_matches so the caller knows how many were withheld. Step 2 pins the chosen record by its stable public_id, which is the identifier to persist — food names are verbose and ambiguous, ids are not.
2 steps inputs: limit, query outputs: name, nutrients, publicId, totalMatches
1
search-foods
Search the public 1,000-food sample by name fragment.
2
lookup-food
Retrieve the selected food by its exact public_id. q and id are mutually exclusive, so this step sends only id.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Resolve a food name to a NutrientsDB record and read its nutrient profile
  version: 1.0.0
  description: >-
    Two-step flow over the free, keyless NutrientsDB Sample API: search the public 1,000-food sample
    by name fragment, then re-fetch the chosen record by its stable public_id. Both steps use the
    single published operation, findFoods, selected by q or by id. No authentication is required.
sourceDescriptions:
- name: foodsApi
  url: ../openapi/nutrientsdb-foods-api-openapi.yml
  type: openapi
workflows:
- workflowId: search-then-lookup-food
  summary: Search the sample by food name, then retrieve the selected food by public_id.
  description: >-
    Step 1 searches by name fragment and returns up to 20 matches with total_matches so the caller
    knows how many were withheld. Step 2 pins the chosen record by its stable public_id, which is
    the identifier to persist — food names are verbose and ambiguous, ids are not.
  inputs:
    type: object
    required: [query]
    properties:
      query:
        type: string
        minLength: 2
        maxLength: 100
        description: Food name fragment, case-insensitive substring match.
        example: banana
      limit:
        type: integer
        minimum: 1
        maximum: 20
        default: 10
        description: Maximum search results. Values above 20 are capped at 20.
        example: 5
  steps:
  - stepId: search-foods
    description: Search the public 1,000-food sample by name fragment.
    operationId: findFoods
    parameters:
    - name: q
      in: query
      value: $inputs.query
    - name: limit
      in: query
      value: $inputs.limit
    successCriteria:
    - condition: $statusCode == 200
    - context: $response.body
      condition: $.count > 0
      type: jsonpath
    outputs:
      firstFoodId: $response.body#/foods/0/public_id
      firstFoodName: $response.body#/foods/0/name
      matchCount: $response.body#/count
      totalMatches: $response.body#/total_matches
  - stepId: lookup-food
    description: >-
      Retrieve the selected food by its exact public_id. q and id are mutually exclusive, so this
      step sends only id.
    operationId: findFoods
    parameters:
    - name: id
      in: query
      value: $steps.search-foods.outputs.firstFoodId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      foodName: $response.body#/food/name
      nutrients: $response.body#/food/nutrients
      energyKcal: $response.body#/food/nutrients/energy_kcal
      proteinG: $response.body#/food/nutrients/protein_g
  outputs:
    publicId: $steps.search-foods.outputs.firstFoodId
    name: $steps.lookup-food.outputs.foodName
    nutrients: $steps.lookup-food.outputs.nutrients
    totalMatches: $steps.search-foods.outputs.totalMatches

Work with this as data

Every workflow here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for arazzo workflows

4 MCP tools reach this
  • find_arazzoBrowse and filter every workflow in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This workflow
curl "https://apis.io/api/v1/arazzo/nutrientsdb-search-then-lookup"
All arazzo workflows
curl "https://apis.io/api/v1/arazzo?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.