# ExactCup

> Convert cooking and baking ingredients between cups and grams. Find what a cup, tablespoon or teaspoon of 80 ingredients weighs, turn a weight back into cups, and weigh a whole recipe in one step, using US, metric or imperial measures. No account or API key required.

App · 7 actions. Web page: https://docs.lodol.com/docs/integrations/exactcup

## Actions

### Convert a recipe to grams

Weigh every line of a recipe in one step: give each ingredient with its amount and unit, and get back the grams and ounces for each line plus the total. Lines already in ounces or pounds are converted too. A line that cannot be matched comes back with the reason instead of stopping the step. Up to 50 lines. No API key required.

**Inputs**

- Recipe lines (`items`, list, required): One row per ingredient: its name, the amount (1.5, 3/4 or 1 1/2), and the unit. Up to 50 lines.

**Outputs**

- `attribution` (text): ExactCup's credit line. Its data is CC BY 4.0, so show this with a link wherever the numbers are published.
- `converted_count` (number): How many lines were converted.
- `count` (number): How many lines were given.
- `failed_count` (number): How many lines could not be converted.
- `items` (list): One row per recipe line, in the order given.
- `total_grams` (number): The weight of every converted line together.
- `total_ounces` (number): The same total in ounces.

**Example output**

```json
{
  "attribution": "Ingredient density data by ExactCup (https://exactcup.github.io/)",
  "converted_count": 1,
  "count": 1,
  "failed_count": 0,
  "items": [
    {
      "amount": 2.0,
      "converted": true,
      "error": null,
      "grams": 240.0,
      "ingredient": "all-purpose-flour",
      "ingredient_name": "All-Purpose Flour",
      "input_ingredient": "plain flour",
      "ounces": 8.47,
      "unit": "us_cup"
    }
  ],
  "total_grams": 240.0,
  "total_ounces": 8.47
}
```

### Convert cups to grams

Find out what a measured amount of an ingredient weighs: 1 1/2 cups of flour, 3 tablespoons of honey, 250 mL of milk. Gives the weight in grams, ounces, kilograms and pounds. Works with US, metric and imperial cups and spoons. No API key required.

**Inputs**

- Ingredient (`ingredient`, text, required): The ingredient to weigh. Pick one from the list, or use a name from an earlier step: 'all-purpose flour', 'plain flour' and 'icing sugar' are all understood.
- Amount (`amount`, number, required): How much, for example 1.5. Fractions from a recipe such as 3/4 or 1 1/2 work too. At least 0.
- Measured in (`unit`, text): The unit the amount is measured in. US cups by default. One of: `us_cup` (US cups), `us_tablespoon` (US tablespoons), `us_teaspoon` (US teaspoons), `milliliter` (Millilitres (mL)), `liter` (Litres), `us_fluid_ounce` (US fluid ounces), `us_pint` (US pints), `us_quart` (US quarts), `us_gallon` (US gallons), `metric_cup` (Metric cups (250 mL: UK, Australia, NZ)), and 4 more. Default: `us_cup`.

**Outputs**

- `amount` (number): The amount that was weighed.
- `attribution` (text): ExactCup's credit line. Its data is CC BY 4.0, so show this with a link wherever the numbers are published.
- `grams` (number): The weight in grams, to 0.1 g.
- `grams_per_us_cup` (number): What one US cup of it weighs, in grams.
- `ingredient` (text): The id of the ingredient that was weighed.
- `ingredient_name` (text): Its name, e.g. 'All-Purpose Flour'.
- `kilograms` (number): The weight in kilograms.
- `milliliters` (number): The amount's volume in millilitres.
- `ounces` (number): The weight in ounces.
- `pounds` (number): The weight in pounds.
- `unit` (text): The unit it was measured in, e.g. 'us_cup'.
- `unit_name` (text): The unit's name, e.g. 'US cups'.

**Example output**

```json
{
  "amount": 1.5,
  "attribution": "Ingredient density data by ExactCup (https://exactcup.github.io/)",
  "grams": 180.0,
  "grams_per_us_cup": 120.0,
  "ingredient": "all-purpose-flour",
  "ingredient_name": "All-Purpose Flour",
  "kilograms": 0.18,
  "milliliters": 354.9,
  "ounces": 6.35,
  "pounds": 0.397,
  "unit": "us_cup",
  "unit_name": "US cups"
}
```

### Convert grams to cups

Turn a weight of an ingredient into a measure you can scoop: 200 g of flour is about 1 2/3 cups. Gives the amount in the unit you choose, the nearest everyday measure, and the same amount in US cups, tablespoons, teaspoons and mL. No API key required.

**Inputs**

- Ingredient (`ingredient`, text, required): The ingredient to weigh. Pick one from the list, or use a name from an earlier step: 'all-purpose flour', 'plain flour' and 'icing sugar' are all understood.
- Amount (`amount`, number, required): How much, for example 1.5. Fractions from a recipe such as 3/4 or 1 1/2 work too. At least 0.
- Weighed in (`weight_unit`, text): The unit the amount is weighed in. Grams by default. One of: `gram` (Grams), `kilogram` (Kilograms), `ounce` (Ounces), `pound` (Pounds). Default: `gram`.
- Convert to (`volume_unit`, text): The measure to convert to. US cups by default. One of: `us_cup` (US cups), `us_tablespoon` (US tablespoons), `us_teaspoon` (US teaspoons), `milliliter` (Millilitres (mL)), `liter` (Litres), `us_fluid_ounce` (US fluid ounces), `us_pint` (US pints), `us_quart` (US quarts), `us_gallon` (US gallons), `metric_cup` (Metric cups (250 mL: UK, Australia, NZ)), and 4 more. Default: `us_cup`.

**Outputs**

- `amount` (number): The weight that was converted.
- `attribution` (text): ExactCup's credit line. Its data is CC BY 4.0, so show this with a link wherever the numbers are published.
- `grams` (number): The weight in grams.
- `ingredient` (text): The id of the ingredient.
- `ingredient_name` (text): Its name, e.g. 'All-Purpose Flour'.
- `kitchen_measure` (text): The nearest everyday US measure, e.g. '1 2/3 cups' or '2 tablespoons'.
- `milliliters` (number): The amount in millilitres.
- `us_cups` (number): The amount in US cups.
- `us_tablespoons` (number): The amount in US tablespoons.
- `us_teaspoons` (number): The amount in US teaspoons.
- `volume` (number): The amount in the chosen measure.
- `volume_unit` (text): The chosen measure, e.g. 'us_cup'.
- `volume_unit_name` (text): The measure's name, e.g. 'US cups'.
- `weight_unit` (text): The unit it was weighed in, e.g. 'gram'.

**Example output**

```json
{
  "amount": 200.0,
  "attribution": "Ingredient density data by ExactCup (https://exactcup.github.io/)",
  "grams": 200.0,
  "ingredient": "all-purpose-flour",
  "ingredient_name": "All-Purpose Flour",
  "kitchen_measure": "1 2/3 cups",
  "milliliters": 394.3,
  "us_cups": 1.667,
  "us_tablespoons": 26.67,
  "us_teaspoons": 80.0,
  "volume": 1.667,
  "volume_unit": "us_cup",
  "volume_unit_name": "US cups",
  "weight_unit": "gram"
}
```

### Get an ingredient's weights

Look up one ingredient: what a US cup, tablespoon and teaspoon of it weigh, its density, and ExactCup's ready-made charts for common cup measures, tablespoons and gram weights. No API key required.

**Inputs**

- Ingredient (`ingredient`, text, required): The ingredient to weigh. Pick one from the list, or use a name from an earlier step: 'all-purpose flour', 'plain flour' and 'icing sugar' are all understood.

**Outputs**

- `aliases` (list): Other names it goes by, e.g. 'plain flour'.
- `attribution` (text): ExactCup's credit line. Its data is CC BY 4.0, so show this with a link wherever the numbers are published.
- `category` (text): The group it belongs to: flour, sugar, dairy, baking or grain.
- `category_name` (text): The group's name, e.g. 'Flours & Starches'.
- `cups_to_grams` (list): Common cup measures and what they weigh.
- `grams_per_ml` (number): Density in grams per millilitre.
- `grams_per_us_cup` (number): Grams in one level US cup (236.6 mL).
- `grams_per_us_tablespoon` (number): Grams in one level US tablespoon.
- `grams_per_us_teaspoon` (number): Grams in one level US teaspoon.
- `grams_to_cups` (list): Common weights and how many cups they fill.
- `name` (text): The ingredient's name, e.g. 'All-Purpose Flour'.
- `ounces_per_us_cup` (number): Weight of one US cup in ounces.
- `slug` (text): The ingredient's id, e.g. 'all-purpose-flour'.
- `tablespoons_to_grams` (list): Common tablespoon counts and what they weigh.
- `url` (text): The ingredient's page on ExactCup.

**Example output**

```json
{
  "aliases": [
    "plain flour",
    "ap flour"
  ],
  "attribution": "Ingredient density data by ExactCup (https://exactcup.github.io/)",
  "category": "flour",
  "category_name": "Flours & Starches",
  "cups_to_grams": [
    {
      "cups": "1/4",
      "cups_decimal": 0.25,
      "grams": 30.0
    },
    {
      "cups": "1 1/4",
      "cups_decimal": 1.25,
      "grams": 150.0
    }
  ],
  "grams_per_ml": 0.5072,
  "grams_per_us_cup": 120.0,
  "grams_per_us_tablespoon": 7.5,
  "grams_per_us_teaspoon": 2.5,
  "grams_to_cups": [
    {
      "cups": 0.833,
      "grams": 100.0
    },
    {
      "cups": 2.083,
      "grams": 250.0
    }
  ],
  "name": "All-Purpose Flour",
  "ounces_per_us_cup": 4.233,
  "slug": "all-purpose-flour",
  "tablespoons_to_grams": [
    {
      "grams": 7.5,
      "tablespoons": 1.0
    },
    {
      "grams": 15.0,
      "tablespoons": 2.0
    }
  ],
  "url": "https://exactcup.github.io/cups-to-grams/all-purpose-flour/"
}
```

### List ingredient groups

List the groups ExactCup files its ingredients under (flours, sugars, dairy and fats, baking ingredients, grains) with the ingredients in each. No API key required.

**Inputs**: None.

**Outputs**

- `attribution` (text): ExactCup's credit line. Its data is CC BY 4.0, so show this with a link wherever the numbers are published.
- `categories` (list): Every ingredient group.
- `count` (number): How many groups there are.

**Example output**

```json
{
  "attribution": "Ingredient density data by ExactCup (https://exactcup.github.io/)",
  "categories": [
    {
      "category": "flour",
      "ingredient_count": 2,
      "ingredients": [
        "all-purpose-flour",
        "bread-flour"
      ],
      "name": "Flours & Starches",
      "url": "https://exactcup.github.io/flour-conversion-chart/"
    }
  ],
  "count": 1
}
```

### List ingredients

List the cooking and baking ingredients ExactCup covers, with what a US cup, tablespoon and teaspoon of each weighs. Narrow it to one group or to names containing some text. No API key required.

**Inputs**

- Group (`category`, text): Only ingredients in this group. Leave empty for all. One of: `flour` (Flours & Starches), `sugar` (Sugars & Syrups), `dairy` (Dairy & Fats), `baking` (Baking Ingredients), `grain` (Grains & Misc).
- Name contains (`search`, text): Only ingredients whose name, or another name they go by, contains this text. Not case sensitive.

**Outputs**

- `attribution` (text): ExactCup's credit line. Its data is CC BY 4.0, so show this with a link wherever the numbers are published.
- `count` (number): How many ingredients matched.
- `ingredients` (list): The ingredients that matched.

**Example output**

```json
{
  "attribution": "Ingredient density data by ExactCup (https://exactcup.github.io/)",
  "count": 1,
  "ingredients": [
    {
      "aliases": [
        "plain flour",
        "ap flour"
      ],
      "category": "flour",
      "category_name": "Flours & Starches",
      "grams_per_ml": 0.5072,
      "grams_per_us_cup": 120.0,
      "grams_per_us_tablespoon": 7.5,
      "grams_per_us_teaspoon": 2.5,
      "name": "All-Purpose Flour",
      "ounces_per_us_cup": 4.233,
      "slug": "all-purpose-flour",
      "url": "https://exactcup.github.io/cups-to-grams/all-purpose-flour/"
    }
  ]
}
```

### List measuring units

List every measuring unit ExactCup converts with and its exact size: cups, spoons and fluid ounces (US, metric, imperial and Australian) in millilitres, and weights in grams. No API key required.

**Inputs**: None.

**Outputs**

- `attribution` (text): ExactCup's credit line. Its data is CC BY 4.0, so show this with a link wherever the numbers are published.
- `volume_unit_count` (number): How many volume units there are.
- `volume_units` (list): Volume units and their size in millilitres.
- `weight_unit_count` (number): How many weight units there are.
- `weight_units` (list): Weight units and their size in grams.

**Example output**

```json
{
  "attribution": "Ingredient density data by ExactCup (https://exactcup.github.io/)",
  "volume_unit_count": 14,
  "volume_units": [
    {
      "milliliters": 236.5882365,
      "name": "US cups",
      "unit": "us_cup"
    },
    {
      "milliliters": 250.0,
      "name": "metric cups",
      "unit": "metric_cup"
    }
  ],
  "weight_unit_count": 4,
  "weight_units": [
    {
      "grams": 1.0,
      "name": "grams",
      "unit": "gram"
    },
    {
      "grams": 28.349523125,
      "name": "ounces",
      "unit": "ounce"
    }
  ]
}
```
