Skip to content

Ingredient substitutions

What to use instead of an ingredient, in what amount and how to handle it, and when the swap does not work. An ingredient with no known swap gets no guess.

GET/substitutionsAPI key

What 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, 50 requests a day and 300 a week.

Parameters

  • ingredientsstringrequired

    The ingredients to replace: 1 to 20 comma-separated names or canonical ids, each at most 80 characters. Required.

Response

substitutions[]object[]
ingredientstring

The ingredient asked about, normalized.

optionsobject[]

The substitutes, each with `ingredient`, `ratio` (how much to use for one unit of the original), an optional `note` on handling it, and an optional `caution` saying what it cannot be used for.

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. Every endpoint except the root, /health, /docs and /openapi.json requires one.

  • 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

    Daily allowance of 50 requests used. It resets at midnight UTC. Paid plans include more; see https://www.tinyplates.dev/pricing.

    The account has used its 50 requests for the day. The allowance is per account, so another key will not help. It resets at midnight UTC.

  • 429

    Weekly allowance of 300 requests used. It covers the last 7 days. Paid plans include more; see https://www.tinyplates.dev/pricing.

    The account has used its 300 requests over the last 7 days, today included. The allowance is per account, so another key will not help. Room comes back as older days drop out of the window.

  • 429

    Daily limit of 5,000 requests on the Personal plan reached. It resets at midnight UTC. Contact us for a higher limit.

    The account has used its plan's limit for the day. The message names the number and the plan, which differ between accounts. The limit is per account, so another key will not help. It resets at midnight UTC.

  • 429

    Weekly limit of 30,000 requests on the Business plan reached. It covers the last 7 days. Contact us for a higher limit.

    The account has used the weekly limit set on it over the last 7 days, today included. The message names the number and the plan. Only accounts with a weekly limit can see this. Room comes back as older days drop out of the window.

  • 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.