---
title: "Ingredient pairings — Tiny Plates recipe API"
description: "What an ingredient is most often cooked with, counted from real recipes, for \"what goes with X\" or for filling in a dish."
url: "https://www.tinyplates.dev/docs/api/ingredient-pairings"
---

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

GET`/ingredients/{id}/pairings`API key

Returns 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'
```

id\*

limit

staples

Sign in to run this request with your own key. Free, 50 requests a day and 300 a week.

[Create an account](https://www.tinyplates.dev/sign-up)[Sign in](https://www.tinyplates.dev/sign-in)

## Parameters

* `id`stringrequired  
The canonical ingredient id, such as "basil".
* `limit`integerdefaults to `20`1–50  
How many pairings to return.
* `staples`string  
Whether 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

`ingredient`object

`id`string

The canonical id.

`name`string

The canonical English name.

The ingredient the pairings are for.

`pairings[]`object\[\]

`id`string

The canonical id.

`name`string

The canonical English name.

`recipeCount`integer

How many of the recipes read also use it.

`share`number

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

`recipeCount`integer

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

See also

Concepts

* [Authentication](https://www.tinyplates.dev/docs/authentication)
* [Errors](https://www.tinyplates.dev/docs/errors)
* [Rate limits](https://www.tinyplates.dev/docs/rate-limits)

Reference

* [Ingredient substitutions](https://www.tinyplates.dev/docs/api/substitutions)
* [Resolve ingredient names](https://www.tinyplates.dev/docs/api/resolve-ingredients)
* [Get an ingredient](https://www.tinyplates.dev/docs/api/get-ingredient)
* [List ingredients](https://www.tinyplates.dev/docs/api/list-ingredients)
* [Vocabularies](https://www.tinyplates.dev/docs/api/vocabularies)
