Multiplying a recipe by 1.5 is easy math. Making the answer usable in a real kitchen is not. Nobody owns a 0.1667 cup measure, and "1.5 eggs" isn't something you can crack.
So I built an API that scales recipes and writes the results the way a cook would.
Example: a 4-serving recipe scaled to 6
Send the ingredient lines with the old and new servings:
{
"ingredients": [
"1 1/2 cups flour",
"2 eggs",
"1/2 cup butter",
"1 tsp vanilla extract",
"Pinch of salt"
],
"servings": 4,
"target_servings": 6
}
And you get back:
2 1/4 cups flour3 eggs3/4 cup butter1 1/2 teaspoons vanilla extract-
Pinch of salt(left alone, since a pinch is a pinch)
Each line also comes back as structured JSON with the quantity, unit and ingredient, so you can display it however you like.
The details that make it kitchen-friendly
-
Measurable fractions. Results round to 1/8, 1/4, 1/3, 1/2, 2/3, 3/4. If rounding moved an amount more than 3%, the result is flagged
approximate. -
Unit tidying.
8 tbspbecomes1/2 cup,48 tspbecomes1 cup. - Whole items. If eggs or lemons come out fractional, you get a tip like "Works out to 1 1/2; round to 1 or 2 as you prefer."
-
US ↔ metric.
/convertturns2 cups milkinto475ml milk.
Quick example (Python)
import requests
resp = requests.post(
"https://recipe-scaler.p.rapidapi.com/scale",
json={
"ingredients": ["1 1/2 cups flour", "2 eggs"],
"servings": 4,
"target_servings": 6,
},
headers={
"X-RapidAPI-Key": "your-key",
"X-RapidAPI-Host": "recipe-scaler.p.rapidapi.com",
},
)
for item in resp.json()["results"]:
print(item["text"])
One honest limitation
Converting cups of flour to grams depends on the ingredient's density, so volume-to-weight conversion isn't supported yet. You get a clear error instead of a wrong number.
Try it
There's a free plan, so you can test it on your own recipes without paying anything.
It pairs with my Recipe Extractor, which pulls the ingredient list from any recipe link to scale. Each line is read by my Ingredient Parser, which you can also use on its own.
What would you want it to handle next? Let me know in the comments.
Top comments (0)