Pairings
The 'pairings' endpoint allows you to generate beverage pairings that go well with a given meal. Customers have the choice of receiving the response as JSON or as a readable stream.
Introduction
This API route allows you to generate beverage pairings that go well with a given meal.
Authentication
To access these endpoints, you must include an Authorization
header with a valid API key.
Common Request Parameters
Both routes accept the following request parameters:
drinkType
(enum, required): Specifies the type of beverage you want recommendations for ['beer', 'wine']meal
(string, required): Describes the meal for which you want beverage pairings.language
(string, optional): The language in which the recipe should be generated. Supported languages ['english', 'spanish', 'portuguese', 'french', 'italian', 'german', 'chinese', 'japanese', 'korean', 'hebrew']. Default: "english".
JSON Route Details
Endpoint
POST /api/generate/pairings
Request Example
POST /api/generate/pairings
Headers:
{
"Authorization": "YOUR_API_KEY"
}
Body:
{
"drinkType": "wine",
"meal": "Grilled Salmon"
}
Response (JSON)
- Status Code: 200 (OK)
- Content-Type: application/json
[
{
"rank": 1,
"producer": "Winery A",
"name": "Wine 1",
"styles": "Red",
"country": "US",
"tasteProfile": {
"sweetness": "Dry",
"acidity": "Medium",
"tannin": "High",
"body": "Full"
},
"alcolVolume": "13%",
"priceRange": "$$$"
},
// Additional pairings...
]
Execution Time
As responses are generated on the fly through AI, response time will vary depending on the lenght of the response. Approximate time for response is 15s for the 'pairings' endpoint.
Error Responses
Both routes return specific error responses for various scenarios:
- Missing API Key (Status Code: 403):
- Response:
No API Key in request
- Response:
- Invalid API Key (Status Code: 403):
- Response:
Invalid API Key
- Response:
- Missing Required Inputs (Status Code: 400):
- Response:
Required inputs not provided
- Response:
- Inactive Subscription (Status Code: 403):
- Response:
You don't have an active subscription
- Response: