icon
Ingredient Parser
Convert ingredient strings into structured JSON data

API

The Ingredient Parser API extracts and classifies the individual components that comprise an ingredient. The parsing algorithm utilizes C++ machine learning in the back-end to quickly parse and return your ingredient string as a structured JSON object.

Endpoints

parse-ingredient

The parse-ingredient endpoint takes an ingredient string as input:
"3 tablespoons all-purpose flour"

And returns the parsed input as a JSON object:

{
  "ingredient": {
    "error_code": null,
    "input": "3 tablespoons all-purpose flour",
    "quantity": "3",
    "unit": "tablespoon",
    "name": "all-purpose flour",
    "quantity_end": null,
    "size": null,
    "suggested_amount": null,
    "comments": null
  },
  "error": {
    "code": null,
    "message": null
  }
}

parse-ingredients

The parse-ingredients endpoint takes a list of ingredient strings as input:
[ "3 tablespoons all-purpose flour", "½ cup packed brown sugar", "3 to 4 large honey crisp apples" ]

And returns the parsed input as a list of JSON objects:

{
  "ingredients": [
    {
      "error_code": null,
      "input": "3 tablespoons all-purpose flour",
      "quantity": "3",
      "unit": "tablespoon",
      "name": "all-purpose flour",
      "quantity_end": null,
      "size": null,
      "suggested_amount": null,
      "comments": null
    },
    {
      "error_code": null,
      "input": "½ cup packed brown sugar",
      "quantity": "0.500",
      "unit": "cup",
      "name": "brown sugar",
      "quantity_end": null,
      "size": null,
      "suggested_amount": null,
      "comments": "packed"
    },
    {
      "error_code": null,
      "input": "3 to 4 large honey crisp apples",
      "quantity": "3",
      "unit": null,
      "name": "honey crisp apples",
      "quantity_end": "4",
      "size": "large",
      "suggested_amount": null,
      "comments": null
    }
  ],
  "error": {
    "code": null,
    "message": null
  }
}

Subscribe