Ingredient substitutions
What to use instead of an ingredient, in what amount, and when not to.
/substitutionsAPI keyWhat to use instead of an ingredient. `ingredients` is a comma-separated list of names or canonical ids. Each option says how much of the substitute to use for one unit of the original, how to handle it, and — where it matters — what the swap cannot be used for. An ingredient nothing is known to substitute for comes back in `unknown`: a plausible-looking wrong ratio is worse than no answer.
Request
curl 'https://api.tinyplates.dev/substitutions?ingredients=butter%2Ccream' \
-H 'Authorization: Bearer rd_your_api_key'Sign in to run this request with your own key. Free, 500 requests a day.
Parameters
ingredientsstringrequiredThe ingredients to replace: 1 to 20 comma-separated names or canonical ids, each at most 80 characters. Required.
Response
One entry per ingredient that has substitutions.
unknownstring[]The ingredients nothing is known to substitute for. Nothing is suggested for them.
Example
{
"substitutions": [
{
"ingredient": "butter",
"options": [
{
"caution": "Not for creaming into a batter or for pastry, where solid fat is what makes the texture.",
"ingredient": "olive oil",
"note": "Use three quarters as much. The result is softer and does not brown the same way.",
"ratio": 0.75
},
{
"ingredient": "margarine",
"note": "Use a block, not a spread: spreads carry more water.",
"ratio": 1
}
]
}
],
"unknown": [
"saffron"
]
}Errors
- 400
The "ingredients" parameter is required. Send the ingredients you want to replace, such as "butter,cream".
A parameter was not a value the API accepts. The message names the parameter, the value it was given and where the allowed values are listed.
- 401
An API key is required. Pass it as an Authorization: Bearer header.
No key was sent, and this deployment requires one. Keys are optional today and will become required.
- 401
Invalid API key.
The key does not exist. Check for a truncated copy, or create a new one on your dashboard.
- 401
This API key has been disabled.
The key was revoked. Create a new one on your dashboard.
- 401
This API key has expired.
The key was created with an expiry that has passed. Create a new one.
- 429
Rate limit exceeded for this API key. Try again later.
The account has used its 500 requests for the day. The allowance is per account, so another key will not help. It resets at midnight UTC.
- 500
Something went wrong. Please try again.
The API could not answer. The request was not your fault; retry it, and report it if it keeps happening.
See also
Concepts
Reference