Ingredient pairings
What an ingredient is most often cooked with, counted from real recipes, for "what goes with X" or for filling in a dish.
/ingredients/{id}/pairingsAPI keyReturns the ingredients that recipes most often use together with this one, counted from the recipes the API serves. Use it to answer "what goes with basil" or to fill in a dish around an ingredient. Each pairing says in how many of the ingredient's recipes it appears, and `share` says what fraction of them that is. An ingredient on two lines of one recipe counts once. Salt, pepper, oil, sugar, flour and water go with everything, so they are left out unless you send `staples=true`. For a very common ingredient the count reads its first 5,000 recipes; `recipeCount` says how many were read.
Request
curl 'https://api.tinyplates.dev/ingredients/basil/pairings?limit=3' \
-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
idstringrequiredThe canonical ingredient id, such as "basil".
limitintegerdefaults to201–50How many pairings to return.
staplesstringWhether the staples a kitchen is assumed to have — salt, sea salt, kosher salt, pepper, black pepper, water, oil, olive oil, vegetable oil, sugar, flour, all-purpose flour — can be pairings. Defaults to "false".
Response
ingredientobject
ingredientobjectidstringThe canonical id.
namestringThe canonical English name.
The ingredient the pairings are for.
pairings[]object[]
pairings[]object[]idstringThe canonical id.
namestringThe canonical English name.
recipeCountintegerHow many of the recipes read also use it.
sharenumberThe fraction of the recipes read that also use it, from 0 to 1, rounded to three decimals.
The ingredients used with it, most often first. Empty when no recipe the API serves uses it.
recipeCountintegerHow many recipes using the ingredient were read, at most 5,000.
Example
{
"ingredient": {
"id": "basil",
"name": "basil"
},
"pairings": [
{
"id": "garlic",
"name": "garlic",
"recipeCount": 214,
"share": 0.535
},
{
"id": "tomato",
"name": "tomato",
"recipeCount": 188,
"share": 0.47
},
{
"id": "parmesan",
"name": "parmesan",
"recipeCount": 131,
"share": 0.328
},
{
"id": "onion",
"name": "onion",
"recipeCount": 119,
"share": 0.298
},
{
"id": "mozzarella",
"name": "mozzarella",
"recipeCount": 64,
"share": 0.16
}
],
"recipeCount": 400
}Errors
- 400
The "limit" parameter must be a whole number between 1 and 50; got "100".
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.
- 400
The "staples" parameter must be "true" or "false"; got "yes". Send "staples=true" to include salt, pepper, oil and the other staples as pairings.
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.
- 404
Ingredient not found.
No ingredient has that canonical id. Turn a name such as "fresh cilantro" into its id with /ingredients/resolve first.
- 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.