Ingredient lines that read in the recipe's own language
Swedish recipes now read like Swedish, and recipes keep their sections.
Here's a bug that bugged us for a while. You'd fetch a Swedish recipe and get lines like "8 cloves vitlök, finely chopped". Half Swedish, half English. The data underneath was fine. The words on the screen were not.
That's fixed now. Ingredient lines come back in the recipe's own language. The garlic line looks like this:
{
"display": "8 klyftor vitlök, finhackade",
"original": "8 klyftor vitlök, finhackade",
"name": "garlic",
"localName": "vitlök",
"preparation": "finely chopped",
"localPreparation": "finhackade",
"quantity": { "value": 8, "unit": "clove" },
"optional": false
}
Think of it as two layers. display is the line you show people. It uses the units a Swedish cook expects, like msk and tsk. German recipes get EL and TL. original is the line exactly as the site wrote it, and we never touch it.
The other layer is for your code. name, preparation and quantity are always in English. Units come from one short list, so "msk" shows up as tbsp and you only need to handle one spelling. If you want to build your own line, localName and localPreparation give you the same facts in the recipe's language.
Most ingredients also get an ingredientId, like chicken-thigh. It's the same id in every language. That means you can find every recipe with chicken thighs, whether it was written in English, Swedish or Italian.
Recipes keep their sections
Lots of recipes come in parts. The dough and the filling. The cake and the frosting. Those sections used to get flattened into one long list. Now each ingredient and step remembers the group it belongs to, and groups lists them in order:
"groups": ["Hummus"],
"instructions": [
{ "group": "Hummus", "step": 1, "text": "Blend everything through milk in a food processor." },
{ "group": "Hummus", "step": 2, "text": "Add flour by the spoonful and blend until smooth." },
{ "step": 3, "text": "Stir in dark chocolate." },
{ "step": 4, "text": "Chill before serving." }
]
Some sites write headings like "FOR THE SAUCE:" as if they were ingredients. We spot those now and turn them into sections too. No more weird ingredient called "for the sauce".
While we were in there, we tidied up two more things. Every recipe now has courses, like dinner, dessert or side-dish. If the site didn't say, we work it out. And kitchen tools that sneak into ingredient lists, like kitchen twine, now go to equipment where they belong.
So what can you do with all this? Build a recipe app for Swedish or German cooks that actually reads like their language. Show sections as headings, or let a cook mode walk through one part at a time. Make ingredient pages that work across languages. Or line up amounts in their own column using quantity.
Every field is in the recipe object reference. Grab a free key and try a recipe in the API docs.