Skip to content
merran
GitHubInstall

Merran documentation API & integrations

Stand-ins for an ingredient

POST
/api/recipes/{recipe}/stand-ins
curl --request POST \
--url http://localhost:3000/api/recipes/lemon-chicken/stand-ins \
--header 'Content-Type: application/json' \
--cookie merran.session_token=<merran.session_token> \
--data '{ "ingredientId": "0199e8b0-5a10-7a01-8b00-000000000012" }'

For an ingredient someone’s out of, or doesn’t eat: two to four stand-ins that work in this recipe, with amounts for the recipe as written, what’s in the pantry first, and nothing the household avoids or that’s against its diets. Each says how to use it, and rewrites any step it changes. Nothing is saved; use POST /recipes/{recipe}/swap to put one in the recipe. Uses the household’s model for swaps, and counts towards its AI spend. With an API key, it needs the recipes: write permission.

recipe
required

The recipe’s id, or its slug.

string

Example

lemon-chicken

The recipe’s id, or its slug.

Media typeapplication/json
object
ingredientId
required
string

Example

0199e8b0-5a10-7a01-8b00-000000000012

Example

{
"ingredientId": "0199e8b0-5a10-7a01-8b00-000000000012"
}

Stand-ins, best first; maybe none.

Media typeapplication/json
object
swaps
required
Array<object>
object
lines
required

Ingredient lines in its place, with amounts for the recipe as written.

Array<string>
note
required

How to use it, and how it changes the dish.

string
atHome
required

It’s in the pantry.

boolean
steps
required

Steps it changes, rewritten. Usually none.

Array<object>
object
stepId
required
string
text
required

The step, rewritten.

string
<= 5000 characters

Example

{
"swaps": [
{
"lines": [
"1 cup Greek yogurt"
],
"note": "Stir in off the heat so it doesn't split; a little tangier.",
"atHome": true,
"steps": []
}
]
}

Not signed in.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
fields
object
key
additional properties
string

Example

{
"error": {
"code": "not_found",
"message": "There's nothing here.",
"fields": {
"name": "Give it a name."
}
}
}

Not allowed.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
fields
object
key
additional properties
string

Example

{
"error": {
"code": "not_found",
"message": "There's nothing here.",
"fields": {
"name": "Give it a name."
}
}
}

No such recipe, or no such ingredient in it.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
fields
object
key
additional properties
string

Example

{
"error": {
"code": "not_found",
"message": "There's nothing here.",
"fields": {
"name": "Give it a name."
}
}
}

This month’s AI limit is reached, or the AI is busy.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
fields
object
key
additional properties
string

Example

{
"error": {
"code": "not_found",
"message": "There's nothing here.",
"fields": {
"name": "Give it a name."
}
}
}

The AI provider failed.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
fields
object
key
additional properties
string

Example

{
"error": {
"code": "not_found",
"message": "There's nothing here.",
"fields": {
"name": "Give it a name."
}
}
}

© 2026 Kyle Johnson. Documentation: CC BY 4.0. Merran: AGPL-3.0-or-later.